summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2018-12-12 17:11:35 -0800
committerGitHub <noreply@github.com>2018-12-12 17:11:35 -0800
commit36df5c596406245e9db944e2d14a1a818dfba920 (patch)
tree32c9d5867d86579c506d66adef86e18dbed8c5d4
parentd279e47a9bc6a9d44484c3143a5f8dd9bc57579c (diff)
parent62ef56ee42808e746bbac44ce7f4f65677bba55a (diff)
downloadcoreclr-36df5c596406245e9db944e2d14a1a818dfba920.tar.gz
coreclr-36df5c596406245e9db944e2d14a1a818dfba920.tar.bz2
coreclr-36df5c596406245e9db944e2d14a1a818dfba920.zip
Merge pull request #21512 from briansull/fix_750014
Fix for PMI assert: 'vnWx != NoVN'
-rw-r--r--src/jit/valuenum.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp
index a90f0672c7..0ea6df9bc9 100644
--- a/src/jit/valuenum.cpp
+++ b/src/jit/valuenum.cpp
@@ -6777,29 +6777,33 @@ void Compiler::fgValueNumberBlockAssignment(GenTree* tree)
JITDUMP(" *** Missing field sequence info for Dst/LHS of COPYBLK\n");
isNewUniq = true;
}
- else if (lhsFldSeq != nullptr && isEntire)
- {
- // This can occur for structs with one field, itself of a struct type.
- // We are assigning the one field and it is also the entire enclosing struct.
- //
- // Use an unique value number for the old map, as this is an an entire assignment
- // and we won't have any other values in the map
- ValueNumPair oldMap;
- oldMap.SetBoth(vnStore->VNForExpr(compCurBB, lclVarTree->TypeGet()));
- rhsVNPair = vnStore->VNPairApplySelectorsAssign(oldMap, lhsFldSeq, rhsVNPair, lclVarTree->TypeGet(),
- compCurBB);
- }
- else if (!isNewUniq)
- {
- ValueNumPair oldLhsVNPair = lvaTable[lhsLclNum].GetPerSsaData(lclVarTree->GetSsaNum())->m_vnPair;
- rhsVNPair = vnStore->VNPairApplySelectorsAssign(oldLhsVNPair, lhsFldSeq, rhsVNPair,
- lclVarTree->TypeGet(), compCurBB);
- }
if (isNewUniq)
{
rhsVNPair.SetBoth(vnStore->VNForExpr(compCurBB, lclVarTree->TypeGet()));
}
+ else // We will assign rhsVNPair into a map[lhsFldSeq]
+ {
+ if (lhsFldSeq != nullptr && isEntire)
+ {
+ // This can occur for structs with one field, itself of a struct type.
+ // We are assigning the one field and it is also the entire enclosing struct.
+ //
+ // Use an unique value number for the old map, as this is an an entire assignment
+ // and we won't have any other values in the map
+ ValueNumPair uniqueMap;
+ uniqueMap.SetBoth(vnStore->VNForExpr(compCurBB, lclVarTree->TypeGet()));
+ rhsVNPair = vnStore->VNPairApplySelectorsAssign(uniqueMap, lhsFldSeq, rhsVNPair,
+ lclVarTree->TypeGet(), compCurBB);
+ }
+ else
+ {
+ ValueNumPair oldLhsVNPair =
+ lvaTable[lhsLclNum].GetPerSsaData(lclVarTree->GetSsaNum())->m_vnPair;
+ rhsVNPair = vnStore->VNPairApplySelectorsAssign(oldLhsVNPair, lhsFldSeq, rhsVNPair,
+ lclVarTree->TypeGet(), compCurBB);
+ }
+ }
lvaTable[lhsLclNum].GetPerSsaData(lclDefSsaNum)->m_vnPair = vnStore->VNPNormalPair(rhsVNPair);