This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31734] optimizer looses ops for with aliasing
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Apr 2007 18:58:35 -0000
- Subject: [Bug c/31734] optimizer looses ops for with aliasing
- References: <bug-31734-8690@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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