From 0b17ab2f5b1184fdb568786f791bc0613e574241 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 16 May 2002 19:31:56 -0700 Subject: Revert "Basic block renumbering removal", and two followup patches. From-SVN: r53537 --- gcc/regrename.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'gcc/regrename.c') diff --git a/gcc/regrename.c b/gcc/regrename.c index 421a7bb5..4297da7 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -201,7 +201,7 @@ regrename_optimize () { int tick[FIRST_PSEUDO_REGISTER]; int this_tick = 0; - basic_block bb; + int b; char *first_obj; memset (tick, 0, sizeof tick); @@ -209,8 +209,9 @@ regrename_optimize () gcc_obstack_init (&rename_obstack); first_obj = (char *) obstack_alloc (&rename_obstack, 0); - FOR_ALL_BB (bb) + for (b = 0; b < n_basic_blocks; b++) { + basic_block bb = BASIC_BLOCK (b); struct du_chain *all_chains = 0; HARD_REG_SET unavailable; HARD_REG_SET regs_seen; @@ -218,7 +219,7 @@ regrename_optimize () CLEAR_HARD_REG_SET (unavailable); if (rtl_dump_file) - fprintf (rtl_dump_file, "\nBasic block %d:\n", bb->sindex); + fprintf (rtl_dump_file, "\nBasic block %d:\n", b); all_chains = build_def_use (bb); @@ -1725,30 +1726,30 @@ copyprop_hardreg_forward () { struct value_data *all_vd; bool need_refresh; - basic_block bb, bbp; + int b; need_refresh = false; - all_vd = xmalloc (sizeof (struct value_data) * last_basic_block); + all_vd = xmalloc (sizeof (struct value_data) * n_basic_blocks); - FOR_ALL_BB (bb) + for (b = 0; b < n_basic_blocks; b++) { + basic_block bb = BASIC_BLOCK (b); + /* If a block has a single predecessor, that we've already processed, begin with the value data that was live at the end of the predecessor block. */ /* ??? Ought to use more intelligent queueing of blocks. */ - if (bb->pred) - for (bbp = bb; bbp && bbp != bb->pred->src; bbp = bbp->prev_bb); if (bb->pred && ! bb->pred->pred_next && ! (bb->pred->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)) - && bb->pred->src != ENTRY_BLOCK_PTR - && bbp) - all_vd[bb->sindex] = all_vd[bb->pred->src->sindex]; + && bb->pred->src->index != ENTRY_BLOCK + && bb->pred->src->index < b) + all_vd[b] = all_vd[bb->pred->src->index]; else - init_value_data (all_vd + bb->sindex); + init_value_data (all_vd + b); - if (copyprop_hardreg_forward_1 (bb, all_vd + bb->sindex)) + if (copyprop_hardreg_forward_1 (bb, all_vd + b)) need_refresh = true; } -- cgit v1.1