https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103451

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
>   // If flag_non_call_exceptions, we must not eliminate a division by zero.
>   if (cfun->can_throw_non_call_exceptions)

Note the check is too restrictive anyways, it should be:
  return (fun->can_throw_non_call_exceptions
          && !fun->can_delete_dead_exceptions

Like what is done in stmt_unremovable_because_of_non_call_eh_p. And yes go
defines can_delete_dead_exceptions to false.

Reply via email to