summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 9415728d630..bdb130ca055 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -192,8 +192,8 @@ static HARD_REG_SET newpat_used_regs;
static rtx added_links_insn;
-/* Basic block number of the block in which we are performing combines. */
-static int this_basic_block;
+/* Basic block in which we are performing combines. */
+static basic_block this_basic_block;
/* A bitmap indicating which blocks had registers go dead at entry.
After combine, we'll need to re-do global life analysis with
@@ -610,7 +610,7 @@ combine_instructions (f, nregs)
/* Now scan all the insns in forward order. */
- this_basic_block = -1;
+ this_basic_block = ENTRY_BLOCK_PTR;
label_tick = 1;
last_call_cuid = 0;
mem_last_set = 0;
@@ -622,9 +622,9 @@ combine_instructions (f, nregs)
next = 0;
/* If INSN starts a new basic block, update our basic block number. */
- if (this_basic_block + 1 < n_basic_blocks
- && BLOCK_HEAD (this_basic_block + 1) == insn)
- this_basic_block++;
+ if (this_basic_block->next_bb != EXIT_BLOCK_PTR
+ && this_basic_block->next_bb->head == insn)
+ this_basic_block = this_basic_block->next_bb;
if (GET_CODE (insn) == CODE_LABEL)
label_tick++;
@@ -741,8 +741,8 @@ combine_instructions (f, nregs)
}
clear_bb_flags ();
- EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, this_basic_block,
- BASIC_BLOCK (this_basic_block)->flags |= BB_DIRTY);
+ EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, i,
+ BASIC_BLOCK (i)->flags |= BB_DIRTY);
new_direct_jump_p |= purge_all_dead_edges (0);
delete_noop_moves (f);
@@ -860,7 +860,7 @@ set_nonzero_bits_and_sign_copies (x, set, data)
&& REGNO (x) >= FIRST_PSEUDO_REGISTER
/* If this register is undefined at the start of the file, we can't
say what its contents were. */
- && ! REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start, REGNO (x))
+ && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, REGNO (x))
&& GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT)
{
if (set == 0 || GET_CODE (set) == CLOBBER)
@@ -2388,8 +2388,8 @@ try_combine (i3, i2, i1, new_direct_jump_p)
which we know will be a NOTE. */
for (insn = NEXT_INSN (i3);
- insn && (this_basic_block == n_basic_blocks - 1
- || insn != BLOCK_HEAD (this_basic_block + 1));
+ insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR
+ || insn != this_basic_block->next_bb->head);
insn = NEXT_INSN (insn))
{
if (INSN_P (insn) && reg_referenced_p (ni2dest, PATTERN (insn)))
@@ -2606,8 +2606,8 @@ try_combine (i3, i2, i1, new_direct_jump_p)
&& ! find_reg_note (i2, REG_UNUSED,
SET_DEST (XVECEXP (PATTERN (i2), 0, i))))
for (temp = NEXT_INSN (i2);
- temp && (this_basic_block == n_basic_blocks - 1
- || BLOCK_HEAD (this_basic_block) != temp);
+ temp && (this_basic_block->next_bb == EXIT_BLOCK_PTR
+ || this_basic_block->head != temp);
temp = NEXT_INSN (temp))
if (temp != i3 && INSN_P (temp))
for (link = LOG_LINKS (temp); link; link = XEXP (link, 1))
@@ -8068,7 +8068,7 @@ nonzero_bits (x, mode)
&& (reg_last_set_label[REGNO (x)] == label_tick
|| (REGNO (x) >= FIRST_PSEUDO_REGISTER
&& REG_N_SETS (REGNO (x)) == 1
- && ! REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start,
+ && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start,
REGNO (x))))
&& INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
return reg_last_set_nonzero_bits[REGNO (x)] & nonzero;
@@ -8483,7 +8483,7 @@ num_sign_bit_copies (x, mode)
&& (reg_last_set_label[REGNO (x)] == label_tick
|| (REGNO (x) >= FIRST_PSEUDO_REGISTER
&& REG_N_SETS (REGNO (x)) == 1
- && ! REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start,
+ && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start,
REGNO (x))))
&& INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
return reg_last_set_sign_bit_copies[REGNO (x)];
@@ -11492,7 +11492,7 @@ get_last_value_validate (loc, insn, tick, replace)
|| (! (regno >= FIRST_PSEUDO_REGISTER
&& REG_N_SETS (regno) == 1
&& (! REGNO_REG_SET_P
- (BASIC_BLOCK (0)->global_live_at_start, regno)))
+ (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno)))
&& reg_last_set_label[j] > tick))
{
if (replace)
@@ -11566,7 +11566,7 @@ get_last_value (x)
&& (regno < FIRST_PSEUDO_REGISTER
|| REG_N_SETS (regno) != 1
|| (REGNO_REG_SET_P
- (BASIC_BLOCK (0)->global_live_at_start, regno)))))
+ (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno)))))
return 0;
/* If the value was set in a later insn than the ones we are processing,
@@ -12375,7 +12375,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (place == 0)
{
- basic_block bb = BASIC_BLOCK (this_basic_block);
+ basic_block bb = this_basic_block;
for (tem = PREV_INSN (i3); place == 0; tem = PREV_INSN (tem))
{
@@ -12519,7 +12519,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
&& REGNO_REG_SET_P (bb->global_live_at_start,
REGNO (XEXP (note, 0))))
{
- SET_BIT (refresh_blocks, this_basic_block);
+ SET_BIT (refresh_blocks, this_basic_block->index);
need_refresh = 1;
}
}
@@ -12539,7 +12539,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
after we remove them in delete_noop_moves. */
if (noop_move_p (place))
{
- SET_BIT (refresh_blocks, this_basic_block);
+ SET_BIT (refresh_blocks, this_basic_block->index);
need_refresh = 1;
}
@@ -12589,7 +12589,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
i += HARD_REGNO_NREGS (i, reg_raw_mode[i]))
{
rtx piece = gen_rtx_REG (reg_raw_mode[i], i);
- basic_block bb = BASIC_BLOCK (this_basic_block);
+ basic_block bb = this_basic_block;
if (! dead_or_set_p (place, piece)
&& ! reg_bitfield_target_p (piece,
@@ -12612,7 +12612,7 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (tem == bb->head)
{
SET_BIT (refresh_blocks,
- this_basic_block);
+ this_basic_block->index);
need_refresh = 1;
break;
}
@@ -12717,8 +12717,8 @@ distribute_links (links)
since most links don't point very far away. */
for (insn = NEXT_INSN (XEXP (link, 0));
- (insn && (this_basic_block == n_basic_blocks - 1
- || BLOCK_HEAD (this_basic_block + 1) != insn));
+ (insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR
+ || this_basic_block->next_bb->head != insn));
insn = NEXT_INSN (insn))
if (INSN_P (insn) && reg_overlap_mentioned_p (reg, PATTERN (insn)))
{