summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp6
-rw-r--r--llvm/test/DebugInfo/SystemZ/eh_frame_personality.ll4
2 files changed, 9 insertions, 1 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)
diff --git a/llvm/test/DebugInfo/SystemZ/eh_frame_personality.ll b/llvm/test/DebugInfo/SystemZ/eh_frame_personality.ll
index f7863a89af0..ba439dcd3d4 100644
--- a/llvm/test/DebugInfo/SystemZ/eh_frame_personality.ll
+++ b/llvm/test/DebugInfo/SystemZ/eh_frame_personality.ll
@@ -20,7 +20,9 @@ clean:
; CHECK-FUNC: .cfi_startproc
; CHECK-FUNC: .cfi_personality 0, __gxx_personality_v0
; CHECK-FUNC: .cfi_lsda 0, .Lexception0
-; CHECK-FUNC: stmg %r14, %r15, 112(%r15)
+; CHECK-FUNC: stmg %r6, %r15, 48(%r15)
+; CHECK-FUNC: .cfi_offset %r6, -112
+; CHECK-FUNC: .cfi_offset %r7, -104
; CHECK-FUNC: .cfi_offset %r14, -48
; CHECK-FUNC: .cfi_offset %r15, -40
; CHECK-FUNC: aghi %r15, -160
OpenPOWER on IntegriCloud