[cfe-commits] r46889 - in /cfe/trunk: CodeGen/CodeGenTypes.cpp test/CodeGen/2008-02-08-bitfield-bug.c
Lauro Ramos Venancio
lauro.venancio at gmail.com
Fri Feb 8 11:46:46 PST 2008
Author: laurov
Date: Fri Feb 8 13:46:46 2008
New Revision: 46889
URL: http://llvm.org/viewvc/llvm-project?rev=46889&view=rev
Log:
Fix a bitfield regression. Reported by Anders Carlsson.
Added:
cfe/trunk/test/CodeGen/2008-02-08-bitfield-bug.c
Modified:
cfe/trunk/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=46889&r1=46888&r2=46889&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Fri Feb 8 13:46:46 2008
@@ -573,5 +573,6 @@
CGT.addBitFieldInfo(FD, 0, BitFieldSize);
Cursor = (Idx + 1) * TySize + BitFieldSize;
}
- addPaddingFields(Cursor);
+ if (Cursor > llvmSize)
+ addPaddingFields(Cursor);
}
Added: cfe/trunk/test/CodeGen/2008-02-08-bitfield-bug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-02-08-bitfield-bug.c?rev=46889&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/2008-02-08-bitfield-bug.c (added)
+++ cfe/trunk/test/CodeGen/2008-02-08-bitfield-bug.c Fri Feb 8 13:46:46 2008
@@ -0,0 +1,9 @@
+// RUN: clang %s -emit-llvm
+
+struct test {
+ unsigned a:1;
+ unsigned b:1;
+};
+
+struct test *t;
+
More information about the cfe-commits
mailing list