[PATCH] coroutines: Backout mandate for tailcalls at O < 2 [PR94359]

Nathan Sidwell nathan@acm.org
Thu Apr 16 14:05:19 GMT 2020


On 4/16/20 9:51 AM, Iain Sandoe wrote:
> Hi
> 
> For symmetric transfers to work with C++20 coroutines, it is
> currently necessary to tail call the callee coroutine from resume
> method of the caller coroutine.  However there are several targets
> which don't support an indirect tail call to an arbitrary callee.
> 
> Unfortunately, the target 'function_ok_for_sibcall' is not usable
> from the front end in all cases.  While it is possible to add a new
> hook to cover this circumstance, IMO, it is too late in the release
> cycle to be sure of getting the setting correct for all targets***.
> 
> So, this patch backs out the use of function_ok_for_sibcall () and
> the mandate of CALL_EXPR_MUST_TAIL_CALL from the symmetric
> transfer.
> 
> Targets that can make indirect tail calls to arbitrary callees will
> still be able to make use of the symmetric transfer (without risking
> overrunning the stack) for optimization levels >= 2.
> 
> The draft standard does not mandate unlimited symmetric transfers,
> so removing this is a QOI issue (albeit an important one) rather
> than a correctness one.
> 
> The test is moved and adjusted so that it can be opted into by any
> target that supports the necessary tailcall.
> 
> (tested on x86_64-linux/darwin, powerpc64-linux, sparc-solaris11)
> OK for master?
> thanks
> Iain

OK.  will you leave 94359 open, or is there a separate bug for the lack 
of generalized symmetric xfer?

nathan


-- 
Nathan Sidwell


More information about the Gcc-patches mailing list