From: Sergey Andreenko Date: Wed, 15 Nov 2017 00:30:52 +0000 (-0800) Subject: move fgFixupStructReturn (#14966) X-Git-Tag: accepted/tizen/base/20180629.140029~567 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=191cd4c9a8cef8440f9bb2ec579a0d0eaa1ca962;p=platform%2Fupstream%2Fcoreclr.git move fgFixupStructReturn (#14966) It was done twice during the tail call optimization and in the args morphing. The problem is if tail call optimization was aborted it was not clear was `fgFixupStructReturn` called or not. --- diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index 80a0008..cb31f47 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -3065,11 +3065,6 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) call->fgArgInfo = new (this, CMK_Unknown) fgArgInfo(this, call, numArgs); } - if (varTypeIsStruct(call)) - { - fgFixupStructReturn(call); - } - /* First we morph the argument subtrees ('this' pointer, arguments, etc.). * During the first call to fgMorphArgs we also record the * information about late arguments we have in 'fgArgInfo'. @@ -8253,6 +8248,10 @@ GenTreePtr Compiler::fgAssignRecursiveCallArgToCallerParam(GenTreePtr arg, GenTreePtr Compiler::fgMorphCall(GenTreeCall* call) { + if (varTypeIsStruct(call)) + { + fgFixupStructReturn(call); + } if (call->CanTailCall()) { // It should either be an explicit (i.e. tail prefixed) or an implicit tail call @@ -8397,11 +8396,6 @@ GenTreePtr Compiler::fgMorphCall(GenTreeCall* call) } #endif // FEATURE_TAILCALL_OPT - if (varTypeIsStruct(call)) - { - fgFixupStructReturn(call); - } - var_types callType = call->TypeGet(); // We have to ensure to pass the incoming retValBuf as the