https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118517
--- Comment #1 from Michal Jireš <mjires at gcc dot gnu.org> --- The patch trips up on empty basic block without successors. This block comes from DSE and can be fixed by: --- a/gcc/tree-ssa-dse.cc +++ b/gcc/tree-ssa-dse.cc @@ -1396,8 +1396,9 @@ dse_optimize_call (gimple_stmt_iterator *gsi, sbitmap live_bytes) if (!node) return false; - if (stmt_could_throw_p (cfun, stmt) - && !cfun->can_delete_dead_exceptions) + if ((stmt_could_throw_p (cfun, stmt) + && !cfun->can_delete_dead_exceptions) + || gimple_call_ctrl_altering_p (stmt)) return false;