This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/61559] New: FAIL: gcc.dg/builtin-bswap-8.c on i686 with -mmovbe
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Jun 2014 09:16:15 +0000
- Subject: [Bug rtl-optimization/61559] New: FAIL: gcc.dg/builtin-bswap-8.c on i686 with -mmovbe
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61559
Bug ID: 61559
Summary: FAIL: gcc.dg/builtin-bswap-8.c on i686 with -mmovbe
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: ubizjak at gmail dot com
Target: i686-pc-linux-gnu
gcc.dg/builtin-bswap-8.c fails on i686 with -mmovbe:
~/gcc-build/gcc/cc1 -O2 -march=corei7 -mmovbe -m32 builtin-bswap-8.c
foo5:
movbe 4(%esp), %eax
movbe 8(%esp), %edx
andl %edx, %eax
bswap %eax
ret
foo6:
movbe 4(%esp), %eax
movbe 8(%esp), %edx
orl %edx, %eax
bswap %eax
ret
foo7:
movbe 4(%esp), %eax
movbe 8(%esp), %edx
xorl %edx, %eax
bswap %eax
ret
It looks that direct swap from memory (movbe) interferes with bswap
elimination. Without -mmovbe, following asm is produced:
foo5:
movl 8(%esp), %eax
andl 4(%esp), %eax
ret
foo6:
movl 8(%esp), %eax
orl 4(%esp), %eax
ret
foo7:
movl 8(%esp), %eax
xorl 4(%esp), %eax
ret