https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125711

--- Comment #7 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #5)
> (In reply to Drea Pinski from comment #4)
> > (In reply to Iain Sandoe from comment #3)
> > > hmm .. the reduced case involves neither coroutines nor contracts;  I will
> > > try to repo. locally and take an initial look.
> > 
> > I was suspecting that patch because it touches the gimplifier. 
> > There is one change which looks suspect:
> > - if (!gimple_seq_empty_p (n) && !gimple_seq_empty_p (e))
> > + if (!gimple_seq_empty_p (n) || !gimple_seq_empty_p (e))
> 
> ack, that does look suspicious .. I need to reload state on what the change
> was intended to achieve.

I now have a dim memory that this was fixing a pre-existing bug, which showed
up when implementing the change.

However....

> +     /* Handlers can refer to the function result; if that has been
> +        moved, we need to track it.  */
> +     if (gimplify_ctxp->in_handler_expr && gimplify_ctxp->return_temp)
> +       *expr_p = gimplify_ctxp->return_temp;
>
>which rewrites *expr_p from a RESULT_DECL into a VAR_DECL.  Then in 
>>gimplify_return_expr we don't take the 
>
>  if (!ret_expr
>      || TREE_CODE (ret_expr) == RESULT_DECL)

Seems to suggest that tracking the re-written return expression might need to
be deferred a bit further...

Reply via email to