This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Unrepresentable subregs and hard_regno_nregs
- From: Ian Lance Taylor <iant at google dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 19 Dec 2006 18:45:47 -0800
- Subject: Re: Unrepresentable subregs and hard_regno_nregs
- References: <Pine.LNX.4.64.0612191843410.28929@digraph.polyomino.org.uk>
"Joseph S. Myers" <joseph@codesourcery.com> writes:
> Comments? OK to commit? Should the various places I made call
> subreg_nregs be further revised to call subreg_get_info directly, rather
> than first calling subreg_regno{,_offset} and then subreg_nregs, or should
> that be done in a separate patch? (The same cleanup to avoid duplicate
> work would also apply to existing places that call
> subreg_offset_representable_p before calling one of the other functions.)
This can be done as a separate patch.
> @@ -6479,6 +6479,10 @@
> GET_MODE (SUBREG_REG (x)),
> SUBREG_BYTE (x),
> GET_MODE (x));
> + endregno = regno + (regno < FIRST_PSEUDO_REGISTER
> + ? subreg_nregs (x) : 1);
> +
> + return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0);
> }
> else if (REG_P (x))
> {
This leaves some code at the end of the function which is only used in
the REG_P case. Please pull it up into the REG_P case and put a
gcc_unreachable () at the end of the function.
> - regno_last = (regno_first
> - + hard_regno_nregs[regno_first][outer_mode] - 1);
> + regno_last = (regno_first + subreg_nregs (reg) - 1);
Please remove the parentheses which are no longer needed.
The patch is OK with those changes.
Thanks.
Ian