diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-17 02:31:56 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-17 02:31:56 +0000 |
commit | b3d6de8978fd2208885e98b19a91c9d29c170af5 (patch) | |
tree | 94c8895c6dde3b282518d4c9951067cd0ac517fd /gcc/local-alloc.c | |
parent | 5e7d465f337d9d419b2528ad819390067caeca95 (diff) | |
download | gcc-b3d6de8978fd2208885e98b19a91c9d29c170af5.tar.gz |
Revert "Basic block renumbering removal", and two followup patches.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53537 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r-- | gcc/local-alloc.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 860856c2ae0..cd216f96d0f 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -336,9 +336,8 @@ alloc_qty (regno, mode, size, birth) int local_alloc () { - int i; + int b, i; int max_qty; - basic_block b; /* We need to keep track of whether or not we recorded a LABEL_REF so that we know if the jump optimizer needs to be rerun. */ @@ -395,7 +394,7 @@ local_alloc () /* Allocate each block's local registers, block by block. */ - FOR_ALL_BB (b) + for (b = 0; b < n_basic_blocks; b++) { /* NEXT_QTY indicates which elements of the `qty_...' vectors might need to be initialized because they were used @@ -427,7 +426,7 @@ local_alloc () next_qty = 0; - block_alloc (b->sindex); + block_alloc (b); } free (qty); @@ -816,7 +815,7 @@ static void update_equiv_regs () { rtx insn; - basic_block bb; + int block; int loop_depth; regset_head cleared_regs; int clear_regnos = 0; @@ -829,8 +828,9 @@ update_equiv_regs () /* Scan the insns and find which registers have equivalences. Do this in a separate scan of the insns because (due to -fcse-follow-jumps) a register can be set below its use. */ - FOR_ALL_BB (bb) + for (block = 0; block < n_basic_blocks; block++) { + basic_block bb = BASIC_BLOCK (block); loop_depth = bb->loop_depth; for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn)) @@ -1044,8 +1044,10 @@ update_equiv_regs () within the same loop (or in an inner loop), then move the register initialization just before the use, so that they are in the same basic block. */ - FOR_ALL_BB_REVERSE (bb) + for (block = n_basic_blocks - 1; block >= 0; block--) { + basic_block bb = BASIC_BLOCK (block); + loop_depth = bb->loop_depth; for (insn = bb->end; insn != PREV_INSN (bb->head); insn = PREV_INSN (insn)) { @@ -1137,12 +1139,12 @@ update_equiv_regs () XEXP (reg_equiv[regno].init_insns, 0) = new_insn; - REG_BASIC_BLOCK (regno) = bb->sindex; + REG_BASIC_BLOCK (regno) = block >= 0 ? block : 0; REG_N_CALLS_CROSSED (regno) = 0; REG_LIVE_LENGTH (regno) = 2; - if (insn == bb->head) - bb->head = PREV_INSN (insn); + if (block >= 0 && insn == BLOCK_HEAD (block)) + BLOCK_HEAD (block) = PREV_INSN (insn); /* Remember to clear REGNO from all basic block's live info. */ @@ -1157,22 +1159,24 @@ update_equiv_regs () /* Clear all dead REGNOs from all basic block's live info. */ if (clear_regnos) { - int j; + int j, l; if (clear_regnos > 8) { - FOR_ALL_BB (bb) + for (l = 0; l < n_basic_blocks; l++) { - AND_COMPL_REG_SET (bb->global_live_at_start, &cleared_regs); - AND_COMPL_REG_SET (bb->global_live_at_end, &cleared_regs); + AND_COMPL_REG_SET (BASIC_BLOCK (l)->global_live_at_start, + &cleared_regs); + AND_COMPL_REG_SET (BASIC_BLOCK (l)->global_live_at_end, + &cleared_regs); } } else EXECUTE_IF_SET_IN_REG_SET (&cleared_regs, 0, j, { - FOR_ALL_BB (bb) + for (l = 0; l < n_basic_blocks; l++) { - CLEAR_REGNO_REG_SET (bb->global_live_at_start, j); - CLEAR_REGNO_REG_SET (bb->global_live_at_end, j); + CLEAR_REGNO_REG_SET (BASIC_BLOCK (l)->global_live_at_start, j); + CLEAR_REGNO_REG_SET (BASIC_BLOCK (l)->global_live_at_end, j); } }); } |