[Bug c/31734] optimizer looses ops for with aliasing
ajrobb at bigfoot dot com
gcc-bugzilla@gcc.gnu.org
Sun Apr 29 18:52:00 GMT 2007
------- Comment #2 from ajrobb at bigfoot dot com 2007-04-29 19:51 -------
Thanks,
I'd forgotten that you can only alias through char* (or types related to the
operand).
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;
As all the elements are word aligned and the size is known, memcpy should get
inlined. The only slight disadvantage is that the final & operation is done
after storing out->mantissa and not before.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31734
More information about the Gcc-bugs
mailing list