Fix GT_LCL_FLD case in gtGetStructHandleIfPresent
authorCarol Eidt <carol.eidt@microsoft.com>
Fri, 27 Jan 2017 18:09:58 +0000 (10:09 -0800)
committerCarol Eidt <carol.eidt@microsoft.com>
Fri, 27 Jan 2017 18:33:04 +0000 (10:33 -0800)
This method was incorrectly returning the parent struct handle instead of the handle for the field. This is showing up in remorphing of a SIMD field that was assigned in a field-by-field assignment.

Fix #9159

src/jit/gentree.cpp

index 58342bc..263ba60 100644 (file)
@@ -16323,8 +16323,15 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree)
             case GT_ASG:
                 structHnd = gtGetStructHandleIfPresent(tree->gtGetOp1());
                 break;
-            case GT_LCL_VAR:
             case GT_LCL_FLD:
+#ifdef FEATURE_SIMD
+                if (varTypeIsSIMD(tree))
+                {
+                    structHnd = gtGetStructHandleForSIMD(tree->gtType, TYP_FLOAT);
+                }
+#endif
+                break;
+            case GT_LCL_VAR:
                 structHnd = lvaTable[tree->AsLclVarCommon()->gtLclNum].lvVerTypeInfo.GetClassHandle();
                 break;
             case GT_RETURN: