summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/jit/codegenxarch.cpp5
-rw-r--r--src/jit/flowgraph.cpp7
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 b5abc81f94..ffd6c89166 100644
--- a/src/jit/flowgraph.cpp
+++ b/src/jit/flowgraph.cpp
@@ -21670,6 +21670,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)
{