[Bug c++/51885] g++ compiler options -O2 and -O3 modifies program results
laurentlouis.maurin at wanadoo dot fr
gcc-bugzilla@gcc.gnu.org
Fri Jan 20 20:04:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51885
--- Comment #4 from Laurent MAURIN <laurentlouis.maurin at wanadoo dot fr> 2012-01-20 19:18:13 UTC ---
i am quite sure there is something strange : reinterpret_cast is used to cast a
float pointer to a uint32_t pointer
these two types have the same size (4 bytes)
therefore, the swap function (following the reinterpret_cast) should work
properly ...
maybe the -O2 and -O3 compiler optimisation flags have an influence on the
binary code generated for the swap function in this example
More information about the Gcc-bugs
mailing list