--- Comment #4 from ebotcazou at gcc dot gnu dot org 2009-03-01 08:07
---
> There is a bug in the gcc compiler for the C code that changes the behavior of
> a simple program with -O2 optimizations, but not with -O1 or -O0.
-O2 enables -fstrict-aliasing so the code must be written in IS
--- Comment #3 from adeymo at dc dot uba dot ar 2009-03-01 05:08 ---
(From update of attachment 17380)
Compile with:
gcc -save-temps -O2 -Wall -Werror xqsort-small.c -o xqsort-small
Run with:
./xqsort-small && echo ok
If compiled with -O1 , the echo command must be executed.
--
ht
--- Comment #2 from adeymo at dc dot uba dot ar 2009-03-01 05:06 ---
Created an attachment (id=17380)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17380&action=view)
Testcase smaller and simpler
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39330
--- Comment #1 from adeymo at dc dot uba dot ar 2009-03-01 05:05 ---
Created an attachment (id=17379)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17379&action=view)
Testcase with debug information and explanation
Compile with:
gcc -save-temps -O2 -Wall -Werror xqsort.c -o xqsort