[llvm-commits] [llvm-gcc-4.2] r90787 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Evan Cheng
evan.cheng at apple.com
Mon Dec 7 11:23:25 PST 2009
Author: evancheng
Date: Mon Dec 7 13:23:24 2009
New Revision: 90787
URL: http://llvm.org/viewvc/llvm-project?rev=90787&view=rev
Log:
Set alignment on bitfield access. Patch by Chris Lattner.
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=90787&r1=90786&r2=90787&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Dec 7 13:23:24 2009
@@ -6734,9 +6734,9 @@
// Okay, everything is good. Return this as a bitfield if we can't
// return it as a normal l-value. (e.g. "struct X { int X : 32 };" ).
- // Conservatively return LValue with alignment 1.
if (BitfieldSize != LLVMValueBitSize || BitStart != 0)
- return LValue(FieldPtr, 1, BitStart, BitfieldSize);
+ return LValue(FieldPtr, LVAlign, BitStart, BitfieldSize);
+
} else {
// Make sure we return a pointer to the right type.
const Type *EltTy = ConvertType(TREE_TYPE(exp));
More information about the llvm-commits
mailing list