diff options
author | Richard Biener <rguenther@suse.de> | 2018-01-29 09:16:09 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-01-29 09:16:09 +0000 |
commit | 27837e0c35badaa19b418d460c0cf69012bc9f07 (patch) | |
tree | 1e3999e7c6c63148f4903fb7cba0897e7dbcdb32 /gcc/tree-ssa-loop-ivcanon.c | |
parent | 3be34c0b1dec1272dfabec1e94a4666e9499fdc1 (diff) | |
download | gcc-27837e0c35badaa19b418d460c0cf69012bc9f07.zip gcc-27837e0c35badaa19b418d460c0cf69012bc9f07.tar.gz gcc-27837e0c35badaa19b418d460c0cf69012bc9f07.tar.bz2 |
re PR tree-optimization/84057 (ICE: Segmentation fault (in can_remove_branch_p))
2018-01-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/84057
* tree-ssa-loop-ivcanon.c (unloop_loops): Deal with already
removed paths when removing edges.
* gcc.dg/graphite/pr84057.c: New testcase.
From-SVN: r257139
Diffstat (limited to 'gcc/tree-ssa-loop-ivcanon.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivcanon.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 15c378a..a87ed0b 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -660,14 +660,21 @@ unloop_loops (bitmap loop_closed_ssa_invalidated, loops_to_unloop.release (); loops_to_unloop_nunroll.release (); - /* Remove edges in peeled copies. */ + /* Remove edges in peeled copies. Given remove_path removes dominated + regions we need to cope with removal of already removed paths. */ unsigned i; edge e; + auto_vec<int, 20> src_bbs; + src_bbs.reserve_exact (edges_to_remove.length ()); FOR_EACH_VEC_ELT (edges_to_remove, i, e) - { - bool ok = remove_path (e, irred_invalidated, loop_closed_ssa_invalidated); - gcc_assert (ok); - } + src_bbs.quick_push (e->src->index); + FOR_EACH_VEC_ELT (edges_to_remove, i, e) + if (BASIC_BLOCK_FOR_FN (cfun, src_bbs[i])) + { + bool ok = remove_path (e, irred_invalidated, + loop_closed_ssa_invalidated); + gcc_assert (ok); + } edges_to_remove.release (); } |