diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-28 15:33:33 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-28 15:33:33 +0000 |
commit | ca74fb2bfc8528358f51cf36decb861e04471860 (patch) | |
tree | 570c48adea6afaf5c3e803869eeaa4df0c36d314 | |
parent | b2d780af5fc18d246caf55d7040cb0302d8bc36d (diff) |
2018-02-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/84584
* graphite-scop-detection.c (scop_detection::add_scop): Discard
SCoPs with fake exit edge.
* gcc.dg/graphite/pr84584.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258070 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/graphite-scop-detection.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr84584.c | 23 |
4 files changed, 43 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 820b926ced79..dcea097318a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-28 Richard Biener <rguenther@suse.de> + + PR tree-optimization/84584 + * graphite-scop-detection.c (scop_detection::add_scop): Discard + SCoPs with fake exit edge. + 2018-02-28 Martin Liska <mliska@suse.cz> PR testsuite/84597 diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 2331dec69190..48e40142e59f 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -590,6 +590,15 @@ scop_detection::add_scop (sese_l s) { gcc_assert (s); + /* If the exit edge is fake discard the SCoP for now as we're removing the + fake edges again after analysis. */ + if (s.exit->flags & EDGE_FAKE) + { + DEBUG_PRINT (dp << "[scop-detection-fail] Discarding infinite loop SCoP: "; + print_sese (dump_file, s)); + return; + } + /* Include the BB with the loop-closed SSA PHI nodes, we need this block in the region for code-generating out-of-SSA copies. canonicalize_loop_closed_ssa makes sure that is in proper shape. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 694a01846778..d12f8103f8f4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-28 Richard Biener <rguenther@suse.de> + + PR tree-optimization/84584 + * gcc.dg/graphite/pr84584.c: New testcase. + 2018-02-28 Jonathan Wakely <jwakely@redhat.com> PR preprocessor/84517 diff --git a/gcc/testsuite/gcc.dg/graphite/pr84584.c b/gcc/testsuite/gcc.dg/graphite/pr84584.c new file mode 100644 index 000000000000..a6c619494dd3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr84584.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fgraphite-identity -fno-tree-loop-im" } */ + +int q3, w1; + +void +bw (int b8) +{ + const int sd = 2; + int mc; + + for (mc = 0; mc < sd; ++mc) + { +ik: + for (w1 = 0; w1 < sd; ++w1) + ++b8; + } + + for (q3 = 0; q3 < sd; ++q3) + ; + + goto ik; +} |