diff options
Diffstat (limited to 'gcc/cfghooks.c')
-rw-r--r-- | gcc/cfghooks.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index d65cce98fa9..1fa3aa76498 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -378,6 +378,10 @@ redirect_edge_and_branch_force (edge e, basic_block dest) rescan_loop_exit (e, false, true); ret = cfg_hooks->redirect_edge_and_branch_force (e, dest); + if (ret != NULL + && dom_info_available_p (CDI_DOMINATORS)) + set_immediate_dominator (CDI_DOMINATORS, ret, src); + if (current_loops != NULL) { if (ret != NULL) @@ -724,7 +728,8 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge), fallthru->count = 0; jump = redirect_edge_and_branch_force (e, bb); - if (jump) + if (jump != NULL + && new_bb_cbk != NULL) new_bb_cbk (jump); } @@ -742,9 +747,12 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge), /* If we do not split a loop header, then both blocks belong to the same loop. In case we split loop header and do not redirect the latch edge to DUMMY, then DUMMY belongs to the outer loop, and - BB becomes the new header. */ + BB becomes the new header. If latch is not recorded for the loop, + we leave this updating on the caller (this may only happen during + loop analysis). */ loop = dummy->loop_father; if (loop->header == dummy + && loop->latch != NULL && find_edge (loop->latch, dummy) == NULL) { remove_bb_from_loops (dummy); |