Index: lib/CodeGen/AsmPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter.cpp (revision 42486) +++ lib/CodeGen/AsmPrinter.cpp (working copy) @@ -816,8 +816,12 @@ if (CVA->isString()) { EmitString(CVA); } else { // Not a string. Print the values in successive locations - for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) + for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) { EmitGlobalConstant(CVA->getOperand(i)); + const Type* EltTy = CVA->getType()->getElementType(); + uint64_t padSize = TD->getABITypeSize(EltTy) - TD->getTypeSize(EltTy); + EmitZeros(padSize); + } } return; } else if (const ConstantStruct *CVS = dyn_cast(CV)) { Index: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (revision 42486) +++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (working copy) @@ -2279,13 +2279,13 @@ if (ConstantInt *CI = dyn_cast(Idx)) { if (CI->getZExtValue() == 0) continue; uint64_t Offs = - TD->getTypeSize(Ty)*cast(CI)->getSExtValue(); + TD->getABITypeSize(Ty)*cast(CI)->getSExtValue(); N = DAG.getNode(ISD::ADD, N.getValueType(), N, getIntPtrConstant(Offs)); continue; } // N = N + Idx * ElementSize; - uint64_t ElementSize = TD->getTypeSize(Ty); + uint64_t ElementSize = TD->getABITypeSize(Ty); SDOperand IdxN = getValue(Idx); // If the index is smaller or larger than intptr_t, truncate or extend