From: Bruce Forstall Date: Wed, 24 Aug 2016 00:38:30 +0000 (-0700) Subject: Fix local var ref counts in IND/STOREIND decomposition X-Git-Tag: submit/tizen/20210909.063632~11030^2~9586^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f1fe1201f80276438f66b6629f9cdf34ce8d538;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix local var ref counts in IND/STOREIND decomposition When creating new references to a local variable in long decomposition, the variable reference count must be incremented. Fixes dotnet/coreclr#6588 Commit migrated from https://github.com/dotnet/coreclr/commit/9fe631c1ae3ce12b05de6fdcc7eba465be8ec2ec --- diff --git a/src/coreclr/src/jit/decomposelongs.cpp b/src/coreclr/src/jit/decomposelongs.cpp index d0502af..63a7b60 100644 --- a/src/coreclr/src/jit/decomposelongs.cpp +++ b/src/coreclr/src/jit/decomposelongs.cpp @@ -707,6 +707,8 @@ GenTree* DecomposeLongs::DecomposeStoreInd(LIR::Use& use) storeIndHigh->gtFlags = (storeIndLow->gtFlags & (GTF_ALL_EFFECT | GTF_LIVENESS_MASK)); storeIndHigh->gtFlags |= GTF_REVERSE_OPS; + m_compiler->lvaIncRefCnts(addrBaseHigh); + BlockRange().InsertAfter(storeIndLow, dataHigh, addrBaseHigh, addrHigh, storeIndHigh); return storeIndHigh; @@ -783,6 +785,8 @@ GenTree* DecomposeLongs::DecomposeInd(LIR::Use& use) new (m_compiler, GT_LEA) GenTreeAddrMode(TYP_REF, addrBaseHigh, nullptr, 0, genTypeSize(TYP_INT)); GenTreePtr indHigh = new (m_compiler, GT_IND) GenTreeIndir(GT_IND, TYP_INT, addrHigh, nullptr); + m_compiler->lvaIncRefCnts(addrBaseHigh); + BlockRange().InsertAfter(indLow, addrBaseHigh, addrHigh, indHigh); return FinalizeDecomposition(use, indLow, indHigh); diff --git a/src/coreclr/tests/issues.targets b/src/coreclr/tests/issues.targets index dbd7caa..6863c78 100644 --- a/src/coreclr/tests/issues.targets +++ b/src/coreclr/tests/issues.targets @@ -329,9 +329,6 @@ 6097 - - 6588 - 6778