diff options
author | Richard Biener <rguenther@suse.de> | 2017-03-09 16:19:37 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-03-09 16:19:37 +0000 |
commit | d721dc3c4bb4a29f6c2cee5be88710a1b107e2f2 (patch) | |
tree | 0179a516678a98ec5091603a550032b3990ebb78 /gcc | |
parent | e0472d7e8cefd8f4eed658424b8283fcd8ca4b15 (diff) | |
download | gcc-d721dc3c4bb4a29f6c2cee5be88710a1b107e2f2.zip gcc-d721dc3c4bb4a29f6c2cee5be88710a1b107e2f2.tar.gz gcc-d721dc3c4bb4a29f6c2cee5be88710a1b107e2f2.tar.bz2 |
re PR tree-optimization/79977 ([graphite] ICE in outermost_loop_in_sese, at sese.c:300 w/ -O2 -floop-nest-optimize)
2017-03-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/79977
* graphite-scop-detection.c (scop_detection::merge_sese):
Handle the case of extra exits to blocks dominating the entry.
* gcc.dg/graphite/pr79977.c: New testcase.
From-SVN: r246006
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/graphite-scop-detection.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr79977.c | 27 |
4 files changed, 57 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 901d0a4..2c1b515 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/79977 + * graphite-scop-detection.c (scop_detection::merge_sese): + Handle the case of extra exits to blocks dominating the entry. + 2017-03-09 Toma Tabacu <toma.tabacu@imgtec.com> * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes): diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index c372141..6b722b4 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -817,6 +817,25 @@ scop_detection::merge_sese (sese_l first, sese_l second) const != loop_depth (exit->dest->loop_father)) return invalid_sese; + /* For now we just bail out when there is a loop exit in the region + that is not also the exit of the region. We could enlarge the + region to cover the loop that region exits to. See PR79977. */ + if (loop_outer (entry->src->loop_father)) + { + vec<edge> exits = get_loop_exit_edges (entry->src->loop_father); + for (unsigned i = 0; i < exits.length (); ++i) + { + if (exits[i] != exit + && bb_in_region (exits[i]->src, entry->dest, exit->src)) + { + DEBUG_PRINT (dp << "[scop-detection-fail] cannot merge seses.\n"); + exits.release (); + return invalid_sese; + } + } + exits.release (); + } + /* For now we just want to bail out when exit does not post-dominate entry. TODO: We might just add a basic_block at the exit to make exit post-dominate entry (the entire region). */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index deb6f63..5050929 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/79977 + * gcc.dg/graphite/pr79977.c: New testcase. + 2017-03-09 Toma Tabacu <toma.tabacu@imgtec.com> * g++.dg/lto/pr69589_0.C: Add dg-require-effective-target for diff --git a/gcc/testsuite/gcc.dg/graphite/pr79977.c b/gcc/testsuite/gcc.dg/graphite/pr79977.c new file mode 100644 index 0000000..09606b0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr79977.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -floop-nest-optimize" } */ + +int uo[3]; +int di; + +void +i7 (int mp) +{ + int l4; + +wh: + while (l4 > 1) + { + for (di = 0; di < 2; ++di) + uo[di] = 0; + + for (di = 0; di < 3; ++di) + { + uo[di] = 0; + if (mp != 0) + goto wh; + } + + --l4; + } +} |