diff options
author | Richard Biener <rguenther@suse.de> | 2016-06-06 06:55:19 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-06-06 06:55:19 +0000 |
commit | 9fcebb5aa882861d403b87a572f17c69c8ecab08 (patch) | |
tree | 128b15f444ed9ad6d183ced258d915657f46b78b | |
parent | d48ab0103a07218cc7cb54d705d7b22b596648bf (diff) | |
download | gcc-9fcebb5aa882861d403b87a572f17c69c8ecab08.zip gcc-9fcebb5aa882861d403b87a572f17c69c8ecab08.tar.gz gcc-9fcebb5aa882861d403b87a572f17c69c8ecab08.tar.bz2 |
re PR tree-optimization/71398 (ICE at -O3 in 32-bit and 64-bit mode on x86_64-linux-gnu (Segmentation fault, find_edge))
2016-06-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/71398
* tree-ssa-loop-ivcanon.c (unloop_loops): First unloop, then
remove edges.
* gcc.dg/torture/pr71398.c: New testcase.
From-SVN: r237117
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr71398.c | 17 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivcanon.c | 20 |
4 files changed, 38 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b3e3aa..8e4b776 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-06 Richard Biener <rguenther@suse.de> + + PR tree-optimization/71398 + * tree-ssa-loop-ivcanon.c (unloop_loops): First unloop, then + remove edges. + 2016-06-05 James Bowman <james.bowman@ftdichip.com> * config/ft32/ft32.c (ft32_setup_incoming_varargs, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c09354d..4dc8a52 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-06 Richard Biener <rguenther@suse.de> + + PR tree-optimization/71398 + * gcc.dg/torture/pr71398.c: New testcase. + 2016-06-06 Uros Bizjak <ubizjak@gmail.com> PR target/71389 diff --git a/gcc/testsuite/gcc.dg/torture/pr71398.c b/gcc/testsuite/gcc.dg/torture/pr71398.c new file mode 100644 index 0000000..affb561 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr71398.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +unsigned a, b, c[1]; +void __assert_fail() __attribute__((__noreturn__)); +void fn1() +{ + int d; + unsigned e; + for (;;) + { + d = 0; + for (; d <= 6; d++) + c[d] || a ? 0 : __assert_fail(); + for (; e <= 5; e++) + a = b; + } +} diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 248c125..5a7c378 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -615,16 +615,6 @@ static void unloop_loops (bitmap loop_closed_ssa_invalidated, bool *irred_invalidated) { - /* First remove edges in peeled copies. */ - unsigned i; - edge e; - FOR_EACH_VEC_ELT (edges_to_remove, i, e) - { - bool ok = remove_path (e); - gcc_assert (ok); - } - edges_to_remove.release (); - while (loops_to_unloop.length ()) { struct loop *loop = loops_to_unloop.pop (); @@ -660,6 +650,16 @@ unloop_loops (bitmap loop_closed_ssa_invalidated, } loops_to_unloop.release (); loops_to_unloop_nunroll.release (); + + /* Remove edges in peeled copies. */ + unsigned i; + edge e; + FOR_EACH_VEC_ELT (edges_to_remove, i, e) + { + bool ok = remove_path (e); + gcc_assert (ok); + } + edges_to_remove.release (); } /* Tries to unroll LOOP completely, i.e. NITER times. |