[Bug c/124223] Cast (int32_t)0x80000000 causes the whole loop to be optimized away

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 24 10:12:41 GMT 2026


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

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

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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
As mentioned singed integer overflow is undefined. 
You would get a runtime error if you used -fsanitize=undefined .
The other thing to note is if you read the bug entry page, it mentioned about
trying -fwrapv to see if that resolved your issue that it most likely an issue
with your code ...


More information about the Gcc-bugs mailing list