{
GenTree* arg = lhs->AsIndir()->Addr()->gtEffectiveVal(/*commaOnly*/ true);
- if ((tree->gtFlags & GTF_IND_VOLATILE) != 0)
+ if ((lhs->gtFlags & GTF_IND_VOLATILE) != 0)
{
memoryHavoc |= memoryKindSet(GcHeap, ByrefExposed);
continue;
ValueNumPair addrXvnp;
vnStore->VNPUnpackExc(addr->gtVNPair, &addrNvnp, &addrXvnp);
+ // To be able to propagate exception sets, we give location nodes the "Void" VN.
+ if ((tree->gtFlags & GTF_IND_ASG_LHS) != 0)
+ {
+ tree->gtVNPair = vnStore->VNPWithExc(vnStore->VNPForVoid(), addrXvnp);
+ }
// Is the dereference immutable? If so, model it as referencing the read-only heap.
- if (tree->gtFlags & GTF_IND_INVARIANT)
+ else if (tree->gtFlags & GTF_IND_INVARIANT)
{
assert(!isVolatile); // We don't expect both volatile and invariant
ValueNum newUniq = vnStore->VNForExpr(compCurBB, tree->TypeGet());
tree->gtVNPair = vnStore->VNPWithExc(ValueNumPair(newUniq, newUniq), addrXvnp);
}
- // In general we skip GT_IND nodes on that are the LHS of an assignment. (We labeled these earlier.)
- // We will "evaluate" this as part of the assignment.
- else if ((tree->gtFlags & GTF_IND_ASG_LHS) == 0)
+ else
{
var_types loadType = tree->TypeGet();
ssize_t offset = 0;
tree->gtVNPair = vnStore->VNPWithExc(tree->gtVNPair, addrXvnp);
}
-
- // To be able to propagate exception sets, we give location nodes the "Void" VN.
- if ((tree->gtFlags & GTF_IND_ASG_LHS) != 0)
- {
- tree->gtVNPair = vnStore->VNPWithExc(vnStore->VNPForVoid(), addrXvnp);
- }
}
else if (tree->OperGet() == GT_CAST)
{