[Bug middle-end/101521] -ftrapv should become something like -fsanitize=undefined -fsanitize-undefined-trap-on-error

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 20 09:48:37 GMT 2021


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-07-20
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  In particular this would free the compiler from caring about
-ftrapv when generating expressions on its own.  It was suggested that this
transform can be done at gimplification time using the
IFN_{ADD,SUB,MUL}_OVERFLOW machinery
(notably negate and division are missing here but easy to test for).


More information about the Gcc-bugs mailing list