+ VEC (basic_block, heap) *doms_to_fix = VEC_alloc (basic_block, heap, 2);
+ VEC_quick_push (basic_block, doms_to_fix, dummy);
+ VEC_quick_push (basic_block, doms_to_fix, bb);
+ iterate_fix_dominators (CDI_DOMINATORS, doms_to_fix, false);
+ VEC_free (basic_block, heap, doms_to_fix);
+ }
+
+ if (current_loops != NULL)
+ {
+ /* 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. 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);
+ loop->header = bb;
+
+ cloop = loop;
+ FOR_EACH_EDGE (e, ei, dummy->preds)
+ {
+ cloop = find_common_loop (cloop, e->src->loop_father);
+ }
+ add_bb_to_loop (dummy, cloop);
+ }