Force results of rejected multi-reg-returning tail-call candidates to temp. (#22364)
authorEugene Rozenfeld <erozen@microsoft.com>
Fri, 8 Feb 2019 08:14:35 +0000 (00:14 -0800)
committerGitHub <noreply@github.com>
Fri, 8 Feb 2019 08:14:35 +0000 (00:14 -0800)
commita8ebed30b50c32a84ca8edbe033870a9e0f1da61
tree43e51ea34350bbc47ce3ba7da2f029b490ac96e9
parentea452c1ff113413bddd22794dcac0359af0e79fe
Force results of rejected multi-reg-returning tail-call candidates to temp. (#22364)

* Force results of rejected multi-reg-returning tail-call candidates to temp.

Issue #20269 ran into an assert when trying to merge returns, one of which
is a call to a multi-reg-returning method. The repro in the bug is a pmi
of `System.Reflection.Metadata`. I added a simple repro test case.

Results of calls to multi-reg-returning methods are expected to
be saved to temps. Normally it's ensured by `impFixupCallStructReturn`;
however, it doesn't do that for tail-call candidates.

This change forces results of calls to multi-reg-returning methods
to temps if the tail call is rejected late in morph.

Fixes #20269.
src/jit/morph.cpp
tests/src/JIT/Regression/JitBlue/GitHub_20269/GitHub_20269.cs [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_20269/GitHub_20269.csproj [new file with mode: 0644]