aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-10-16 10:13:52 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-10-16 10:13:52 +0000
commit93a95abe925edc98131056a6b716e7a9e15f72cc (patch)
tree20fc664da392c7860ee5505c631575ae25f7fc13 /gcc/tree-cfg.c
parent0c49f2ed839ba727b236e97e5be03239fd81256c (diff)
downloadgcc-93a95abe925edc98131056a6b716e7a9e15f72cc.zip
gcc-93a95abe925edc98131056a6b716e7a9e15f72cc.tar.gz
gcc-93a95abe925edc98131056a6b716e7a9e15f72cc.tar.bz2
re PR tree-optimization/63168 (loop header copying fails - not vectorized: latch block not empty)
2014-10-16 Richard Biener <rguenther@suse.de> PR tree-optimization/63168 * tree-cfg.c (gimple_can_merge_blocks_p): Only protect latches if after merging they are no longer simple. * cfghooks.c (merge_blocks): Handle merging a latch block into another block. * gcc.dg/tree-ssa/loop-40.c: New testcase. From-SVN: r216304
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index cdab639..ff72601 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1674,8 +1674,12 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
return false;
}
- /* Protect the loop latches. */
- if (current_loops && b->loop_father->latch == b)
+ /* Protect simple loop latches. We only want to avoid merging
+ the latch with the loop header in this case. */
+ if (current_loops
+ && b->loop_father->latch == b
+ && loops_state_satisfies_p (LOOPS_HAVE_SIMPLE_LATCHES)
+ && b->loop_father->header == a)
return false;
/* It must be possible to eliminate all phi nodes in B. If ssa form