[LLVMbugs] [Bug 3501] clang x86-64 ABI bug with bit-fields

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Feb 16 19:04:54 PST 2009


Daniel Dunbar <daniel at zuster.org> changed:

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

--- Comment #2 from Daniel Dunbar <daniel at zuster.org>  2009-02-16 21:04:53 ---
Implemented here:

ddunbar at ozzy:CodeGen$ cat x.c
struct s0 {int a : 5, b : 5;};
unsigned a(struct s0 x) { return x.a; }
ddunbar at ozzy:CodeGen$ gcc -O3 -fomit-frame-pointer -m64 -S -o - x.c | head -10
        .align 4,0x90
.globl _a
        sall    $3, %edi
        sarb    $3, %dil
        movsbl  %dil,%eax
ddunbar at ozzy:CodeGen$ xcc -O3 -fomit-frame-pointer -m64 -S -o - x.c | head -10

        .align  4,0x90
        .globl  _a
        shll    $27, %edi
        movl    %edi, %eax
        sarl    $27, %eax

Not sure why you regard this as a tricky case, things like 
typedef struct {
  float a;
  int b : 3;
  int c : 3;
  int d : 31;
} T;
are much nastier from a classification point of view.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list