https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104356
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2022-02-03 CC| |ebotcazou at gcc dot gnu.org --- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > Hmm, but doesn't ada enable -fdelete-dead-exceptions? That is, I'm not sure > we make division by zero well-defined with -fnon-call-exceptions - the > transform assumes the exception cannot happen (because undefinedness) and > removes the exceptional path. Yes, the division by zero can be optimized away in Ada if the result of the operation is not used later, so we would need to add a pragma Volatile to the gnat.dg/div_zero.adb testcase: D : Integer := Zero; pragma Volatile (D); for strict semantics, but this usually does not matter at -O0 when the result is assigned to a user variable: D := 1 / D;