[LLVMbugs] [Bug 594] NEW: [llvm-gcc] llvm-gcc lays out bitfields backwards on big endian systems

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Jul 13 23:56:10 PDT 2005


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=594

           Summary: [llvm-gcc] llvm-gcc lays out bitfields backwards on big
                    endian systems
           Product: tools
           Version: 1.0
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


This program is miscompiled by LLVM on powerpc.  It appears that bitfields are
being layed out backwards by the CFE.  This may be related to Bug 449.  It
probably also affects Sparc.  This testcase should be compiled with
-fno-strict-aliasing.

-Chris


struct X {
   int A : 4;
   int Z : 28;
};

void test(struct X *P, int A) {
   P->A = A;
}

int main() {
  int Y = ~0;
  test((struct X*)&Y, 0);
  printf("%x\n", Y);
}



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list