Do not forget to save R15 when we allocate stack frame
authorAnton Korobeynikov <asl@math.spbu.ru>
Thu, 16 Jul 2009 14:11:40 +0000 (14:11 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Thu, 16 Jul 2009 14:11:40 +0000 (14:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75995 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZRegisterInfo.cpp

index dc1561fb1a92916404fcf48989d00c9a9d0bf45d..6e8982d94a9d4c7cc453f565603a5592e26ccfc4 100644 (file)
@@ -149,7 +149,8 @@ SystemZRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
       /* FIXME: function calls eh_return */)
     MF.getRegInfo().setPhysRegUsed(SystemZ::R14D);
 
-  if (FFI->getObjectIndexEnd() != 0 || // Contains automatic variables
+  if (FFI->hasCalls() ||
+      FFI->getObjectIndexEnd() != 0 || // Contains automatic variables
       FFI->hasVarSizedObjects() // Function calls dynamic alloca's
       /* FIXME: function is varargs */)
     MF.getRegInfo().setPhysRegUsed(SystemZ::R15D);