[Bug c++/54046] [4.6/4.7/4.8 Regression] wrong control reaches end of non-void function for switch case with throw and default

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 20 16:03:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54046

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-20 16:02:33 UTC ---
I don't see how.  The thing is, e.g. lower_stmt resets data->cannot_fallthru on
most of the statements, even if it got changed to reset it only on
GIMPLE_LABELs (or few selected others), such that say a noreturn call which
sets data->cannot_fallthru followed by assignment or another call would keep
cannot_fallthru set even when it is currently cleared, on GIMPLE_LABELs we'd
need to reset anyway, as we don't have the CFG yet and don't have info how many
gotos or other control transfer stmts to each GIMPLE_LABEL there are (and the
values of cannot_fallthru at those points).  So even just the break; after the
__cxa_throw which got gimplified into goto <somelabel>; <somelabel>: would
reset cannot_fallthru.  And the gimplifier doesn't see break; but already the
goto



More information about the Gcc-bugs mailing list