diff options
-rw-r--r-- | src/jit/codegenxarch.cpp | 5 | ||||
-rw-r--r-- | src/jit/flowgraph.cpp | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp index 8e2482f6c6..d8af37721c 100644 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -2663,9 +2663,8 @@ CodeGen::genMultiRegCallStoreToLocal(GenTreePtr treeNode) // var in 'var = call' is flagged as lvIsMultiRegArgOrRet to prevent it from // being struct poromoted. // - // TODO-BUG: Crossgen of mscorlib fires the below assert. - // A git issue is opened for investigating this. - // noway_assert(varDsc->lvIsMultiRegArgOrRet); + + noway_assert(varDsc->lvIsMultiRegArgOrRet); getEmitter()->emitIns_S_R(ins_Store(type0), emitTypeSize(type0), reg0, lclNum, 0); getEmitter()->emitIns_S_R(ins_Store(type1), emitTypeSize(type1), reg1, lclNum, 8); diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index ceba942847..74821ec079 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -21674,6 +21674,13 @@ GenTreePtr Compiler::fgAssignStructInlineeToVar(GenTreePtr child, CORINFO_CLASS_ // If inlinee was just a call, new inlinee is v05 = call() newInlinee = gtNewAssignNode(dst, src); + // When returning a multi-register value in a local var, make sure the variable is + // marked as lvIsMultiRegArgOrRet, so it does not get promoted. + if (src->AsCall()->HasMultiRegRetVal()) + { + lvaTable[tmpNum].lvIsMultiRegArgOrRet = true; + } + // If inlinee was comma, but a deeper call, new inlinee is (, , , v05 = call()) if (child->gtOper == GT_COMMA) { |