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

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

int bar1;
void
__attribute__((noinline))
foo1 (int y)
{
  if ((bar1 & (1 << y)))
    {
      bar1 &= ~(1 << y);
      xxx1 ();
    }
}

we generate

    movl    bar1(%rip), %eax
    btl    %edi, %eax
    jc    .L5
    rep ret
    .p2align 4,,10
    .p2align 3
.L5:
    movl    $-2, %edx
    movl    %edi, %ecx
    roll    %cl, %edx
    andl    %edx, %eax
    movl    %eax, bar1(%rip)
    jmp    xxx1

I expect
    btr %edi, bar2(%rip)
    jnc .L7
    jmp    xxx2
.L8:
    .p2align 4,,10
    .p2align 3
.L7:
    rep ret

Reply via email to