https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67563
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ok, so we are somewhat inconsistent in whether fold_stmt () performs EH
transfer
from old to new stmts (even on the 4.9 branch). What triggers here is that
the new replace_call_with_value does it while update_call_from_tree does not
(we're replacing with a NOP). Then the inliner does (through versioning):
if (maybe_clean_or_replace_eh_stmt (old_stmt,
new_stmt))
gimple_purge_dead_eh_edges (
BASIC_BLOCK_FOR_FN (cfun, first));
but we already transfered EH info so maybe_clean_or_replace_eh_stmt returns
false. Other callers of fold_stmt like tree-ssa-forwprop.c or the SSA
propagators
expect the same (not transfered EH info). Testing whether never doing that
from fold_stmt works out ...