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/46443] -O2 flag generates incorrect code


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

--- Comment #2 from Arthur Muller <muller at vki dot com> 2010-11-12 00:09:27 UTC ---
(In reply to comment #1)
> You are violating C/C++ aliasing rules; You are accessing a double as a long
> which causes undefined behavior.  memcpy does not cause this violation since it
> is defined to use the character type to do the copy.
> 
> *** This bug has been marked as a duplicate of bug 21920 ***

Thanks for the clarification!

-Arthur


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