This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64718] Bad 16-bit bswap replacement
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Jan 2015 19:48:19 +0000
- Subject: [Bug tree-optimization/64718] Bad 16-bit bswap replacement
- Auto-submitted: auto-generated
- References: <bug-64718-4 at http dot gcc dot gnu dot org/bugzilla/>
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]$