https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85803
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
CC| |ebotcazou at gcc dot gnu.org
Target Milestone|--- |6.5
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
More simple cases involve externally thrown (non-call or from const function)
exceptions like
*p = 42;
a / 0;
*p = 0;
or
*p = 42;
*(void *)0 = 0;
*p = 0;
note that with externally thrown EH we do not have any CFG reflecting the EH
and thus other passes are usually also free in re-ordering stmts to make the
*p = 42 side-effect invisible.
I think the only in-tree language eventually specifying behavior for stuff
like above is Ada - so, any comments / attempts for testcases where we do
not follow language specified behavior?
One idea that crossed our minds is to add a return statement to the exit
block having the virtual operand and have externally throwing stmts have
an EH edge to that block (and a fallthru from the regular exit / return stmt).