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/31734] optimizer looses ops for with aliasing



------- Comment #3 from ebotcazou at gcc dot gnu dot org  2007-04-29 19:58 -------
> Given that "A character type may alias any other type.",
> I suppose I should be able to use (it works):
> 
> memcpy(&out->fraction, &value, 4);
> memcpy(&out->mantissa, 4+(char*)&value, 4);
> out->mantissa &= 0x7fffffff;

Right, this is valid.


-- 


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


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