This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A reload inheritance bug
- From: Mark Shinwell <shinwell at codesourcery dot com>
- To: Bernd Schmidt <bernds_cb1 at t-online dot de>
- 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:16:59 +0100
- 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> <46654BDC.5010809@t-online.de>
Bernd Schmidt wrote:
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).
Yes, I think that is indeed what's going on. I wonder if this issue
of spill_reg_index is also manifesting itself in:
/* The following if-statement was #if 0'd in 1.34 (or before...).
It's reenabled in 1.35 because supposedly nothing else
deals with this problem. */
/* If a register gets output-reloaded from a non-spill register,
that invalidates any previous reloaded copy of it.
But forget_old_reloads_1 won't get to see it, because
it thinks only about the original insn. So invalidate it here.
Also do the same thing for RELOAD_OTHER constraints where the
output is discarded. */
if (i < 0
...
and the code following in emit_reload_insns? Perhaps if spill_reg_index
took account of registers selected during find_reloads then this could
be simplified too.
So what do you think is the best approach to fix all of this? :-)
Mark