GCC 3.2.x - 3.3 Use of optimization -O2 results in an incorrect code.

Eric Botcazou ebotcazou@libertysurf.fr
Tue May 20 17:00:00 GMT 2003


>         RColorStruct *c = (RColorStruct *)&color1;

Not a bug. Your code violates the ISO C aliasing rules. GCC
automatically turns on -fstrict-aliasing at -O2 so you need
to fix your code or compile it with -fno-strict-aliasing.

-- 
Eric Botcazou



More information about the Gcc-bugs mailing list