diff options
author | Richard Biener <rguenther@suse.de> | 2013-04-30 15:03:58 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-04-30 15:03:58 +0000 |
commit | 3551257c5d24d5193edbdbc4604c1d995d50902b (patch) | |
tree | ecfd28b26879586b3406ed9bd53c63c9752a365e /gcc | |
parent | 4c1aff1ce430fdf4b46caa632fd44b4d0f557720 (diff) | |
download | gcc-3551257c5d24d5193edbdbc4604c1d995d50902b.zip gcc-3551257c5d24d5193edbdbc4604c1d995d50902b.tar.gz gcc-3551257c5d24d5193edbdbc4604c1d995d50902b.tar.bz2 |
re PR tree-optimization/57122 (ICE in verify_loop_structure, at cfgloop.c:1647 (loop n’s latch does not have an edge to its header !))
2013-04-30 Richard Biener <rguenther@suse.de>
PR middle-end/57122
* cfghooks.c (split_edge): Properly check for the loop
latch edge.
* gcc.dg/torture/pr57122.c: New testcase.
From-SVN: r198456
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cfghooks.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr57122.c | 27 |
4 files changed, 41 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb86d6e..02b77f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2013-04-30 Richard Biener <rguenther@suse.de> + PR middle-end/57122 + * cfghooks.c (split_edge): Properly check for the loop + latch edge. + +2013-04-30 Richard Biener <rguenther@suse.de> + PR middle-end/57107 * tree-eh.c (sink_clobbers): Preserve virtual SSA form. diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index f583b2f..22b962b 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -662,7 +662,9 @@ split_edge (edge e) loop = find_common_loop (src->loop_father, dest->loop_father); add_bb_to_loop (ret, loop); - if (loop->latch == src) + /* If we split the latch edge of loop adjust the latch block. */ + if (loop->latch == src + && loop->header == dest) loop->latch = ret; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0d5705a..ae111b2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2013-04-30 Richard Biener <rguenther@suse.de> + PR middle-end/57122 + * gcc.dg/torture/pr57122.c: New testcase. + +2013-04-30 Richard Biener <rguenther@suse.de> + PR middle-end/57107 * g++.dg/torture/pr57107.C: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr57122.c b/gcc/testsuite/gcc.dg/torture/pr57122.c new file mode 100644 index 0000000..f1b99c8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57122.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ + +unsigned a; +int b, c; + +void f(void) +{ + if(a) + { + for(a = 0; a < 2; a++) + a /= 7; + + for(;; a++) + { + if(a) + lbl1: + b++; + + if(c) + goto lbl1; +lbl2: + ; + } + } + + goto lbl2; +} |