From d399b8cf12eb4348a1cda1efc98629082ec55e51 Mon Sep 17 00:00:00 2001 From: Brian Bohe Date: Thu, 8 Dec 2022 09:36:29 -0800 Subject: [PATCH] Fix and unifying genStoreLclFld/LclVar on x64 --- src/coreclr/jit/codegenxarch.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/jit/codegenxarch.cpp b/src/coreclr/jit/codegenxarch.cpp index 271385d19e4bd..dc344c1df7c0d 100644 --- a/src/coreclr/jit/codegenxarch.cpp +++ b/src/coreclr/jit/codegenxarch.cpp @@ -4893,12 +4893,12 @@ void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree) // Updating variable liveness after instruction was emitted if (targetReg != REG_NA) { - genUpdateLife(tree); - varDsc->SetRegNum(REG_STK); + genProduceReg(tree); } else { - genProduceReg(tree); + genUpdateLife(tree); + varDsc->SetRegNum(REG_STK); } } @@ -5018,13 +5018,13 @@ void CodeGen::genCodeForStoreLclVar(GenTreeLclVar* lclNode) emitTypeSize(targetType)); } } + // Updating variable liveness after instruction was emitted if (targetReg != REG_NA) { genProduceReg(lclNode); } else { - // Updating variable liveness after instruction was emitted genUpdateLife(lclNode); varDsc->SetRegNum(REG_STK); }