https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104356
Bug ID: 104356
Summary: [12 Regression] divide by zero trap is being removed
now when it should not be in some cases
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Created attachment 52335
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52335&action=edit
gnat.dg/div_zero.adb
>From https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589490.html
Right, for example in Ada where we now happily turn a division by zero, which
should raise an exception with -gnatp, into nonsense. Do we really need this
rather useless optimization in GCC? Blindly mimicing LLVM is not a reason...
I have installed the attached testcase, which now fails because of the change.
* gnat.dg/div_zero.adb: New test.