From: Richard Biener Date: Wed, 11 Nov 2020 17:15:57 +0000 (+0100) Subject: Fix PRE NEW_SETS guarding X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e8b368c3d33fd8ddafdd37f8e1b2ba45d1a122e;p=gcc.git Fix PRE NEW_SETS guarding Accesses to NEW_SETS should be properly guarded. Committed as obvious. 2020-11-11 Richard Biener PR tree-optimization/97623 * tree-ssa-pre.c (create_expression_by_pieces): Guard NEW_SETS access. (insert_into_preds_of_block): Likewise. --- diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 6dea8c28a1a..10d223bd365 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -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.