[Bug tree-optimization/64718] Bad 16-bit bswap replacement
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jan 21 19:48:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64718
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
A run-time testcase:
[hjl@gnu-mic-2 gcc-regression]$ cat pr64718.c
int
__attribute__ ((noinline, noclone))
swap(int x)
{
return (unsigned short)((unsigned short)x << 8 | (unsigned short)x >> 8);
}
int a = 0x1234;
int
main()
{
int b = 0x1234;
if (swap (a) != 0x3412)
__builtin_abort ();
if (swap (b) != 0x3412)
__builtin_abort ();
return 0;
}
[hjl@gnu-mic-2 gcc-regression]$
More information about the Gcc-bugs
mailing list