When allocating a stack temporary, use the correct
authorDuncan Sands <baldrick@free.fr>
Thu, 4 Dec 2008 18:08:40 +0000 (18:08 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 4 Dec 2008 18:08:40 +0000 (18:08 +0000)
number of bytes for types such as i1 which are not
a multiple of 8 bits in length.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60543 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 2c25596d76864c52c540399fae02da09ae44336a..6fc2a67e2962a4f831154ad47ffaf046a850daa1 100644 (file)
@@ -1237,7 +1237,7 @@ SDValue SelectionDAG::getMemOperand(const MachineMemOperand &MO) {
 /// specified value type.
 SDValue SelectionDAG::CreateStackTemporary(MVT VT, unsigned minAlign) {
   MachineFrameInfo *FrameInfo = getMachineFunction().getFrameInfo();
-  unsigned ByteSize = VT.getSizeInBits()/8;
+  unsigned ByteSize = VT.getStoreSizeInBits()/8;
   const Type *Ty = VT.getTypeForMVT();
   unsigned StackAlign =
   std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), minAlign);