[Bug c/40312] Compiling with O2 flag lead to wrong binary code (X86 system 32bit)

tlin at a10networks dot com gcc-bugzilla@gcc.gnu.org
Sat May 30 23:08:00 GMT 2009



------- Comment #1 from tlin at a10networks dot com  2009-05-30 23:08 -------
The one compiled with O2 has wrong binary code.

The problem occurs when GCC compiles the following lines with O2 flag.

"
        if (pdw && memcmp(a1, a2, pdw << 2))
                return 0;
"

In the binary code, pdw is not shifted left by 2, which leads to wrong result.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40312



More information about the Gcc-bugs mailing list