diff options
author | Richard Biener <rguenther@suse.de> | 2020-11-27 12:01:25 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-11-27 12:50:32 +0100 |
commit | b6a7b72c6c91cc0d800a603a59e96fbcb07793ba (patch) | |
tree | 5c547f7ace58e69a97cd90fa1bbe6d299ff760aa /gcc/tree-ssa-pre.c | |
parent | 6fb9b4c97690c5750e49c32fa2a373a7c66c5d46 (diff) | |
download | gcc-b6a7b72c6c91cc0d800a603a59e96fbcb07793ba.zip gcc-b6a7b72c6c91cc0d800a603a59e96fbcb07793ba.tar.gz gcc-b6a7b72c6c91cc0d800a603a59e96fbcb07793ba.tar.bz2 |
tree-optimization/98024 - fix rnflow regression
The change to make PRE insertion iterate less had a typo in checking
successors RPO state. Fixing this exposes that regular PRE insertion
when facing a value that is the same on all edges inserts an
assignment in place of a PHI node but fails to set up things so that
this insertion is not repeated (it correctly does not return
'new_stuff'). But with the new iteration scheme this causes us
to repeatedly insert such assignment and change AVAIL_OUT over to
the newly inserted expression. The fix is to treat this as PHI
and insert into PHI_GEN, avoiding repetitive insertion.
2020-11-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/98024
* tree-ssa-pre.c (insert): Fix successor RPO order check.
(do_pre_regular_insertion): When inserting an assignment
in place of an all-same-value PHI still record that into
PHI_GEN.
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r-- | gcc/tree-ssa-pre.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index e25cec7..a17a09a 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3471,6 +3471,7 @@ do_pre_regular_insertion (basic_block block, basic_block dom, add_to_value (val, newe); bitmap_value_replace_in_set (AVAIL_OUT (block), newe); bitmap_insert_into_set (NEW_SETS (block), newe); + bitmap_insert_into_set (PHI_GEN (block), newe); } } } @@ -3808,13 +3809,14 @@ insert (void) |= bitmap_value_replace_in_set (AVAIL_OUT (block), expr); } /* We need to iterate if AVAIL_OUT of an already processed - block source. */ + block source changed. */ if (avail_out_changed && !changed) { edge_iterator ei; edge e; FOR_EACH_EDGE (e, ei, block->succs) - if (bb_rpo[e->src->index] < idx) + if (e->dest->index != EXIT_BLOCK + && bb_rpo[e->dest->index] < idx) changed = true; } |