This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -O2 bug in gcc 3.2, 3.3 and 3.4 with 64 bit integers on x86
Anders Torger <torger@ludd.luth.se> writes:
> Compiler makes same mistake
Fix your code.
> the only difference is the warning
Which is the whole point. Your example is violating the strict aliasing
rules and thus invoking undefined behaviour.
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Optimize-Options.html#index-fstrict_002daliasing-422
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."