Commit 183ac6d0 by Richard Biener Committed by Richard Biener

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
parent b152f5a2
2016-08-11 Richard Biener <rguenther@suse.de> 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 * tree-ssa-threadbackward.c (pass_data_thread_jumps): Remove
unconditional TODO_cleanup_cfg. unconditional TODO_cleanup_cfg.
(pass_thread_jumps::execute): Initialize loops, perform a CFG (pass_thread_jumps::execute): Initialize loops, perform a CFG
......
...@@ -1497,7 +1497,7 @@ has_preds_from_loop (basic_block block, struct loop *loop) ...@@ -1497,7 +1497,7 @@ has_preds_from_loop (basic_block block, struct loop *loop)
basic_block basic_block
create_preheader (struct loop *loop, int flags) create_preheader (struct loop *loop, int flags)
{ {
edge e, fallthru; edge e;
basic_block dummy; basic_block dummy;
int nentry = 0; int nentry = 0;
bool irred = false; bool irred = false;
...@@ -1544,9 +1544,14 @@ create_preheader (struct loop *loop, int flags) ...@@ -1544,9 +1544,14 @@ create_preheader (struct loop *loop, int flags)
mfb_kj_edge = loop_latch_edge (loop); mfb_kj_edge = loop_latch_edge (loop);
latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0; latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0;
fallthru = make_forwarder_block (loop->header, mfb_keep_just, NULL); if (nentry == 1)
dummy = fallthru->src; dummy = split_edge (single_entry);
loop->header = fallthru->dest; 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 /* Try to be clever in placing the newly created preheader. The idea is to
avoid breaking any "fallthruness" relationship between blocks. avoid breaking any "fallthruness" relationship between blocks.
......
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> 2016-08-11 Janne Blomqvist <jb@gcc.gnu.org>
* gfortran.dg/random_7.f90: Take into account that the last seed * gfortran.dg/random_7.f90: Take into account that the last seed
......
...@@ -34,4 +34,4 @@ if (n >= k + 1 && k >= 0) { ...@@ -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" } } */
...@@ -54,5 +54,6 @@ main (int argc, char argv[]) ...@@ -54,5 +54,6 @@ main (int argc, char argv[])
return crc; 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment