If we've pushed registers onto the stack, but aren't adjusting the stack pointer
authorBill Wendling <isanbard@gmail.com>
Thu, 3 Sep 2009 22:19:22 +0000 (22:19 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 3 Sep 2009 22:19:22 +0000 (22:19 +0000)
(i.e., there are no local variables and stuff), we still need to output FDE
information for the pushed registers.

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

lib/Target/X86/X86RegisterInfo.cpp

index 5d1ee17c37a4472bb80ce836454d576d0083b31e..76d2b97bf9f78d14b4f0b98a81f6e60edb3b0261 100644 (file)
@@ -1086,12 +1086,12 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
       emitSPUpdate(MBB, MBBI, StackPtr, -(int64_t)NumBytes, Is64Bit, TII);
   }
 
-  if (NumBytes && needsFrameMoves) {
+  if ((NumBytes || PushedRegs) && needsFrameMoves) {
     // Mark end of stack pointer adjustment.
     unsigned LabelId = MMI->NextLabelID();
     BuildMI(MBB, MBBI, DL, TII.get(X86::DBG_LABEL)).addImm(LabelId);
 
-    if (!HasFP) {
+    if (!HasFP && NumBytes) {
       // Define the current CFA rule to use the provided offset.
       if (StackSize) {
         MachineLocation SPDst(MachineLocation::VirtualFP);