[Bug target/59968] Unused BT patterns

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 28 17:45:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59968

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
For

int
__attribute__((noinline))
foo1 (int x, int y)
{
  int z;
  z = x & (1 << y);
  x |= 1 << y;
  x &= ~z;
  return x;
}

we generate:

    movl    %esi, %ecx
    movl    $1, %edx
    sall    %cl, %edx
    movl    %edx, %eax
    orl    %edi, %eax
    andl    %edx, %edi
    notl    %edi
    andl    %edi, %eax
    ret

I expect:
    movl    %edi, %eax
    btc     %esi, %eax
    ret



More information about the Gcc-bugs mailing list