diff options
author | Richard Biener <rguenther@suse.de> | 2014-10-16 10:13:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-10-16 10:13:52 +0000 |
commit | 93a95abe925edc98131056a6b716e7a9e15f72cc (patch) | |
tree | 20fc664da392c7860ee5505c631575ae25f7fc13 /gcc/cfghooks.c | |
parent | 0c49f2ed839ba727b236e97e5be03239fd81256c (diff) | |
download | gcc-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/cfghooks.c')
-rw-r--r-- | gcc/cfghooks.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index fa18214..09c7f6d 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); } |