This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/55177] Missed optimisation: bswap, mask with constant, bswap back again.
- From: "dwmw2 at infradead dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Nov 2012 10:45:52 +0000
- Subject: [Bug tree-optimization/55177] Missed optimisation: bswap, mask with constant, bswap back again.
- Auto-submitted: auto-generated
- References: <bug-55177-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55177
--- Comment #1 from David Woodhouse <dwmw2 at infradead dot org> 2012-11-02 10:45:52 UTC ---
We have a similar issue with:
extern void func(void);
int baz(void)
{
if (__builtin_bswap32(x) & 0x80000)
func();
}
baz:
.LFB1:
.cfi_startproc
movl x(%rip), %eax
bswap %eax
testl $524288, %eax
jne .L12
rep
ret
â
Again there's no need for a bswap followed by testing with a constant.