[llvm-commits] [llvm-gcc-4.2] r46478 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Devang Patel
dpatel at apple.com
Mon Jan 28 17:09:18 PST 2008
Author: dpatel
Date: Mon Jan 28 19:09:18 2008
New Revision: 46478
URL: http://llvm.org/viewvc/llvm-project?rev=46478&view=rev
Log:
Fix PR1861
While selecting union size, select larger field size irrespective of whether field is packed or not.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46478&r1=46477&r2=46478&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Jan 28 19:09:18 2008
@@ -2160,12 +2160,8 @@
continue;
const Type *TheTy = ConvertType(TREE_TYPE(Field));
- bool isPacked = false;
unsigned Size = TD.getABITypeSize(TheTy);
unsigned Align = TD.getABITypeAlignment(TheTy);
- if (const StructType *STy = dyn_cast<StructType>(TheTy))
- if (STy->isPacked())
- isPacked = true;
adjustPaddingElement(UnionTy, TheTy);
@@ -2181,7 +2177,7 @@
useTheTy = true;
else if (MaxAlign == Align && Size > MaxSize)
useTheTy = true;
- else if (isPacked && Size > MaxSize)
+ else if (Size > MaxSize)
useTheTy = true;
if (useTheTy) {
More information about the llvm-commits
mailing list