[Bug c++/23961] code that compiles and runs correctly with no optimization but code optimizes to nothing.

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Sep 19 07:09:00 GMT 2005


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-19 07:09 -------
No because you are violating C/C++ aliasing rules.
See http://gcc.gnu.org/bugs.html
"Casting does not work as expected when optimization is turned on."


It applies to both C and C++.

Yes -Wstrict-aliasing should produce a warning but that is PR 14024.

*** This bug has been marked as a duplicate of 21920 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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



More information about the Gcc-bugs mailing list