From 62fba48e0f4da2e3f4b52fef56ac0f4b24d9e3eb Mon Sep 17 00:00:00 2001 From: Nemanja Ivanovic Date: Fri, 15 Jul 2016 19:56:32 +0000 Subject: [PATCH] [PowerPC] Set kill flag for scratch register when spilling the link register This fixes PR 28526. llvm-svn: 275603 --- llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp index 3ed894738586..c480430dd29a 100644 --- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp @@ -901,7 +901,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF, if (MustSaveLR) // FIXME: On PPC32 SVR4, we must not spill before claiming the stackframe. BuildMI(MBB, MBBI, dl, StoreInst) - .addReg(ScratchReg) + .addReg(ScratchReg, getKillRegState(true)) .addImm(LROffset) .addReg(SPReg);