diff --git a/src/coreclr/jit/objectalloc.cpp b/src/coreclr/jit/objectalloc.cpp index 0c5110d8f28ffb..426d610b7feacb 100644 --- a/src/coreclr/jit/objectalloc.cpp +++ b/src/coreclr/jit/objectalloc.cpp @@ -2649,6 +2649,14 @@ void ObjectAllocator::RewriteUses() } else if (newType == TYP_STRUCT) { + // For struct stores there is no upwards type propagation. + // These nodes and any ancestors will remain TYP_STRUCT. + // + if (tree->OperIs(GT_STORE_LCL_VAR, GT_STORE_LCL_FLD)) + { + return Compiler::fgWalkResult::WALK_CONTINUE; + } + newLayout = lclVarDsc->GetLayout(); newType = newLayout->HasGCPtr() ? TYP_BYREF : TYP_I_IMPL; retypeFields = true;