From ccec74738d0fc34f4bc2ac6909324e62705f1c38 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sat, 7 Jan 2012 02:55:54 +0000 Subject: [PATCH] Copy implicit defs (e.g. r0) when changing tBX_RET to tPOP_RET. This bug is exposed with an upcoming change will would delete the copy to return register because there is no use! It's amazing anything works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147715 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/Thumb1FrameLowering.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Target/ARM/Thumb1FrameLowering.cpp b/lib/Target/ARM/Thumb1FrameLowering.cpp index e171b274deb..16c7cbc4a0d 100644 --- a/lib/Target/ARM/Thumb1FrameLowering.cpp +++ b/lib/Target/ARM/Thumb1FrameLowering.cpp @@ -350,6 +350,7 @@ restoreCalleeSavedRegisters(MachineBasicBlock &MBB, continue; Reg = ARM::PC; (*MIB).setDesc(TII.get(ARM::tPOP_RET)); + MIB->copyImplicitOps(&*MI); MI = MBB.erase(MI); } MIB.addReg(Reg, getDefRegState(true)); -- 2.34.1