[Bug c/63358] [4.8.3 - 4.9.1] gcc -O2/-O3 wrong assembly code (crash / Segmentation fault)
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 24 13:09:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63358
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |trippels at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
From https://gcc.gnu.org/bugs/:
»if compiling with -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations makes a difference, your code probably is
not correct.«
markus@x4 tmp % gcc -fsanitize=undefined -Wall -Wextra -O2 main.i
markus@x4 tmp % ./a.out
I = 0, Result = 0
I = 1, Result = 1234567890
main.c:12:11: runtime error: signed integer overflow: 2 * 1234567890 cannot be
represented in type 'int'
More information about the Gcc-bugs
mailing list