Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-25 Thread Nathan Sidwell
On 3/24/20 2:08 PM, Iain Sandoe wrote: tree suspend = TREE_VEC_ELT (awaiter_calls, 1); /* await_suspend(). */ + tree susp_type; + if (tree fndecl = cp_get_callee_fndecl_nofold (suspend)) +susp_type = TREE_TYPE (TREE_TYPE (fndecl)); + else +susp_type = TREE_TYPE (suspend); Why,

Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-24 Thread Iain Sandoe
Nathan Sidwell wrote: On 3/24/20 2:08 PM, Iain Sandoe wrote: Hi Nathan, Thanks for the review, comments embedded and a new version attached. @David, you added the CALL_EXPR_MUST_TAIL_CALL which I’ve made use of here (but with an observation). Perhaps you would be able to comment on whether

Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-24 Thread Nathan Sidwell
On 3/24/20 2:08 PM, Iain Sandoe wrote: Hi Nathan, Thanks for the review, comments embedded and a new version attached. @David, you added the CALL_EXPR_MUST_TAIL_CALL which I’ve made use of here (but with an observation). Perhaps you would be able to comment on whether I’ve (ab-)used it

Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-24 Thread Iain Sandoe
void_expr_stmt (resume, loc); >> + add_stmt (resume); >> + >> + r = build_stmt (loc, RETURN_EXPR, NULL); >> + r = maybe_cleanup_point_expr_void (r); > > Shouldn't there be no cleanups? Perhaps assert it didn't add any? no, you’re right, that call’s a waste of time -

Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-24 Thread Nathan Sidwell
On 3/20/20 11:40 AM, Iain Sandoe via Gcc-patches wrote: 2020-03-20 Iain Sandoe * coroutines.cc (coro_init_identifiers): Initialize an identifier for the cororoutine handle 'address' method name. (struct coro_aw_data): Add fields to cover the continuations.

[PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-20 Thread Iain Sandoe via Gcc-patches
Hi, This is the final (non-bug-fixing) patch to bring our implementation into line with n4849. === Although the note in the text [expr.await] / 5.1.1 is not normative, it is asserted by users that an implementation that is unable to perform unlimited symmetric transfers is not terribly