summaryrefslogtreecommitdiff
path: root/gcc/reg-stack.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-17 02:31:56 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-17 02:31:56 +0000
commitb3d6de8978fd2208885e98b19a91c9d29c170af5 (patch)
tree94c8895c6dde3b282518d4c9951067cd0ac517fd /gcc/reg-stack.c
parent5e7d465f337d9d419b2528ad819390067caeca95 (diff)
downloadgcc-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/reg-stack.c')
-rw-r--r--gcc/reg-stack.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 02fef8f5b12..3e1a756d473 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -418,8 +418,8 @@ reg_to_stack (first, file)
rtx first;
FILE *file;
{
- basic_block bb;
- int max_uid, i;
+ int i;
+ int max_uid;
/* Clean up previous run. */
if (stack_regs_mentioned_data)
@@ -451,9 +451,10 @@ reg_to_stack (first, file)
/* Set up block info for each basic block. */
alloc_aux_for_blocks (sizeof (struct block_info_def));
- FOR_ALL_BB_REVERSE (bb)
+ for (i = n_basic_blocks - 1; i >= 0; --i)
{
edge e;
+ basic_block bb = BASIC_BLOCK (i);
for (e = bb->pred; e; e=e->pred_next)
if (!(e->flags & EDGE_DFS_BACK)
&& e->src != ENTRY_BLOCK_PTR)
@@ -2381,12 +2382,12 @@ print_stack (file, s)
static int
convert_regs_entry ()
{
- int inserted = 0;
+ int inserted = 0, i;
edge e;
- basic_block block;
- FOR_ALL_BB_REVERSE (block)
+ for (i = n_basic_blocks - 1; i >= 0; --i)
{
+ basic_block block = BASIC_BLOCK (i);
block_info bi = BLOCK_INFO (block);
int reg;
@@ -2490,7 +2491,7 @@ compensate_edge (e, file)
current_block = block;
regstack = bi->stack_out;
if (file)
- fprintf (file, "Edge %d->%d: ", block->sindex, target->sindex);
+ fprintf (file, "Edge %d->%d: ", block->index, target->index);
if (target_stack->top == -2)
{
@@ -2650,7 +2651,7 @@ convert_regs_1 (file, block)
if (EDGE_CRITICAL_P (e))
beste = e;
}
- else if (e->src->sindex < beste->src->sindex)
+ else if (e->src->index < beste->src->index)
beste = e;
}
@@ -2664,7 +2665,7 @@ convert_regs_1 (file, block)
if (file)
{
- fprintf (file, "\nBasic block %d\nInput stack: ", block->sindex);
+ fprintf (file, "\nBasic block %d\nInput stack: ", block->index);
print_stack (file, &bi->stack_in);
}
@@ -2779,7 +2780,7 @@ convert_regs_2 (file, block)
basic_block *stack, *sp;
int inserted;
- stack = (basic_block *) xmalloc (sizeof (*stack) * num_basic_blocks);
+ stack = (basic_block *) xmalloc (sizeof (*stack) * n_basic_blocks);
sp = stack;
*sp++ = block;
@@ -2814,8 +2815,7 @@ static int
convert_regs (file)
FILE *file;
{
- int inserted;
- basic_block b;
+ int inserted, i;
edge e;
/* Initialize uninitialized registers on function entry. */
@@ -2835,8 +2835,9 @@ convert_regs (file)
/* ??? Process all unreachable blocks. Though there's no excuse
for keeping these even when not optimizing. */
- FOR_ALL_BB (b)
+ for (i = 0; i < n_basic_blocks; ++i)
{
+ basic_block b = BASIC_BLOCK (i);
block_info bi = BLOCK_INFO (b);
if (! bi->done)