Commit 2feb9704 by Bernd Schmidt Committed by Bernd Schmidt

Bugfix in order_regs_for_reload

From-SVN: r29455
parent 7402eca0
Thu Sep 16 10:53:36 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* reload1.c (order_regs_for_reload): Move hard_reg_n_uses
computation out of loop over hard regs.
Wed Sep 15 21:37:06 1999 Mark Mitchell <mark@codesourcery.com> Wed Sep 15 21:37:06 1999 Mark Mitchell <mark@codesourcery.com>
* function.c (identify_blocks): Don't shadow a variable in an * function.c (identify_blocks): Don't shadow a variable in an
......
...@@ -4109,44 +4109,35 @@ order_regs_for_reload (chain) ...@@ -4109,44 +4109,35 @@ order_regs_for_reload (chain)
COPY_HARD_REG_SET (bad_spill_regs, bad_spill_regs_global); COPY_HARD_REG_SET (bad_spill_regs, bad_spill_regs_global);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
hard_reg_n_uses[i].regno = i;
hard_reg_n_uses[i].uses = 0;
}
/* Count number of uses of each hard reg by pseudo regs allocated to it /* Count number of uses of each hard reg by pseudo regs allocated to it
and then order them by decreasing use. */ and then order them by decreasing use. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{ {
int j; hard_reg_n_uses[i].regno = i;
hard_reg_n_uses[i].uses = 0;
/* Test the various reasons why we can't use a register for /* Test the various reasons why we can't use a register for
spilling in this insn. */ spilling in this insn. */
if (fixed_regs[i] if (fixed_regs[i]
|| REGNO_REG_SET_P (chain->live_before, i) || REGNO_REG_SET_P (chain->live_before, i)
|| REGNO_REG_SET_P (chain->live_after, i)) || REGNO_REG_SET_P (chain->live_after, i))
{
SET_HARD_REG_BIT (bad_spill_regs, i); SET_HARD_REG_BIT (bad_spill_regs, i);
continue;
} }
/* Now find out which pseudos are allocated to it, and update /* Now compute hard_reg_n_uses. */
hard_reg_n_uses. */
CLEAR_REG_SET (pseudos_counted); CLEAR_REG_SET (pseudos_counted);
EXECUTE_IF_SET_IN_REG_SET EXECUTE_IF_SET_IN_REG_SET
(chain->live_before, FIRST_PSEUDO_REGISTER, j, (chain->live_before, FIRST_PSEUDO_REGISTER, i,
{ {
count_pseudo (hard_reg_n_uses, j); count_pseudo (hard_reg_n_uses, i);
}); });
EXECUTE_IF_SET_IN_REG_SET EXECUTE_IF_SET_IN_REG_SET
(chain->live_after, FIRST_PSEUDO_REGISTER, j, (chain->live_after, FIRST_PSEUDO_REGISTER, i,
{ {
count_pseudo (hard_reg_n_uses, j); count_pseudo (hard_reg_n_uses, i);
}); });
}
FREE_REG_SET (pseudos_counted); FREE_REG_SET (pseudos_counted);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment