diff options
Diffstat (limited to 'gcc/mode-switching.c')
-rw-r--r-- | gcc/mode-switching.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c index ed45094c395..4f68536d622 100644 --- a/gcc/mode-switching.c +++ b/gcc/mode-switching.c @@ -480,7 +480,8 @@ optimize_mode_switching (void) entry_exit_extra = 3; #endif bb_info[n_entities] - = XCNEWVEC (struct bb_info, last_basic_block + entry_exit_extra); + = XCNEWVEC (struct bb_info, + last_basic_block_for_fn (cfun) + entry_exit_extra); entity_map[n_entities++] = e; if (num_modes[e] > max_num_modes) max_num_modes = num_modes[e]; @@ -500,11 +501,11 @@ optimize_mode_switching (void) /* Create the bitmap vectors. */ - antic = sbitmap_vector_alloc (last_basic_block, n_entities); - transp = sbitmap_vector_alloc (last_basic_block, n_entities); - comp = sbitmap_vector_alloc (last_basic_block, n_entities); + antic = sbitmap_vector_alloc (last_basic_block_for_fn (cfun), n_entities); + transp = sbitmap_vector_alloc (last_basic_block_for_fn (cfun), n_entities); + comp = sbitmap_vector_alloc (last_basic_block_for_fn (cfun), n_entities); - bitmap_vector_ones (transp, last_basic_block); + bitmap_vector_ones (transp, last_basic_block_for_fn (cfun)); for (j = n_entities - 1; j >= 0; j--) { @@ -515,7 +516,7 @@ optimize_mode_switching (void) /* Determine what the first use (if any) need for a mode of entity E is. This will be the mode that is anticipatable for this block. Also compute the initial transparency settings. */ - FOR_EACH_BB (bb) + FOR_EACH_BB_FN (bb, cfun) { struct seginfo *ptr; int last_mode = no_mode; @@ -608,7 +609,7 @@ optimize_mode_switching (void) #endif /* NORMAL_MODE */ } - kill = sbitmap_vector_alloc (last_basic_block, n_entities); + kill = sbitmap_vector_alloc (last_basic_block_for_fn (cfun), n_entities); for (i = 0; i < max_num_modes; i++) { int current_mode[N_ENTITIES]; @@ -616,14 +617,14 @@ optimize_mode_switching (void) sbitmap *insert; /* Set the anticipatable and computing arrays. */ - bitmap_vector_clear (antic, last_basic_block); - bitmap_vector_clear (comp, last_basic_block); + bitmap_vector_clear (antic, last_basic_block_for_fn (cfun)); + bitmap_vector_clear (comp, last_basic_block_for_fn (cfun)); for (j = n_entities - 1; j >= 0; j--) { int m = current_mode[j] = MODE_PRIORITY_TO_MODE (entity_map[j], i); struct bb_info *info = bb_info[j]; - FOR_EACH_BB (bb) + FOR_EACH_BB_FN (bb, cfun) { if (info[bb->index].seginfo->mode == m) bitmap_set_bit (antic[bb->index], j); @@ -636,7 +637,7 @@ optimize_mode_switching (void) /* Calculate the optimal locations for the placement mode switches to modes with priority I. */ - FOR_EACH_BB (bb) + FOR_EACH_BB_FN (bb, cfun) bitmap_not (kill[bb->index], transp[bb->index]); edge_list = pre_edge_lcm (n_entities, transp, comp, antic, kill, &insert, &del); @@ -691,7 +692,7 @@ optimize_mode_switching (void) insert_insn_on_edge (mode_set, eg); } - FOR_EACH_BB_REVERSE (bb) + FOR_EACH_BB_REVERSE_FN (bb, cfun) if (bitmap_bit_p (del[bb->index], j)) { make_preds_opaque (bb, j); @@ -711,7 +712,7 @@ optimize_mode_switching (void) { int no_mode = num_modes[entity_map[j]]; - FOR_EACH_BB_REVERSE (bb) + FOR_EACH_BB_REVERSE_FN (bb, cfun) { struct seginfo *ptr, *next; for (ptr = bb_info[j][bb->index].seginfo; ptr; ptr = next) |