Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Checked/Release asm diffs #79844

Merged
merged 1 commit into from
Dec 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Checked/Release asm diffs
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 committed Dec 20, 2022
commit 16a568a369159ecbe28524e3784fb08e1af2a912
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