memset (tick, 0, sizeof tick);
gcc_obstack_init (&rename_obstack);
- first_obj = (char *) obstack_alloc (&rename_obstack, 0);
+ first_obj = obstack_alloc (&rename_obstack, 0);
FOR_EACH_BB (bb)
{
CLEAR_HARD_REG_SET (regs_seen);
while (all_chains)
{
- int new_reg, best_new_reg = -1;
+ int new_reg, best_new_reg;
int n_uses;
struct du_chain *this = all_chains;
struct du_chain *tmp, *last;
all_chains = this->next_chain;
+ best_new_reg = reg;
+
#if 0 /* This just disables optimization opportunities. */
/* Only rename once we've seen the reg more than once. */
if (! TEST_HARD_REG_BIT (regs_seen, reg))
break;
if (! tmp)
{
- if (best_new_reg == -1
- || tick[best_new_reg] > tick[new_reg])
+ if (tick[best_new_reg] > tick[new_reg])
best_new_reg = new_reg;
}
}
fprintf (rtl_dump_file, " crosses a call");
}
- if (best_new_reg == -1)
+ if (best_new_reg == reg)
{
+ tick[reg] = ++this_tick;
if (rtl_dump_file)
- fprintf (rtl_dump_file, "; no available registers\n");
+ fprintf (rtl_dump_file, "; no available better choice\n");
continue;
}
do_replace (this, best_new_reg);
- tick[best_new_reg] = this_tick++;
+ tick[best_new_reg] = ++this_tick;
if (rtl_dump_file)
fprintf (rtl_dump_file, ", renamed as %s\n", reg_names[best_new_reg]);
{
if (type == OP_OUT)
{
- struct du_chain *this = (struct du_chain *)
- obstack_alloc (&rename_obstack, sizeof (struct du_chain));
+ struct du_chain *this
+ = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0;
this->next_chain = open_chains;
this->loc = loc;
be replaced with, terminate the chain. */
if (class != NO_REGS)
{
- this = (struct du_chain *)
- obstack_alloc (&rename_obstack, sizeof (struct du_chain));
+ this = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0;
this->next_chain = (*p)->next_chain;
this->loc = loc;
/* 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. */
+ /* ??? Ought to use more intelligent queuing of blocks. */
if (bb->pred)
for (bbp = bb; bbp && bbp != bb->pred->src; bbp = bbp->prev_bb);
if (bb->pred