On 2/26/21 4:36 PM, Iain Sandoe wrote:
Jason Merrill <ja...@redhat.com> wrote:

On 2/24/21 3:06 PM, Iain Sandoe wrote:

The FE contains a mechanism for cleaning up return expressions if a
function throws during the execution of cleanups prior to the return.
If the original function has a return value with a non-trivial DTOR
and the body contains a var with a DTOR that might throw, the function
decl is marked "throwing_cleanup".
However, we do not [in the coroutine ramp function, which is
synthesised], use any body var types with DTORs that might throw.
The original body [which will then contain the type with the throwing
DTOR] is transformed into the actor function which only contains void
returns, and is also wrapped in a try-catch block.
So (a) the 'throwing_cleanup' is no longer correct for the ramp and
   (b) we do not need to transfer it to the actor which only contains
       void returns.
this is an ICE-on-valid,
tested on x86_64-darwin, x86_64-linux-gnu,
OK for master / 10.x ?

OK, but I wonder if there are other things that should also be reset.

That would be believable but, absent problem reports, have you any advice
on how/what to audit?

Looking at language_function, I guess it would make sense to clear returns_abnormally and infinite_loop{,s}, maybe bindings. Since you're completely replacing the function body, almost none of the information we previously recorded about it in cfun is accurate. But it may be harmless.

Jason

Reply via email to