diff --git a/src/coreclr/jit/lclmorph.cpp b/src/coreclr/jit/lclmorph.cpp index e3e9cccb7d51d1..38431916e065fd 100644 --- a/src/coreclr/jit/lclmorph.cpp +++ b/src/coreclr/jit/lclmorph.cpp @@ -1209,6 +1209,14 @@ class LocalAddressVisitor final : public GenTreeVisitor assert(elementType == TYP_SIMD12); assert(varDsc->TypeGet() == TYP_SIMD16); + // If we are not doing struct promotion and we have zero-initialization, + // then we need to produce a VecCon(0). + if (elementNode->IsIntegralConst(0)) + { + DEBUG_DESTROY_NODE(elementNode); + elementNode = m_compiler->gtNewZeroConNode(TYP_SIMD12); + } + // We inverse the operands here and take elementNode as the main value and simdLclNode[3] as the // new value. This gives us a new TYP_SIMD16 with all elements in the right spots