[llvm-gcc] llvm-gcc lays out bitfields backwards on big endian systems #966
Labels
bugzilla
Issues migrated from bugzilla
llvm-tools
All llvm tools that do not have corresponding tag
miscompilation
Extended Description
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);
}
The text was updated successfully, but these errors were encountered: