summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMarcin Koscielnicki <koriakin@0x04.net>2016-06-28 14:13:11 +0000
committerMarcin Koscielnicki <koriakin@0x04.net>2016-06-28 14:13:11 +0000
commit234e5a809b49f93c16d0b279ce3d602c146743c5 (patch)
treec5fb62f6b52f9b1578f202f4114ef0800c1f1f18 /llvm/lib/Target
parentbaf27df0bf0161d2a6e09fe11114c1f30ca7a2f7 (diff)
downloadbcm5719-llvm-234e5a809b49f93c16d0b279ce3d602c146743c5.tar.gz
bcm5719-llvm-234e5a809b49f93c16d0b279ce3d602c146743c5.zip
[SystemZ] Save/restore r6 and r7 if function contains landing pad.
This fixes PR27102. Differential Revision: http://reviews.llvm.org/D18541 llvm-svn: 274017
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
index a1f036d68ec..ccaed49475c 100644
--- a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
@@ -81,6 +81,12 @@ void SystemZFrameLowering::determineCalleeSaves(MachineFunction &MF,
for (unsigned I = MFI->getVarArgsFirstGPR(); I < SystemZ::NumArgGPRs; ++I)
SavedRegs.set(SystemZ::ArgGPRs[I]);
+ // If there are any landing pads, entering them will modify r6/r7.
+ if (!MF.getMMI().getLandingPads().empty()) {
+ SavedRegs.set(SystemZ::R6D);
+ SavedRegs.set(SystemZ::R7D);
+ }
+
// If the function requires a frame pointer, record that the hard
// frame pointer will be clobbered.
if (HasFP)
OpenPOWER on IntegriCloud