This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to fix register allocation bug
- From: Michael Matz <matz at suse dot de>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Nov 2002 15:08:34 +0100 (CET)
- Subject: Re: Patch to fix register allocation bug
Hi,
On 18 Nov 2002, Richard Sandiford wrote:
> > - allocno[num].size = PSEUDO_REGNO_SIZE (i);
> > + if (reg_renumber[i] >= 0)
> > + allocno[num].size = HARD_REGNO_NREGS (reg_renumber[i],
> > + PSEUDO_REGNO_MODE (i));
> > + else
> > + allocno[num].size = PSEUDO_REGNO_SIZE (i);
> > allocno[num].calls_crossed += REG_N_CALLS_CROSSED (i);
> > allocno[num].n_refs += REG_N_REFS (i);
> > allocno[num].freq += REG_FREQ (i);
>
> 'Fraid not. The point is that 'i' hasn't been allocated by the
> time we reach the code I patched, so reg_renumber[i] is still -1.
Ahh crap. I wasn't thinking straight, sorry. I mixed the not yet
allocated with the locally allocated in my head, and thought the error was
the wrong setting of the .size of the former.
I now think for a hot fix it's good enough (but I've no karma). The right
one would be to teach it about multi-reg pseudos, but well, that would
need a loop to cumulate the costs of all parts and it's not clear this is
worth anything ;-)
Ciao,
Michael.