diff options
author | Richard Biener <rguenther@suse.de> | 2018-01-09 08:55:26 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-01-09 08:55:26 +0000 |
commit | b25f84d0ff01aa4014428402029c46cda4c4a2a0 (patch) | |
tree | bdd81daf338c54767124a569dcd2789565d712a5 /gcc | |
parent | b1a0199b64e680d0eb206eaeff4893bb441d9feb (diff) | |
download | gcc-b25f84d0ff01aa4014428402029c46cda4c4a2a0.zip gcc-b25f84d0ff01aa4014428402029c46cda4c4a2a0.tar.gz gcc-b25f84d0ff01aa4014428402029c46cda4c4a2a0.tar.bz2 |
re PR tree-optimization/83572 ([graphite] ICE in verify_dominators, at dominance.c:1184 (error: dominator of 7 should be 15, not 13))
2018-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/83572
* graphite.c: Include cfganal.h.
(graphite_transform_loops): Connect infinite loops to exit
and remove fake edges at the end.
* gcc.dg/graphite/pr83572.c: New testcase.
From-SVN: r256372
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/graphite.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr83572.c | 22 |
4 files changed, 43 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8045f55..813dca6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/83572 + * graphite.c: Include cfganal.h. + (graphite_transform_loops): Connect infinite loops to exit + and remove fake edges at the end. + 2018-01-09 Jan Hubicka <hubicka@ucw.cz> * ipa-inline.c (edge_badness): Revert accidental checkin. diff --git a/gcc/graphite.c b/gcc/graphite.c index 8208d3d..e5f318d 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "params.h" #include "pretty-print.h" +#include "cfganal.h" #ifdef HAVE_isl #include "cfghooks.h" @@ -350,6 +351,10 @@ graphite_transform_loops (void) calculate_dominance_info (CDI_DOMINATORS); + /* We rely on post-dominators during merging of SESE regions so those + have to be meaningful. */ + connect_infinite_loops_to_exit (); + ctx = isl_ctx_alloc (); isl_options_set_on_error (ctx, ISL_ON_ERROR_ABORT); the_isl_ctx = ctx; @@ -368,6 +373,10 @@ graphite_transform_loops (void) build_scops (&scops); free_dominance_info (CDI_POST_DOMINATORS); + /* Remove the fake exits before transform given they are not reflected + in loop structures we end up verifying. */ + remove_fake_exit_edges (); + if (dump_file && (dump_flags & TDF_DETAILS)) { print_graphite_statistics (dump_file, scops); @@ -428,7 +437,6 @@ graphite_transform_loops (void) release_recorded_exits (cfun); tree_estimate_probability (false); } - } #else /* If isl is not available: #ifndef HAVE_isl. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c73af5e..ffade44 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-09 Richard Biener <rguenther@suse.de> + + PR tree-optimization/83572 + * gcc.dg/graphite/pr83572.c: New testcase. + 2018-01-09 Jakub Jelinek <jakub@redhat.com> PR target/83507 diff --git a/gcc/testsuite/gcc.dg/graphite/pr83572.c b/gcc/testsuite/gcc.dg/graphite/pr83572.c new file mode 100644 index 0000000..1f65dc3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr83572.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O -floop-nest-optimize -fno-tree-loop-im" } */ + +int u0, l1; + +void +u3 (int s1) +{ + for (;;) + { + for (u0 = 0; u0 < 2; ++u0) + { + } + + if (s1 != 0) + for (l1 = 0; l1 < 2; ++l1) + { + } + + l1 = 0; + } +} |