Skip to content

Commit 95f3bcc

Browse files
authored
JIT: Don't use addressing modes for volatile loads for gc types (#70794)
1 parent c35b1b5 commit 95f3bcc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/coreclr/jit/gcinfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,10 @@ GCInfo::WriteBarrierForm GCInfo::gcWriteBarrierFormFromTargetAddress(GenTree* tg
316316
GenTree* addOp2 = tgtAddr->AsOp()->gtGetOp2();
317317
var_types addOp1Type = addOp1->TypeGet();
318318
var_types addOp2Type = addOp2->TypeGet();
319+
319320
if (addOp1Type == TYP_BYREF || addOp1Type == TYP_REF)
320321
{
321-
assert(addOp2Type != TYP_BYREF && addOp2Type != TYP_REF);
322+
assert(((addOp2Type != TYP_BYREF) || (addOp2->OperIs(GT_CNS_INT))) && (addOp2Type != TYP_REF));
322323
tgtAddr = addOp1;
323324
simplifiedExpr = true;
324325
}

src/coreclr/jit/lower.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6033,7 +6033,7 @@ bool Lowering::TryCreateAddrMode(GenTree* addr, bool isContainable, GenTree* par
60336033
}
60346034

60356035
#ifdef TARGET_ARM64
6036-
if (parent->OperIsIndir() && parent->AsIndir()->IsVolatile() && !varTypeIsGC(addr))
6036+
if (parent->OperIsIndir() && parent->AsIndir()->IsVolatile())
60376037
{
60386038
// For Arm64 we avoid using LEA for volatile INDs
60396039
// because we won't be able to use ldar/star

0 commit comments

Comments
 (0)