Skip to content

Commit

Permalink
Fix Checked/Release asm diffs (#79844)
Browse files Browse the repository at this point in the history
Code inside a `#ifdef DEBUG` had a side-effect not visible to
Release builds. Pull that code out of the `#ifdef`.

Fixes #79560
  • Loading branch information
BruceForstall authored Dec 21, 2022
1 parent 429cda7 commit 53bdf40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3808,11 +3808,9 @@ void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode)
// Make sure we got the arguments of the cpobj operation in the right registers
GenTree* dstAddr = cpObjNode->Addr();
GenTree* source = cpObjNode->Data();
GenTree* srcAddr = nullptr;
var_types srcAddrType = TYP_BYREF;
bool dstOnStack = dstAddr->gtSkipReloadOrCopy()->OperIsLocalAddr();

#ifdef DEBUG
// If the GenTree node has data about GC pointers, this means we're dealing
// with CpObj, so this requires special logic.
assert(cpObjNode->GetLayout()->HasGCPtr());
Expand All @@ -3824,7 +3822,10 @@ void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode)
if (!source->IsLocal())
{
assert(source->gtOper == GT_IND);
srcAddr = source->gtGetOp1();
GenTree* srcAddr = source->gtGetOp1();
srcAddrType = srcAddr->TypeGet();

#ifdef DEBUG
GenTree* actualSrcAddr = srcAddr->gtSkipReloadOrCopy();
GenTree* actualDstAddr = dstAddr->gtSkipReloadOrCopy();
unsigned srcLclVarNum = BAD_VAR_NUM;
Expand All @@ -3845,9 +3846,8 @@ void CodeGen::genCodeForCpObj(GenTreeObj* cpObjNode)
((srcLclVarNum == dstLclVarNum) && !isDstAddrLiveOut));
assert((actualDstAddr->GetRegNum() != REG_RDI) || !isDstAddrLiveOut ||
((srcLclVarNum == dstLclVarNum) && !isSrcAddrLiveOut));
srcAddrType = srcAddr->TypeGet();
}
#endif // DEBUG
}

// Consume the operands and get them into the right registers.
// They may now contain gc pointers (depending on their type; gcMarkRegPtrVal will "do the right thing").
Expand Down

0 comments on commit 53bdf40

Please sign in to comment.