diff options
author | Richard Biener <rguenther@suse.de> | 2016-08-11 09:02:04 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-08-11 09:02:04 +0000 |
commit | 183ac6d0d295cedffd0e7971151008e9a411f345 (patch) | |
tree | 8d5fbd4bacf84fae62437497b5b8a89b8f7f2ed5 /gcc | |
parent | b152f5a2b33b251ab1874a43d97ce73d11eec0a4 (diff) | |
download | gcc-183ac6d0d295cedffd0e7971151008e9a411f345.zip gcc-183ac6d0d295cedffd0e7971151008e9a411f345.tar.gz gcc-183ac6d0d295cedffd0e7971151008e9a411f345.tar.bz2 |
re PR tree-optimization/72772 (Missed SCEV after pass reordering@236440)
2016-08-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/72772
* cfgloopmanip.c (create_preheader): Use split_edge if there
is a single loop entry, avoiding degenerate PHIs.
* gcc.dg/graphite/pr35356-1.c: Adjust.
* gcc.dg/tree-ssa/pr59597.c: Likewise.
From-SVN: r239357
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cfgloopmanip.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr35356-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr59597.c | 5 |
5 files changed, 25 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d8c65cf..4984f50 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-08-11 Richard Biener <rguenther@suse.de> + PR tree-optimization/72772 + * cfgloopmanip.c (create_preheader): Use split_edge if there + is a single loop entry, avoiding degenerate PHIs. + +2016-08-11 Richard Biener <rguenther@suse.de> + * tree-ssa-threadbackward.c (pass_data_thread_jumps): Remove unconditional TODO_cleanup_cfg. (pass_thread_jumps::execute): Initialize loops, perform a CFG diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index 20476d7..487b91d 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -1497,7 +1497,7 @@ has_preds_from_loop (basic_block block, struct loop *loop) basic_block create_preheader (struct loop *loop, int flags) { - edge e, fallthru; + edge e; basic_block dummy; int nentry = 0; bool irred = false; @@ -1544,9 +1544,14 @@ create_preheader (struct loop *loop, int flags) mfb_kj_edge = loop_latch_edge (loop); latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0; - fallthru = make_forwarder_block (loop->header, mfb_keep_just, NULL); - dummy = fallthru->src; - loop->header = fallthru->dest; + if (nentry == 1) + dummy = split_edge (single_entry); + else + { + edge fallthru = make_forwarder_block (loop->header, mfb_keep_just, NULL); + dummy = fallthru->src; + loop->header = fallthru->dest; + } /* Try to be clever in placing the newly created preheader. The idea is to avoid breaking any "fallthruness" relationship between blocks. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7bca99a..00cdc8f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-08-11 Richard Biener <rguenther@suse.de> + + PR tree-optimization/72772 + * gcc.dg/graphite/pr35356-1.c: Adjust. + * gcc.dg/tree-ssa/pr59597.c: Likewise. + 2016-08-11 Janne Blomqvist <jb@gcc.gnu.org> * gfortran.dg/random_7.f90: Take into account that the last seed diff --git a/gcc/testsuite/gcc.dg/graphite/pr35356-1.c b/gcc/testsuite/gcc.dg/graphite/pr35356-1.c index 649302b..9b633d2 100644 --- a/gcc/testsuite/gcc.dg/graphite/pr35356-1.c +++ b/gcc/testsuite/gcc.dg/graphite/pr35356-1.c @@ -34,4 +34,4 @@ if (n >= k + 1 && k >= 0) { */ -/* { dg-final { scan-tree-dump "if \\\(P_9 >= P_10 \\\+ 1 && P_10 >= 0\\\) \\\{" "graphite" } } */ +/* { dg-final { scan-tree-dump "if \\\(P_8 >= P_9 \\\+ 1 && P_9 >= 0\\\) \\\{" "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c index b776016..4ac12c8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c @@ -54,5 +54,6 @@ main (int argc, char argv[]) return crc; } -/* { dg-final { scan-tree-dump "Cancelling" "vrp1" } } */ - +/* { dg-final { scan-tree-dump-times "Registering jump thread" 3 "vrp1" } } */ +/* { dg-final { scan-tree-dump-not "joiner" "vrp1" } } */ +/* { dg-final { scan-tree-dump-times "Threaded jump" 3 "vrp1" } } */ |