mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Fix bug in computation of stack size in MipsFrameLowering.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159240 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e877824edd
commit
4782a6e06a
@ -112,9 +112,12 @@ void MipsFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
|
||||
// First, compute final stack size.
|
||||
unsigned StackAlign = getStackAlignment();
|
||||
uint64_t StackSize = STI.inMips16Mode()? 0:
|
||||
MFI->getObjectOffset(MipsFI->getGlobalRegFI()) +
|
||||
StackAlign + RoundUpToAlignment(MFI->getStackSize(), StackAlign);
|
||||
uint64_t StackSize = RoundUpToAlignment(MFI->getStackSize(), StackAlign);
|
||||
|
||||
if (MipsFI->globalBaseRegSet())
|
||||
StackSize += MFI->getObjectOffset(MipsFI->getGlobalRegFI()) + StackAlign;
|
||||
else
|
||||
StackSize += RoundUpToAlignment(MipsFI->getMaxCallFrameSize(), StackAlign);
|
||||
|
||||
// Update stack size
|
||||
MFI->setStackSize(StackSize);
|
||||
|
@ -117,6 +117,10 @@ private:
|
||||
void MipsDAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) {
|
||||
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
||||
|
||||
if (((MF.getTarget().getRelocationModel() == Reloc::Static) ||
|
||||
Subtarget.inMips16Mode()) && !MipsFI->globalBaseRegSet())
|
||||
return;
|
||||
|
||||
MachineBasicBlock &MBB = MF.front();
|
||||
MachineBasicBlock::iterator I = MBB.begin();
|
||||
MachineRegisterInfo &RegInfo = MF.getRegInfo();
|
||||
|
Loading…
Reference in New Issue
Block a user