This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/21666] Optimization level -O2 breaks float (double) conversion


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-19 21:34 -------
(In reply to comment #2)
> Subject: Re:  Optimization level -O2 breaks float (double) conversion
> 
> Dear Pinski and Co.,
> As a former compiler developer myself I was just trying to help, and I'm 
> sorry to tell you that your answer was not to the point.

The code is undefined by the C standard so we could compile it to make your hardware unusable after 
you execute that code (yes I am joking but that is what the C standard allows us to do).  read http://
gcc.gnu.org/bugs.html and the explication on that page about this commonly reported bug.

You can either workaround it by using -fno-strict-aliasing or using an union.  And yes the compiler 
does generate a warning with -Wstrict-aliasing (which is included with -Wall).

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]