Fix Arm64 crossgen
authorCarol Eidt <carol.eidt@microsoft.com>
Fri, 19 Aug 2016 19:14:28 +0000 (12:14 -0700)
committerCarol Eidt <carol.eidt@microsoft.com>
Fri, 19 Aug 2016 20:32:18 +0000 (13:32 -0700)
The type of the ADDR node needs to be set to TYP_BYREF for arm64.
For x64/ux, oddly, it requires the struct type. I added a TODO-Cleanu8p
comment because a GT_ADDR should never be TYP_STRUCT.

Commit migrated from https://github.com/dotnet/coreclr/commit/1ca8b494fe38145f04753adc341d965f2bb328d6

src/coreclr/src/jit/morph.cpp

index e055bd3..412e75e 100755 (executable)
@@ -2031,7 +2031,13 @@ GenTreePtr Compiler::fgMakeTmpArgNode(
         }
         else
         {
-            arg      = gtNewOperNode(GT_ADDR, type, arg);
+#ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING
+            // TODO-Cleanup: Fix this - we should never have an address that is TYP_STRUCT.
+            var_types addrType = type;
+#else
+            var_types addrType = TYP_BYREF;
+#endif
+            arg      = gtNewOperNode(GT_ADDR, addrType, arg);
             addrNode = arg;
 
 #if FEATURE_MULTIREG_ARGS