summaryrefslogtreecommitdiff
path: root/src/jit/lower.cpp
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2017-11-27 11:24:59 -0800
committerGitHub <noreply@github.com>2017-11-27 11:24:59 -0800
commit07985712524311aa6c16d2ad0072a6a39892aacc (patch)
tree9e7e902230f17158dcb852ab7f312c73c47afc6e /src/jit/lower.cpp
parent93ddc4d563a09b21dd829c8c8a50911a200042f3 (diff)
parent2486b80099686408c290474edf0327a886e53572 (diff)
downloadcoreclr-07985712524311aa6c16d2ad0072a6a39892aacc.tar.gz
coreclr-07985712524311aa6c16d2ad0072a6a39892aacc.tar.bz2
coreclr-07985712524311aa6c16d2ad0072a6a39892aacc.zip
Merge pull request #15187 from BruceForstall/FixArmTailcall
Fix arm32 stub indirect tailcall
Diffstat (limited to 'src/jit/lower.cpp')
-rw-r--r--src/jit/lower.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/jit/lower.cpp b/src/jit/lower.cpp
index 1c4cdd4486..65c193fed2 100644
--- a/src/jit/lower.cpp
+++ b/src/jit/lower.cpp
@@ -4138,12 +4138,27 @@ GenTree* Lowering::LowerVirtualStubCall(GenTreeCall* call)
// fgMorphArgs will have created trees to pass the address in VirtualStubParam.reg.
// All we have to do here is add an indirection to generate the actual call target.
- GenTree* ind = Ind(call->gtCallAddr);
+ GenTree* ind;
+
+#ifdef _TARGET_ARM_
+ // For ARM, fgMorphTailCall has already made gtCallAddr a GT_IND for virtual stub tail calls.
+ // (When we eliminate LEGACY_BACKEND maybe we can eliminate this asymmetry?)
+ if (call->IsTailCallViaHelper())
+ {
+ ind = call->gtCallAddr;
+ assert(ind->gtOper == GT_IND);
+ }
+ else
+#endif // _TARGET_ARM_
+ {
+ ind = Ind(call->gtCallAddr);
+ BlockRange().InsertAfter(call->gtCallAddr, ind);
+ call->gtCallAddr = ind;
+ }
+
ind->gtFlags |= GTF_IND_REQ_ADDR_IN_REG;
- BlockRange().InsertAfter(call->gtCallAddr, ind);
ContainCheckIndir(ind->AsIndir());
- call->gtCallAddr = ind;
}
else
{