Thumb1 does not support dynamic stack realignment.
authorChad Rosier <mcrosier@apple.com>
Sat, 15 Oct 2011 00:28:24 +0000 (00:28 +0000)
committerChad Rosier <mcrosier@apple.com>
Sat, 15 Oct 2011 00:28:24 +0000 (00:28 +0000)
rdar://10288916 is tracking this fix.

In the past, instcombine and other passes were promoting alloca alignment past
the natural alignment, resulting in dynamic stack realignment.  Lang's work now
prevents this from happening (LLVM commit r141599).  Now that this really
shouldn't happen report a fatal error rather than silently generate bad code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142028 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/Thumb1FrameLowering.cpp

index d4d59ea59da1171e77a3c2d0e814e42c7433f72c..d8481778c0daeac997bc0dacbcb0a85f0512bf78 100644 (file)
@@ -155,6 +155,11 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF) const {
   AFI->setGPRCalleeSavedArea2Size(GPRCS2Size);
   AFI->setDPRCalleeSavedAreaSize(DPRCSSize);
 
+  // Thumb1 does not currently support dynamic stack realignment.  Report a
+  // fatal error rather then silently generate bad code.
+  if (RegInfo->needsStackRealignment(MF))
+      report_fatal_error("Dynamic stack realignment not supported for thumb1.");
+
   // If we need a base pointer, set it up here. It's whatever the value
   // of the stack pointer is at this point. Any variable size objects
   // will be allocated after this, so we can still use the base pointer