From 2ad23171bdd605ca2ed957c6835f4402692cc08d Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Fri, 19 Feb 2016 18:15:53 +0000 Subject: [PATCH] [StatepointLowering] Fix a mistake in rL261336 The check on MFI->getObjectSize() has to be on the FrameIndex, not on the index of the FrameIndex in AllocatedStackSlots. Weirdly, the tests I added in rL261336 didn't catch this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261347 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index 0116fdddd95..37f74cb9d70 100644 --- a/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -88,11 +88,12 @@ StatepointLoweringState::allocateStackSlot(EVT ValueType, "Broken invariant"); for (; NextSlotToAllocate < NumSlots; NextSlotToAllocate++) { - if (!AllocatedStackSlots.test(NextSlotToAllocate) && - MFI->getObjectSize(NextSlotToAllocate) == SpillSize) { + if (!AllocatedStackSlots.test(NextSlotToAllocate)) { const int FI = Builder.FuncInfo.StatepointStackSlots[NextSlotToAllocate]; - AllocatedStackSlots.set(NextSlotToAllocate); - return Builder.DAG.getFrameIndex(FI, ValueType); + if (MFI->getObjectSize(FI) == SpillSize) { + AllocatedStackSlots.set(NextSlotToAllocate); + return Builder.DAG.getFrameIndex(FI, ValueType); + } } } -- 2.11.0