A reload inheritance bug

Mark Shinwell shinwell@codesourcery.com
Tue Jun 5 11:19:00 GMT 2007


Bernd Schmidt wrote:
>>  My gut feeling is that this example will work as a consequence.
> 
> ... note that I inserted <some other insn> which could conceivably use
> R9 as an input reload, as the hard reg is dead.  Where would we
> invalidate previous information about R9?  I assume it would be the loop
> at the end of emit_reload_insns, specifically
> 
>               /* First, clear out memory of what used to be in this
> spill reg.
>                  If consecutive registers are used, clear them all.  */
> 
>               for (k = 0; k < nr; k++)
>                 {
>                 CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k);
>                   CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered,
> i + k);
> 
> Why isn't this triggering?

This code is guarded by

       /* I is nonneg if this reload used a register.
	 If rld[r].reg_rtx is 0, this is an optional reload
	 that we opted to ignore.  */

       if (i >= 0 && rld[r].reg_rtx != 0)

and in this [my original] case, i is negative (see my original patch).

I don't understand the "I is nonneg ..." comment above: the surrounding
code seems to say that i is actually non-negative if the reload used a
_spill_ register (rather than just any register).  Bernd, could you
clarify the precise meaning of "spill register" in this context?  I've
not yet managed to completely pin this down.

Mark



More information about the Gcc mailing list