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.
