On Fri, Jan 28, 2022 at 11:29:38AM +0100, Richard Biener wrote:
> This removes a premature optimization from
> gimple_purge_dead_abnormal_call_edges which, after eliding the
> last setjmp (or computed goto) statement from a function and
> thus clearing cfun->calls_setjmp, leaves us with the abnormal
> edges from other calls that are elided for example via inlining
> or DCE.  That's a CFG / IL combination that should be impossible
> (not addressing the fact that with cfun->calls_setjmp and
> cfun->has_nonlocal_label cleared we should not have any abnormal
> edge at all).
> 
> For the testcase in the PR this means that IPA inlining will
> remove the abormal edges from the block after inlining the call
> the edge was coming from.

Couldn't DCE when it clears calls_setjmp and doesn't set it again
(I think we never clear has_nonlocal_label) temporarily set
calls_setjmp and gimple_purge_all_dead_abnormal_call_edges
with it?
Or have next to calls_setjmp a maybe_calls_setjmp flag that
would be sticky like has_nonlocal_labels and would be never cleared?

        Jakub

Reply via email to