Skip to content

Commit acf22a0

Browse files
More fixes for regressions
Types of location nodes do not matter, the underlying locations do.
1 parent 202fc54 commit acf22a0

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/coreclr/jit/morph.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12632,22 +12632,17 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac)
1263212632
// out-of-bounds w.r.t. the local).
1263312633
if ((temp != nullptr) && !foldAndReturnTemp)
1263412634
{
12635-
assert(temp->OperIsLocal());
12635+
assert(temp->OperIsLocalRead());
1263612636

12637-
const unsigned lclNum = temp->AsLclVarCommon()->GetLclNum();
12638-
LclVarDsc* const varDsc = lvaGetDesc(lclNum);
12639-
12640-
const var_types tempTyp = temp->TypeGet();
12641-
const bool useExactSize = varTypeIsStruct(tempTyp) || (tempTyp == TYP_BLK) || (tempTyp == TYP_LCLBLK);
12642-
const unsigned varSize = useExactSize ? varDsc->lvExactSize : genTypeSize(temp);
12637+
unsigned lclNum = temp->AsLclVarCommon()->GetLclNum();
1264312638

1264412639
// Make sure we do not enregister this lclVar.
1264512640
lvaSetVarDoNotEnregister(lclNum DEBUGARG(DoNotEnregisterReason::LocalField));
1264612641

1264712642
// If the size of the load is greater than the size of the lclVar, we cannot fold this access into
1264812643
// a lclFld: the access represented by an lclFld node must begin at or after the start of the
1264912644
// lclVar and must not extend beyond the end of the lclVar.
12650-
if ((ival1 >= 0) && ((ival1 + genTypeSize(typ)) <= varSize))
12645+
if ((ival1 >= 0) && ((ival1 + genTypeSize(typ)) <= lvaLclExactSize(lclNum)))
1265112646
{
1265212647
GenTreeLclFld* lclFld;
1265312648

0 commit comments

Comments
 (0)