Bugzilla – Bug 594
[llvm-gcc] llvm-gcc lays out bitfields backwards on big endian systems
Last modified: 2010-02-22 12:51:03 CST
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); }
Fixed. Patches here and here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050711/027100.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050718/027152.html Fixing this fixes NAMD, 176.gcc and others. -Chris