From 8b5ac0c8002f5655fddb72cd32ce3a5568423d13 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Tue, 31 May 2022 14:22:55 -0700 Subject: [PATCH] Make gcunsafe for cpblk if it has gc pointers --- src/coreclr/jit/codegenarmarch.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp index f1426fc23487b..0bc866076d663 100644 --- a/src/coreclr/jit/codegenarmarch.cpp +++ b/src/coreclr/jit/codegenarmarch.cpp @@ -2801,11 +2801,6 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node) CopyBlockUnrollHelper helper(srcOffset, dstOffset, size); regNumber srcReg = srcAddrBaseReg; -#ifdef DEBUG - bool isSrcRegAddrAlignmentKnown = false; - bool isDstRegAddrAlignmentKnown = false; -#endif - if (srcLclNum != BAD_VAR_NUM) { bool fpBased; @@ -2813,10 +2808,6 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node) srcReg = fpBased ? REG_FPBASE : REG_SPBASE; helper.SetSrcOffset(baseAddr + srcOffset); - -#ifdef DEBUG - isSrcRegAddrAlignmentKnown = true; -#endif } regNumber dstReg = dstAddrBaseReg; @@ -2828,10 +2819,6 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node) dstReg = fpBased ? REG_FPBASE : REG_SPBASE; helper.SetDstOffset(baseAddr + dstOffset); - -#ifdef DEBUG - isDstRegAddrAlignmentKnown = true; -#endif } bool canEncodeAllLoads = true; @@ -2945,8 +2932,8 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node) } #endif -#ifndef JIT32_GCENCODER - if (!node->gtBlkOpGcUnsafe && ((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0))) + if (!node->gtBlkOpGcUnsafe && + ((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0) || (node->GetLayout()->HasGCPtr()))) { // 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 @@ -2955,7 +2942,6 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node) node->gtBlkOpGcUnsafe = true; GetEmitter()->emitDisableGC(); } -#endif if ((srcOffsetAdjustment != 0) && (dstOffsetAdjustment != 0)) {