https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116927
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- early_ra::is_dead_insn checks side_effects_p but deletable_insn_p (dce.cc) has an extra check: /* Don't delete insns that may throw if we cannot do so. */ if (!(cfun->can_delete_dead_exceptions && can_alter_cfg) && !insn_nothrow_p (insn)) return false; I think is_dead_insn should also have the following: ``` if (cfun->can_delete_dead_exceptions && !insn_nothrow_p (insn)) return false; ``` That is if -fno-delete-dead-exceptions is there and the insn can throw, the insn is not dead.