Fix `gtCloneExpr` for `GT_IND(GT_INDEX_ADDR)`.
authorPat Gavlin <pagavlin@microsoft.com>
Wed, 30 Aug 2017 19:44:27 +0000 (12:44 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Wed, 30 Aug 2017 19:44:27 +0000 (12:44 -0700)
This function does not need to update the array info map when cloning
a `GT_IND` if the address is a `GT_INDEX_ADDR`.

src/jit/gentree.cpp

index 2284197ebdc9593e8b313dad65b6d935e97b6159..f0500694b73c78ccba2e72453397c225e983adfb 100644 (file)
@@ -7611,14 +7611,14 @@ GenTreePtr Compiler::gtCloneExpr(
             case GT_IND:
             case GT_OBJ:
             case GT_STORE_OBJ:
-                if (tree->gtFlags & GTF_IND_ARR_INDEX)
+            {
+                ArrayInfo arrInfo;
+                if (TryGetArrayInfo(tree->AsIndir(), &arrInfo) && !tree->AsIndir()->gtOp1->OperIs(GT_INDEX_ADDR))
                 {
-                    ArrayInfo arrInfo;
-                    bool      b = GetArrayInfoMap()->Lookup(tree, &arrInfo);
-                    assert(b);
                     GetArrayInfoMap()->Set(copy, arrInfo);
                 }
-                break;
+            }
+            break;
 
             default:
                 break;