This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/55177] Missed optimisation: bswap, mask with constant, bswap back again.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]