[Bug c++/34295] Bad optimization in an inlined method
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Nov 29 17:21:00 GMT 2007
------- Comment #3 from rguenth at gcc dot gnu dot org 2007-11-29 17:21 -------
The recommended (and optimized) way to do this is:
union {
INT64 i;
double d;
} x;
x.d = arg;
return x.i;
you can also make your way work optimized by specifying -fno-strict-aliasing.
That it works without optimization is because with that or with -O1
-fno-strict-aliasing is default.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34295
More information about the Gcc-bugs
mailing list