diff --git a/lib/Target/ARM/ARMRegisterInfo.cpp b/lib/Target/ARM/ARMRegisterInfo.cpp index 1b0f3fd8e54..fd04f5aecf2 100644 --- a/lib/Target/ARM/ARMRegisterInfo.cpp +++ b/lib/Target/ARM/ARMRegisterInfo.cpp @@ -139,6 +139,9 @@ void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const { NumBytes += MFI->getMaxCallFrameSize(); } + // Align to 8 bytes + NumBytes = ((NumBytes + 7) / 8) * 8; + MFI->setStackSize(NumBytes); //sub sp, sp, #NumBytes