[Bug tree-optimization/104263] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 -fnon-call-exceptions -fno-inline-small-functions since r10-3575-g629387a6586a7531

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 28 09:54:07 GMT 2022


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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so with the abnormal edges the issue is that DCE1 removes the recursive
call to foo () (because the function is "wrongly" pure) which causes us to
clear
cfun->calls_setjmp but then any further gimple_purge_dead_abnormal_call_edges
will simply do nothing (as premature optimization one could guess).  So the
bug would be that we fail to wipe all abnormal edges when a function no
longer calls setjmp or has a nonlocal label.

The easiest fix is to remove the premature optimization in
gimple_purge_dead_abnormal_call_edges.  That leaves the abnormal edges from
bar() even after DCE removes the recursive call to foo() (still a missed
optimization) but it at least will not leave us with stray abnormal edges
from non-call / non-computed goto stmts in the IL.

It also resolves the compare-debug failure for this testcase (but maybe there's
a latent issue in store-merging still).


More information about the Gcc-bugs mailing list