This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] Avoid invalid subregs during reload, call for testers
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Dec 2006 19:29:23 +0100
- Subject: Re: [PATCH/RFC] Avoid invalid subregs during reload, call for testers
- References: <20061204210411.GJ3563@sygehus.dk> <m3r6vd2eye.fsf@localhost.localdomain>
On Wed, Dec 06, 2006 at 07:59:05AM -0800, Ian Lance Taylor wrote:
[first part of reload1.c patch]
> This part of the patch is OK.
I'll retest with just this part of the patch.
> I'm not convinced that the assert in subeg_regno_offset is correct.
> As Joseph has pointed out, this is going to have knock-on effects on
> the rest of the compiler. The call to subreg_regno_offset is not
> necessarily incorrect, even if using it would be incorrect.
> In particular, without the assert, I don't think the rest of your
> patch to reload1.c is needed. The inherited reload should be
> prevented by the call to HARD_REGNO_MODE_OK.
And also by checking that the register has the right contents
(reg_reloaded_valid and reg_reloaded_contents) -- I didn't intend to imply
that wrong code could be generated. Part of the reason I included the second
change to reload1.c in the patch is that I test changes to
subreg_regno_offset() with a wrapper comparing return values from the old
and the new version:
unsigned int
subreg_regno_offset (unsigned int xregno, enum machine_mode xmode,
unsigned int offset, enum machine_mode ymode)
{
unsigned int old, new;
old = old_subreg_regno_offset (xregno, xmode, offset, ymode);
new = new_subreg_regno_offset (xregno, xmode, offset, ymode);
gcc_assert (old == new);
return (new);
}
With invalid parameters, that difficult to achieve. I'll change that
assert to
gcc_assert (old == new
|| !subreg_offset_representable_p (xregno, xmode, offset, ymode);
to avoid false positives.
--
Rask Ingemann Lambertsen