Skip to content

Commit

Permalink
Clear GC info when consuming GT_PUTARG_SPLIT nodes (#65432)
Browse files Browse the repository at this point in the history
Fix #65395
  • Loading branch information
jakobbotsch authored Feb 17, 2022
1 parent 643e08d commit ae938c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3190,7 +3190,9 @@ void CodeGen::genCall(GenTreeCall* call)
}

#ifdef DEBUG
// Killed registers should no longer contain any GC pointers.
// We should not have GC pointers in killed registers live around the call.
// GC info for arg registers were cleared when consuming arg nodes above
// and LSRA should ensure it for other trashed registers.
regMaskTP killMask = RBM_CALLEE_TRASH;
if (call->IsHelperCall())
{
Expand Down
4 changes: 1 addition & 3 deletions src/coreclr/jit/codegenlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,6 @@ void CodeGen::genConsumePutStructArgStk(GenTreePutArgStk* putArgNode,
#if FEATURE_ARG_SPLIT
//------------------------------------------------------------------------
// genConsumeArgRegSplit: Consume register(s) in Call node to set split struct argument.
// Liveness update for the PutArgSplit node is not needed
//
// Arguments:
// putArgNode - the PUTARG_STK tree.
Expand All @@ -1822,8 +1821,7 @@ void CodeGen::genConsumeArgSplitStruct(GenTreePutArgSplit* putArgNode)

genUnspillRegIfNeeded(putArgNode);

// Skip updating GC info
// GC info for all argument registers will be cleared in caller
gcInfo.gcMarkRegSetNpt(putArgNode->gtGetRegMask());

genCheckConsumeNode(putArgNode);
}
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5398,7 +5398,9 @@ void CodeGen::genCall(GenTreeCall* call)
}

#ifdef DEBUG
// Killed registers should no longer contain any GC pointers.
// We should not have GC pointers in killed registers live around the call.
// GC info for arg registers were cleared when consuming arg nodes above
// and LSRA should ensure it for other trashed registers.
regMaskTP killMask = RBM_CALLEE_TRASH;
if (call->IsHelperCall())
{
Expand Down

0 comments on commit ae938c3

Please sign in to comment.