Fix PRE NEW_SETS guarding
authorRichard Biener <rguenther@suse.de>
Wed, 11 Nov 2020 17:15:57 +0000 (18:15 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 11 Nov 2020 17:17:00 +0000 (18:17 +0100)
Accesses to NEW_SETS should be properly guarded.  Committed
as obvious.

2020-11-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97623
* tree-ssa-pre.c (create_expression_by_pieces): Guard
NEW_SETS access.
(insert_into_preds_of_block): Likewise.

gcc/tree-ssa-pre.c

index 6dea8c28a1a62ec3e3e24560ff2a911f626b1537..10d223bd3659b5ced3296c7fa4233d96a3741a70 100644 (file)
@@ -3064,7 +3064,8 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
              vn_info->value_id = get_next_value_id ();
              nameexpr = get_or_alloc_expr_for_name (forcedname);
              add_to_value (vn_info->value_id, nameexpr);
-             bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
+             if (NEW_SETS (block))
+               bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
              bitmap_value_replace_in_set (AVAIL_OUT (block), nameexpr);
            }
 
@@ -3231,8 +3232,8 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
   bitmap_insert_into_set (PHI_GEN (block), newphi);
   bitmap_value_replace_in_set (AVAIL_OUT (block),
                               newphi);
-  bitmap_insert_into_set (NEW_SETS (block),
-                         newphi);
+  if (NEW_SETS (block))
+    bitmap_insert_into_set (NEW_SETS (block), newphi);
 
   /* If we insert a PHI node for a conversion of another PHI node
      in the same basic-block try to preserve range information.