[Bug c++/34090] -O3 wrong code, -O2 OK

rwgk at yahoo dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 15 02:18:00 GMT 2007



------- Comment #4 from rwgk at yahoo dot com  2007-11-15 02:18 -------
(In reply to comment #3)
> What happens if you add -fno-strict-aliasing ?

That's it!

> And maybe even try with
> warnings turned on.
> 

-Wall doesn't lead to any warnings.

I've been compiling the boost_python runtime library with -fno-strict-aliasing
for some time (just out of fear, although it didn't make a difference so far)
but I used to get away with cutting corners when compiling our extensions
without the -fno-strict-aliasing.

The bulk of our code is expected to be safe with strict aliasing. The
problem is, much of it is in header files as templates. If the Python
bindings dictate that I have to use -fno-strict-aliasing, unfortunately
that means almost all our templates are compiled with the same setting.

But that's not a g++ problem! I suggest closing this problem report.

Thanks!

Ralf


-- 


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



More information about the Gcc-bugs mailing list