summaryrefslogtreecommitdiff
path: root/gcc/cfghooks.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/cfghooks.c
parent0c49f2ed839ba727b236e97e5be03239fd81256c (diff)
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/cfghooks.c')
-rw-r--r--gcc/cfghooks.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index fa18214e1ff..09c7f6d6fe2 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -766,6 +766,11 @@ merge_blocks (basic_block a, basic_block b)
add_bb_to_loop (a, b->loop_father);
a->loop_father->header = a;
}
+ /* If we merge a loop latch into its predecessor, update the loop
+ structure. */
+ if (b->loop_father->latch
+ && b->loop_father->latch == b)
+ b->loop_father->latch = a;
remove_bb_from_loops (b);
}