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 target/59968] Unused BT patterns


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

--- Comment #8 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;
}

we generate

    movl    bar1(%rip), %eax
    btl    %edi, %eax
    jc    .L1
    movl    $1, %edx
    movl    %edi, %ecx
    sall    %cl, %edx
    orl    %edx, %eax
    movl    %eax, bar1(%rip)
.L1:
    rep ret

I expect:

    bts     %edi, bar2(%rip)
    ret


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