Skip to content

Commit 3e26639

Browse files
committed
Set register dep to exclude GPR0 for temp2Reg in inlineCompareAndSet
The temp2Reg is used by `VMnonNullSrcWrtBarCardCheckEvaluator` in some cases in a `stbx` instruction, which can't have GPR0 as the RA argument or it will act upon it as a null value. This causes the an unexpected register spill in the middle of an internal control-flow sequence that might not be fully executed.
1 parent 2fceea8 commit 3e26639

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

runtime/compiler/p/codegen/J9TreeEvaluator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8530,6 +8530,7 @@ static TR::Register *VMinlineCompareAndSetOrExchangeReference(TR::Node *node, TR
85308530

85318531
TR::addDependency(conditions, temp1Reg, TR::RealRegister::gr11, TR_GPR, cg);
85328532
TR::addDependency(conditions, temp2Reg, TR::RealRegister::NoReg, TR_GPR, cg);
8533+
conditions->getPostConditions()->getRegisterDependency(conditions->getAddCursorForPost() - 1)->setExcludeGPR0();
85338534
TR::addDependency(conditions, offsetReg, TR::RealRegister::NoReg, TR_GPR, cg);
85348535
TR::addDependency(conditions, temp4Reg, TR::RealRegister::NoReg, TR_GPR, cg);
85358536

0 commit comments

Comments
 (0)