aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-28 18:52:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-28 18:52:32 +0000
commit5feaa9a70716e9181a9b940236bc461f2a75334a (patch)
tree9c16d1d5efc0c8d4a8ca08afa7fed6ffa3861ca7 /lib
parentba9f0431f0e65b5d198af50438dd71a19f86584b (diff)
TargetRegisterClass specifies the desired spill alignment. However, it cannot be honored if stack alignment is smaller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 81d9724be4..5a18b920fc 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -190,7 +190,12 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
int FrameIdx;
if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
// Nope, just spill it anywhere convenient.
- FrameIdx = FFI->CreateStackObject(RC->getSize(), RC->getAlignment());
+ unsigned Align = RC->getAlignment();
+ unsigned StackAlign = TFI->getStackAlignment();
+ // We may not be able to sastify the desired alignment specification of
+ // the TargetRegisterClass if the stack alignment is smaller. Use the min.
+ Align = std::min(Align, StackAlign);
+ FrameIdx = FFI->CreateStackObject(RC->getSize(), Align);
if ((unsigned)FrameIdx < MinCSFrameIndex) MinCSFrameIndex = FrameIdx;
if ((unsigned)FrameIdx > MaxCSFrameIndex) MaxCSFrameIndex = FrameIdx;
} else {