Throw an error when stack realignment stuff fails instead of silent

code miscompilation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2009-11-08 12:58:40 +00:00
parent c2fd919ea2
commit 773943ac5c

View File

@ -450,12 +450,16 @@ bool X86RegisterInfo::hasFP(const MachineFunction &MF) const {
bool X86RegisterInfo::needsStackRealignment(const MachineFunction &MF) const {
const MachineFrameInfo *MFI = MF.getFrameInfo();
bool requiresRealignment =
RealignStack && (MFI->getMaxAlignment() > StackAlign);
// FIXME: Currently we don't support stack realignment for functions with
// variable-sized allocas
return (RealignStack &&
(MFI->getMaxAlignment() > StackAlign &&
!MFI->hasVarSizedObjects()));
if (requiresRealignment && MFI->hasVarSizedObjects())
llvm_report_error(
"Stack realignment in presense of dynamic allocas is not supported");
return requiresRealignment;
}
bool X86RegisterInfo::hasReservedCallFrame(MachineFunction &MF) const {