parloops: don't request insert that won't be completed
authorAlexandre Oliva <oliva@adacore.com>
Thu, 29 Dec 2022 17:33:06 +0000 (14:33 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 29 Dec 2022 17:39:47 +0000 (14:39 -0300)
In take_address_of, we may refrain from completing a decl_address
INSERT if gsi is NULL, so dnn't even ask for an INSERT in this case.

for  gcc/ChangeLog

* tree-parloops.cc (take_address_of): Skip INSERT if !gsi.

gcc/tree-parloops.cc

index e680d97..b829ba7 100644 (file)
@@ -1221,8 +1221,11 @@ take_address_of (tree obj, tree type, edge entry,
   uid = DECL_UID (TREE_OPERAND (TREE_OPERAND (*var_p, 0), 0));
   int_tree_map elt;
   elt.uid = uid;
-  int_tree_map *slot = decl_address->find_slot (elt, INSERT);
-  if (!slot->to)
+  int_tree_map *slot = decl_address->find_slot (elt,
+                                               gsi == NULL
+                                               ? NO_INSERT
+                                               : INSERT);
+  if (!slot || !slot->to)
     {
       if (gsi == NULL)
        return NULL;