[Bug tree-optimization/59478] Optimize variable access via byte copy
olegendo at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Nov 19 13:26:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59478
--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Just checked on GCC 9 ...
The case
int float_as_int (float val)
{
char valbytes[sizeof (float)];
for (int i = 0; i < sizeof (float); ++i)
valbytes[i] = ((char*)&val)[i];
int result;
for (int i = 0; i < sizeof (float); ++i)
((char*)&result)[i] = valbytes[i];
return result;
}
still doesn't work. No idea why it doesn't go the same path as the
__builtin_memcpy. Those cases work fine.
Please leave open.
More information about the Gcc-bugs
mailing list