[new-regalloc-branch] IR spilling, opti+ coal., incremental ...

Daniel Berlin dan@dberlin.org
Sat Jan 5 09:04:00 GMT 2002


On Sat, 5 Jan 2002, Michael Matz wrote:

> Hi,
> 
> On Fri, 4 Jan 2002, Daniel Berlin wrote:
> 
> > infinite loop in init_ra.
> 
> Phew.  A simple one ;)  Or not.
> 
> > If GET_MODE_SIZE (i) is 0, then hard_regno_mode_ok is okay, but
> > hard_regno_nregs is 0.
> 
> This seems extraordinary strange to me.  A sizeless mode which is Ok for
> some registers, but needing none of them.  Hmm.
VOIDMode and BLKMode, of course. It's okay for all registers, but needs 
none of them.
They fit anywhere, since they take 0 registers.

> 
> > Would you rather i fix hard_regno_mode_ok to say these modes are not okay
> > for anything, or just add a GET_MODE_SIZE (i) > 0 in the for (i = 0; i <
> > NUM_MACHINE_MODES) loop?
> 
> Hmm I don't know.  If it really is correct for PPC to have modes which are
> ok for some registers, but still have hard_regno_nregs[] being 0 for them,
> then that hunk seems to be the most correct:
> (Normally it seems strange to me to allow say reg 2 for XYmode, but then
> it takes no registers at all to hold values of XYmode in reg 2)
> 
> @@ -8488,6 +8488,8 @@ init_ra (void)
>         if (HARD_REGNO_MODE_OK (reg, i))
>           {
>             int size = HARD_REGNO_NREGS (reg, i);
> +           if (!size)
> +             reg++;
>             while (size-- && reg < FIRST_PSEUDO_REGISTER)
>               {
>                 SET_HARD_REG_BIT (rs, reg);
> 
> 
> The only thing is, that I don't know, if those registers are now OK for
> that mode or not.  If they are Ok, then we would need to handle size==0 as
> if size==1, i.e:
> 	    if (!size)
> 	      size++;
> 
> Hmm, I think the latter is the best, at least if PPC is correct.

Like I said, i can change HARD_REGNO_MODE_OK to say VOIDmode and BLKmode 
are never okay for any hard regs.
> 
> 
> Ciao,
> Michael.
> 




More information about the Gcc-patches mailing list