[llvm-commits] [llvm] r86463 - /llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp

Anton Korobeynikov asl at math.spbu.ru
Sun Nov 8 04:58:40 PST 2009


Author: asl
Date: Sun Nov  8 06:58:40 2009
New Revision: 86463

URL: http://llvm.org/viewvc/llvm-project?rev=86463&view=rev
Log:
Throw an error when stack realignment stuff fails instead of silent
code miscompilation

Modified:
    llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp

Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=86463&r1=86462&r2=86463&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Sun Nov  8 06:58:40 2009
@@ -450,12 +450,16 @@
 
 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 {





More information about the llvm-commits mailing list