https://llvm.org/bugs/show_bug.cgi?id=17955

Eric Christopher <echri...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Eric Christopher <echri...@gmail.com> ---
We produce similar code (though not the same) to gcc here now:

dzur:~/tmp> cat > foo.c
struct foo {
  int f_x : 1;
  int f_y : 1;
};

int fun(struct foo *f) {
  return f->f_x || f->f_y;
}
dzur:~/tmp> ~/builds/build-llvm/Debug+Asserts/bin/clang -O2 -S -o - foo.c
    .text
    .file    "foo.c"
    .globl    fun
    .align    16, 0x90
    .type    fun,@function
fun:                                    # @fun
    .cfi_startproc
# BB#0:                                 # %entry
    testb    $3, (%rdi)
    setne    %al
    movzbl    %al, %eax
    retq
.Lfunc_end0:
    .size    fun, .Lfunc_end0-fun
    .cfi_endproc


    .ident    "clang version 3.8.0 (trunk 250477) (llvm/trunk 250464)"
    .section    ".note.GNU-stack","",@progbits
dzur:~/tmp> gcc -O2 -S -o - foo.c
    .file    "foo.c"
    .text
    .p2align 4,,15
    .globl    fun
    .type    fun, @function
fun:
.LFB0:
    .cfi_startproc
    xorl    %eax, %eax
    testb    $3, (%rdi)
    setne    %al
    ret
    .cfi_endproc
.LFE0:
    .size    fun, .-fun
    .ident    "GCC: (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4"
    .section    .note.GNU-stack,"",@progbits

Happy David?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to