if (dom_info_available_p (CDI_DOMINATORS))
{
- basic_block doms_to_fix[2];
-
- doms_to_fix[0] = dummy;
- doms_to_fix[1] = bb;
- iterate_fix_dominators (CDI_DOMINATORS, doms_to_fix, 2);
+ 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)
}
/* In case we split loop latch, update it. */
- for (ploop = loop; ploop; ploop = ploop->outer)
+ for (ploop = loop; ploop; ploop = loop_outer (ploop))
if (ploop->latch == dummy)
ploop->latch = bb;
}
set_bb_original (new_bb, bb);
set_bb_copy (bb, new_bb);
- /* Add the new block to the prescribed loop. */
+ /* Add the new block to the copy of the loop of BB, or directly to the loop
+ of BB if the loop is not being copied. */
if (current_loops != NULL)
- add_bb_to_loop (new_bb, bb->loop_father->copy);
+ {
+ struct loop *cloop = bb->loop_father;
+ struct loop *copy = get_loop_copy (cloop);
+ add_bb_to_loop (new_bb, copy ? copy : cloop);
+ }
return new_bb;
}