summaryrefslogtreecommitdiff
path: root/gcc/cfghooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r--gcc/cfghooks.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 54f805f5ff9..5e3eeb587b5 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -761,7 +761,12 @@ merge_blocks (basic_block a, basic_block b)
{
e->src = a;
if (current_loops != NULL)
- rescan_loop_exit (e, true, false);
+ {
+ /* If b was a latch, a now is. */
+ if (e->dest->loop_father->latch == b)
+ e->dest->loop_father->latch = a;
+ rescan_loop_exit (e, true, false);
+ }
}
a->succs = b->succs;
a->flags |= b->flags;