From 1ccbbc3d0725909b29b7e590a0a2d318e4684516 Mon Sep 17 00:00:00 2001 From: Scott Michel Date: Sat, 8 Nov 2008 05:16:20 +0000 Subject: [PATCH] CellSPU: Fix prologue/epilogue emission when function contains calls but theframe size is 0; the prologue and epilogue should be emitted in this case. llvm-svn: 58890 --- llvm/lib/Target/CellSPU/SPURegisterInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp b/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp index eff6d6a36cdf..beea0dfb02c1 100644 --- a/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp +++ b/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp @@ -438,7 +438,7 @@ void SPURegisterInfo::emitPrologue(MachineFunction &MF) const assert((FrameSize & 0xf) == 0 && "SPURegisterInfo::emitPrologue: FrameSize not aligned"); - if (FrameSize > 0) { + if (FrameSize > 0 || MFI->hasCalls()) { FrameSize = -(FrameSize + SPUFrameInfo::minStackSize()); if (hasDebugInfo) { // Mark effective beginning of when frame pointer becomes valid. @@ -534,7 +534,7 @@ SPURegisterInfo::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const "Can only insert epilog into returning blocks"); assert((FrameSize & 0xf) == 0 && "SPURegisterInfo::emitEpilogue: FrameSize not aligned"); - if (FrameSize > 0) { + if (FrameSize > 0 || MFI->hasCalls()) { FrameSize = FrameSize + SPUFrameInfo::minStackSize(); if (isS10Constant(FrameSize + LinkSlotOffset)) { // Reload $lr, adjust $sp by required amount