diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp index 789170957b12f..69c8548263781 100644 --- a/src/coreclr/jit/codegenarmarch.cpp +++ b/src/coreclr/jit/codegenarmarch.cpp @@ -2858,8 +2858,7 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node) } #endif - if (!node->gtBlkOpGcUnsafe && - ((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0) || (node->GetLayout()->HasGCPtr()))) + if (!node->gtBlkOpGcUnsafe && ((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0))) { // If node is not already marked as non-interruptible, and if are about to generate code // that produce GC references in temporary registers not reported, then mark the block diff --git a/src/coreclr/jit/lowerarmarch.cpp b/src/coreclr/jit/lowerarmarch.cpp index 659a330e8bc6d..1e2420b37a953 100644 --- a/src/coreclr/jit/lowerarmarch.cpp +++ b/src/coreclr/jit/lowerarmarch.cpp @@ -493,10 +493,15 @@ void Lowering::LowerBlockStore(GenTreeBlk* blkNode) if (blkNode->OperIs(GT_STORE_OBJ)) { - if (!blkNode->AsObj()->GetLayout()->HasGCPtr() || (isDstAddrLocal && (size <= copyBlockUnrollLimit))) + if (!blkNode->AsObj()->GetLayout()->HasGCPtr()) { blkNode->SetOper(GT_STORE_BLK); } + else if (isDstAddrLocal && (size <= copyBlockUnrollLimit)) + { + blkNode->SetOper(GT_STORE_BLK); + blkNode->gtBlkOpGcUnsafe = true; + } } if (blkNode->OperIs(GT_STORE_OBJ))