Skip to content

Commit 1439f8f

Browse files
[SystemZ] Fix a bug introduced by #135767
Commit `083b4a3d66` introduced a store-and-load pair around the `BRASL` call to mcount. That load instruction did not properly declare its target register as defined, leading to a bad machine instruction. This commit fixes this by explicitly labeling `%r14` on the load as `def`.
1 parent 6e63b68 commit 1439f8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "SystemZRegisterInfo.h"
1414
#include "SystemZSubtarget.h"
1515
#include "llvm/CodeGen/LivePhysRegs.h"
16+
#include "llvm/CodeGen/MachineInstrBuilder.h"
1617
#include "llvm/CodeGen/MachineModuleInfo.h"
1718
#include "llvm/CodeGen/MachineRegisterInfo.h"
1819
#include "llvm/CodeGen/RegisterScavenging.h"
@@ -584,7 +585,7 @@ void SystemZELFFrameLowering::emitPrologue(MachineFunction &MF,
584585

585586
// Reload return address from 8 bytes above stack pointer.
586587
BuildMI(MBB, MBBI, DL, ZII->get(SystemZ::LG))
587-
.addReg(SystemZ::R14D)
588+
.addReg(SystemZ::R14D, RegState::Define)
588589
.addReg(SystemZ::R15D)
589590
.addImm(8)
590591
.addReg(0);

0 commit comments

Comments
 (0)