[llvm-commits] [llvm-gcc-4.2] r70183 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 26 21:50:23 PDT 2009
Author: lattner
Date: Sun Apr 26 23:50:22 2009
New Revision: 70183
URL: http://llvm.org/viewvc/llvm-project?rev=70183&view=rev
Log:
Fix rdar://6828787 (whose testcase was added to
test/SingleSource/UnitTests/2006-01-23-UnionInit.c)
When a structure is converted to packed, the alignment
of the llvm field should be reset to 1 because packed
fields' alignments are not taken into consideration.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=70183&r1=70182&r2=70183&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sun Apr 26 23:50:22 2009
@@ -6897,6 +6897,7 @@
// Switch to packed.
ConvertToPacked();
LLVMNaturalByteOffset = NextFieldByteStart;
+ ValLLVMAlign = 1;
assert(LLVMNaturalByteOffset*8 <= GCCFieldOffsetInBits &&
"Packing didn't fix the problem!");
}
More information about the llvm-commits
mailing list