diff options
author | Richard Biener <rguenther@suse.de> | 2016-08-09 07:40:50 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-08-09 07:40:50 +0000 |
commit | 50bf47fdc08807bf8fc0362d677c8fc7dd4514b0 (patch) | |
tree | 2bb2c9f41ad63b81575fdbde736acc6db6257acc /gcc/tree-cfgcleanup.c | |
parent | fe7afdf5b55d1c3b8b00e7ea16b1b5df0537f45a (diff) | |
download | gcc-50bf47fdc08807bf8fc0362d677c8fc7dd4514b0.zip gcc-50bf47fdc08807bf8fc0362d677c8fc7dd4514b0.tar.gz gcc-50bf47fdc08807bf8fc0362d677c8fc7dd4514b0.tar.bz2 |
re PR tree-optimization/71802 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in expand_LOOP_VECTORIZED)
2016-08-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/71802
* tree-cfgcleanup.c (cleanup_tree_cfg_bb): Make sure to catch
all merge opportunities with the predecessor.
* gcc.dg/torture/pr71802.c: New testcase.
From-SVN: r239274
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r-- | gcc/tree-cfgcleanup.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index ab8a913..3fe0d3e 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -641,24 +641,25 @@ cleanup_tree_cfg_bb (basic_block bb) && remove_forwarder_block (bb)) return true; + /* If there is a merge opportunity with the predecessor + do nothing now but wait until we process the predecessor. + This happens when we visit BBs in a non-optimal order and + avoids quadratic behavior with adjusting stmts BB pointer. */ + if (single_pred_p (bb) + && can_merge_blocks_p (single_pred (bb), bb)) + /* But make sure we _do_ visit it. When we remove unreachable paths + ending in a backedge we fail to mark the destinations predecessors + as changed. */ + bitmap_set_bit (cfgcleanup_altered_bbs, single_pred (bb)->index); + /* Merging the blocks may create new opportunities for folding conditional branches (due to the elimination of single-valued PHI nodes). */ - if (single_succ_p (bb) - && can_merge_blocks_p (bb, single_succ (bb))) + else if (single_succ_p (bb) + && can_merge_blocks_p (bb, single_succ (bb))) { - /* If there is a merge opportunity with the predecessor - do nothing now but wait until we process the predecessor. - This happens when we visit BBs in a non-optimal order and - avoids quadratic behavior with adjusting stmts BB pointer. */ - if (single_pred_p (bb) - && can_merge_blocks_p (single_pred (bb), bb)) - ; - else - { - merge_blocks (bb, single_succ (bb)); - return true; - } + merge_blocks (bb, single_succ (bb)); + return true; } return false; |