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 13:41:16 +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> <46653E36.5030408@t-online.de> <466546C0.6050603@codesourcery.com>
Mark Shinwell wrote:
> 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.
The term "spill register" is a bit of a historical artifact, and I think
we may be getting close to the root cause here (and it seems to be my
fault.)
In the early days of gcc, when a register was spilled, it was spilled
for the whole function and became a spill register that reload could use
freely. That means that none of these spill registers would be selected
during find_reloads, as they don't appear in the insn anymore. These
days, we are more selective and don't spill hard regs for the entire
function.
It appears that spill_reg_index is only set up for registers that go
through the choose_reload_regs process, not for the ones selected during
find_reloads. That's probably a bad thing, as a reg_rtx chosen in
find_reloads could be used as a spill reg in a previous insn (as in your
example).
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