[Bug c++/91475] Optimization causes infinite loop

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Aug 16 19:51:00 GMT 2019


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Signed integer overflow is undefined at runtime; this means we cannot error out
when it happens at compile time.  The warning is not done for loops on purpose
since those are normally places where the user wants to take advantage of the
undefineness.

Use -fsanitize=undefined to find it at runtime.
It is hard sometimes to find that the code will run into this code.


More information about the Gcc-bugs mailing list