{
tree stmt = bsi_stmt (*from);
bsi_remove (from, false);
- bsi_insert_after (to, stmt, BSI_SAME_STMT);
+ /* We must have BSI_NEW_STMT here, as bsi_move_after is sometimes used to
+ move statements to an empty block. */
+ bsi_insert_after (to, stmt, BSI_NEW_STMT);
}
{
tree stmt = bsi_stmt (*from);
bsi_remove (from, false);
+ /* For consistency with bsi_move_after, it might be better to have
+ BSI_NEW_STMT here; however, that breaks several places that expect
+ that TO does not change. */
bsi_insert_before (to, stmt, BSI_SAME_STMT);
}
}
}
- if (dom_computed[CDI_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ if (dom_info_state (CDI_DOMINATORS) >= DOM_NO_FAST_QUERY)
verify_dominators (CDI_DOMINATORS);
return err;
basic_block bb = e->src;
block_stmt_iterator bsi;
edge ret;
- tree label, stmt;
+ tree stmt;
if (e->flags & EDGE_ABNORMAL)
return NULL;
if (e->dest == dest)
return NULL;
- label = tree_block_label (dest);
-
bsi = bsi_last (bb);
stmt = bsi_end_p (bsi) ? NULL : bsi_stmt (bsi);
case SWITCH_EXPR:
{
tree cases = get_cases_for_edge (e, stmt);
+ tree label = tree_block_label (dest);
/* If we have a list of cases associated with E, then use it
as it's a lot faster than walking the entire case vector. */
basic_block *region, unsigned n_region,
basic_block *region_copy)
{
- unsigned i, n_doms;
+ unsigned i;
bool free_region_copy = false, copying_header = false;
struct loop *loop = entry->dest->loop_father;
edge exit_copy;
- basic_block *doms;
+ VEC (basic_block, heap) *doms;
edge redirected;
int total_freq = 0, entry_freq = 0;
gcov_type total_count = 0, entry_count = 0;
return false;
}
- loop->copy = loop;
+ set_loop_copy (loop, loop);
/* In case the function is used for loop header copying (which is the primary
use), ensure that EXIT and its copy will be new latch and entry edges. */
if (loop->header == entry->dest)
{
copying_header = true;
- loop->copy = loop->outer;
+ set_loop_copy (loop, loop_outer (loop));
if (!dominated_by_p (CDI_DOMINATORS, loop->latch, exit->src))
return false;
/* Record blocks outside the region that are dominated by something
inside. */
- doms = XNEWVEC (basic_block, n_basic_blocks);
+ doms = NULL;
initialize_original_copy_tables ();
- n_doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region, doms);
+ doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region);
if (entry->dest->count)
{
region, but was dominated by something inside needs recounting as
well. */
set_immediate_dominator (CDI_DOMINATORS, entry->dest, entry->src);
- doms[n_doms++] = get_bb_original (entry->dest);
- iterate_fix_dominators (CDI_DOMINATORS, doms, n_doms);
+ VEC_safe_push (basic_block, heap, doms, get_bb_original (entry->dest));
+ iterate_fix_dominators (CDI_DOMINATORS, doms, false);
free (doms);
/* Add the other PHI node arguments. */
}
VEC_replace (basic_block, cfg->x_basic_block_info,
- cfg->x_last_basic_block, bb);
+ bb->index, bb);
/* The statements in BB need to be associated with a new TREE_BLOCK.
Labels need to be associated with a new label-to-block map. */
basic_block bb, dbb;
bitmap_iterator bi;
- if (!dom_computed[CDI_DOMINATORS])
+ if (!dom_info_available_p (CDI_DOMINATORS))
{
remove_edge (e);
return;
VEC_safe_push (basic_block, heap, bbs_to_fix_dom, dbb);
}
- iterate_fix_dominators (CDI_DOMINATORS,
- VEC_address (basic_block, bbs_to_fix_dom),
- VEC_length (basic_block, bbs_to_fix_dom));
+ iterate_fix_dominators (CDI_DOMINATORS, bbs_to_fix_dom, true);
BITMAP_FREE (df);
BITMAP_FREE (df_idom);