[Bug rtl-optimization/64294] invalid code, zero check gets optimized away
gcc at breakpoint dot cc
gcc-bugzilla@gcc.gnu.org
Sat Dec 20 14:35:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294
--- Comment #9 from Sebastian Andrzej Siewior <gcc at breakpoint dot cc> ---
I added the complete function including its callers.
$ gcc -g -o petite petite.c -Wall -O2
$ ./petite
447=> 5
452=> 5
447=> 5
452=> 5
447=> 0
452=> 0
Segmentation fault
---
$ gcc -g -o petite petite.c -Wall -O1
$ ./petite
447=> -12
->1
----
As you see the value in line 447 is different in -O2 vs -O1. And with -O2 it
continues with 0 to start the loop.
I have to run now, maybe I have later some time to figure out why the value in
line 447 is different in -O2 vs -O1.
More information about the Gcc-bugs
mailing list