Skip over the label which marks the beginning of the function before inserting prolog...
authorEvan Cheng <evan.cheng@apple.com>
Wed, 30 Jan 2008 03:57:33 +0000 (03:57 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 30 Jan 2008 03:57:33 +0000 (03:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46546 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86RegisterInfo.cpp

index 277a09cc1550072885d6c1aaeb9797478d73d881..bca197311facf56ce47fde8ff6f72b0908eb9de5 100644 (file)
@@ -525,6 +525,12 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
           X86FI->getCalleeSavedFrameSize() +(-TailCallReturnAddrDelta));
   uint64_t NumBytes = StackSize - X86FI->getCalleeSavedFrameSize();
 
+  // Skip over the label which mark the beginning of the function.
+  if (MMI && MMI->needsFrameInfo() &&
+      MBBI != MBB.end() &&
+      MBBI->getOpcode() == X86::LABEL)
+      ++MBBI;
+
   // Insert stack pointer adjustment for later moving of return addr.  Only
   // applies to tail call optimized functions where the callee argument stack
   // size is bigger than the callers.