This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to fix register allocation bug


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 ;-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]