Update MaxCallFrameSize regardless of the relocation model selected.
authorAkira Hatanaka <ahatanak@gmail.com>
Wed, 25 May 2011 18:08:32 +0000 (18:08 +0000)
committerAkira Hatanaka <ahatanak@gmail.com>
Wed, 25 May 2011 18:08:32 +0000 (18:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132070 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsISelLowering.cpp

index 624736fd8b94a7d3661c240d25f2e770e7148d67..e71bc78a611fb471d88a8a2a9461e931f7845c7d 100644 (file)
@@ -1319,20 +1319,20 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
   Chain  = DAG.getNode(MipsISD::JmpLink, dl, NodeTys, &Ops[0], Ops.size());
   InFlag = Chain.getValue(1);
 
-  if (IsPIC) {
-    // Function can have an arbitrary number of calls, so
-    // hold the LastArgStackLoc with the biggest offset.
-    unsigned MaxCallFrameSize = MipsFI->getMaxCallFrameSize();
-    unsigned NextStackOffset = CCInfo.getNextStackOffset();
+  // Function can have an arbitrary number of calls, so
+  // hold the LastArgStackLoc with the biggest offset.
+  unsigned MaxCallFrameSize = MipsFI->getMaxCallFrameSize();
+  unsigned NextStackOffset = CCInfo.getNextStackOffset();
 
-    // For O32, a minimum of four words (16 bytes) of argument space is
-    // allocated.
-    if (Subtarget->isABI_O32())
-      NextStackOffset = std::max(NextStackOffset, (unsigned)16);
+  // For O32, a minimum of four words (16 bytes) of argument space is
+  // allocated.
+  if (Subtarget->isABI_O32())
+    NextStackOffset = std::max(NextStackOffset, (unsigned)16);
 
-    if (MaxCallFrameSize < NextStackOffset) {
-      MipsFI->setMaxCallFrameSize(NextStackOffset);
+  if (MaxCallFrameSize < NextStackOffset) {
+    MipsFI->setMaxCallFrameSize(NextStackOffset);
 
+    if (IsPIC) {    
       // $gp restore slot must be aligned.
       unsigned StackAlignment = TFL->getStackAlignment();
       NextStackOffset = (NextStackOffset + StackAlignment - 1) /