aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-08-05 07:41:45 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-08-05 07:41:45 +0000
commitee2810081e4008656ffb5a2f37a5a68d5d477e7e (patch)
treeb9d764e969d86420c6267f8ab69fb903a75890df /gcc/cfghooks.c
parent343092cfa239bfc3b620b473efa3cabda19ea7b6 (diff)
downloadgcc-ee2810081e4008656ffb5a2f37a5a68d5d477e7e.zip
gcc-ee2810081e4008656ffb5a2f37a5a68d5d477e7e.tar.gz
gcc-ee2810081e4008656ffb5a2f37a5a68d5d477e7e.tar.bz2
tree-cfgcleanup.c (tree_forwarder_block_p): Use bb_loop_header_p.
2016-08-05 Richard Biener <rguenther@suse.de> * tree-cfgcleanup.c (tree_forwarder_block_p): Use bb_loop_header_p. * cfghooks.c (force_nonfallthru): If we ended up splitting a latch adjust loop info accordingly. From-SVN: r239163
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r--gcc/cfghooks.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 06c05d1..4a6fcbf 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -1030,11 +1030,17 @@ force_nonfallthru (edge e)
if (current_loops != NULL)
{
+ basic_block pred = single_pred (ret);
+ basic_block succ = single_succ (ret);
struct loop *loop
- = find_common_loop (single_pred (ret)->loop_father,
- single_succ (ret)->loop_father);
+ = find_common_loop (pred->loop_father, succ->loop_father);
rescan_loop_exit (e, false, true);
add_bb_to_loop (ret, loop);
+
+ /* If we split the latch edge of loop adjust the latch block. */
+ if (loop->latch == pred
+ && loop->header == succ)
+ loop->latch = ret;
}
}