GS checkes: only set lVExactSize for SIMD vars.
authorPat Gavlin <pagavlin@microsoft.com>
Tue, 17 Jan 2017 21:58:06 +0000 (13:58 -0800)
committerPat Gavlin <pagavlin@microsoft.com>
Tue, 17 Jan 2017 21:59:38 +0000 (13:59 -0800)
Copying this field for non-SIMD variables causes a later call to
`lvaSetStruct` to skip critical initialization steps. Skipping these
steps led to failures in GC stress due to uninitialized frame variables
that contained GC pointers.

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

src/coreclr/src/jit/gschecks.cpp

index c3522b8..e4f1c25 100644 (file)
@@ -406,11 +406,11 @@ void Compiler::gsParamsToShadows()
 
 #ifdef FEATURE_SIMD
         lvaTable[shadowVar].lvSIMDType            = varDsc->lvSIMDType;
-        lvaTable[shadowVar].lvExactSize           = varDsc->lvExactSize;
         lvaTable[shadowVar].lvUsedInSIMDIntrinsic = varDsc->lvUsedInSIMDIntrinsic;
         if (varDsc->lvSIMDType)
         {
-            lvaTable[shadowVar].lvBaseType = varDsc->lvBaseType;
+            lvaTable[shadowVar].lvExactSize = varDsc->lvExactSize;
+            lvaTable[shadowVar].lvBaseType  = varDsc->lvBaseType;
         }
 #endif
         lvaTable[shadowVar].lvRegStruct = varDsc->lvRegStruct;