This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A reload inheritance bug
- From: Bernd Schmidt <bernds_cb1 at t-online dot de>
- To: Mark Shinwell <shinwell at codesourcery dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Richard Sandiford <richard at codesourcery dot com>, Ian Lance Taylor <iant at google dot com>, Rask Ingemann Lambertsen <rask at sygehus dot dk>
- Date: Tue, 05 Jun 2007 12:43:02 +0200
- Subject: Re: A reload inheritance bug
- References: <4648D8E1.2070307@codesourcery.com> <464987DA.8070306@t-online.de> <4649B275.1020707@codesourcery.com> <4652C64F.8080409@t-online.de> <465D78BD.60905@codesourcery.com>
Mark Shinwell wrote:
> As you say, one unusual thing about this situation must be the fact
> that the reload register is getting chosen by the code in
> push_reload heralded by "If this is an input reload and the operand
> contains a register that dies in this insn and is used nowhere else,
> see if it is the right class to be used for this reload. Use it if so."
Not that unusual - this happens all the time.
> etc. I suspect it is the conjunction of this code and the behaviour of
> reload in choosing r9 for pseudo 4082 in insn 5314 above that causes the
> problem.
>
> I don't entirely follow your example below...
>
>> Still, assume a similar sequence
>>
>> insn 5301: (set (reg/f:SI 4082) (reg/f:SI 3275))
>>
>> insn 5291 (set (reg:DF 4078])
>> (unspec:DF (mem/s:DF (plus:SI (reg/f:SI 3275)
>> (reg:SI 3812)))
>> (reg:SI 3275)))
>> REG_DEAD 3275
>>
>> <some other insn where R9 is used for an input reload>
>>
>> insn 5314 (set (reg:DF 4096)
>> (mem/s:DF (plus:SI (reg/f:SI 4082) (reg:SI 4084))))
>>
>> Here, we wouldn't use R9 as reload register in 5291
>
> ...since here, as far as I understand it, the clause mentioned above
> in push_reload wouldn't select r9 to use as a reload register for
> 5291.
That, and the subsequent code won't use a reg that's also used in the
insn. However, ...
> 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?
> (Perhaps you're getting at the fact that the decision procedure leading
> us to choose r9 for pseudo 4082 in insn 5314 might be at fault instead?
No, that seems fine.
Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif