This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patches for the 2.95 branch
- To: bernds at redhat dot com
- Subject: Re: Patches for the 2.95 branch
- From: jlarmour at redhat dot com (Jonathan Larmour)
- Date: Thu, 30 Nov 2000 19:16:56 GMT
- Cc: gcc-patches at gcc dot gnu dot org
- Newsgroups: cygnus.egcs.patches
- Organization: Red Hat UK Ltd.
In article <Pine.LNX.4.21.0011301140330.1162-100000@host117.cygnus> you write:
>I'll apply the following patches, one by one, to the 2.95 branch.
[snip]
I have another patch I have been using to allow arm-elf to build
in 2.95.2. Without this, arm-elf cannot even build libgcc. However I
cannot find its equivalent in the history of reload1.c, so I suspect it was
rewritten before submission, and I'm not even slightly clued up enough
on reload to work out what the equivalent patch is.
Does anyone know what the updated version of this patch is? Here's the
patch anyway, and I don't have a ChangeLog entry for it either. It was
originally given to me by Jim Wilson, but I can't find his mail any more.
Jifl
Index: gcc/reload1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
retrieving revision 1.145.4.1
diff -u -5 -p -r1.145.4.1 reload1.c
--- gcc/reload1.c 1999/07/07 01:05:39 1.145.4.1
+++ gcc/reload1.c 2000/03/02 23:23:17
@@ -6266,25 +6266,41 @@ choose_reload_regs (chain)
{
for (j = 0; j < n_reloads; j++)
{
register int r = reload_order[j];
rtx check_reg;
+ int check_regnum, nr, cant_inherit;
+
if (reload_inherited[r] && reload_reg_rtx[r])
check_reg = reload_reg_rtx[r];
else if (reload_override_in[r]
&& (GET_CODE (reload_override_in[r]) == REG
|| GET_CODE (reload_override_in[r]) == SUBREG))
check_reg = reload_override_in[r];
else
continue;
- if (! reload_reg_free_for_value_p (true_regnum (check_reg),
- reload_opnum[r],
- reload_when_needed[r],
- reload_in[r],
- (reload_inherited[r]
- ? reload_out[r] : const0_rtx),
- r, 1))
+
+ /* ??? reload_reg_free_for_value_p does not correctly handle
+ multi-word hard registers, so we loop and call it for each
+ individual hard register. All other places in reload that
+ call this function will also have to be fixed. */
+ check_regnum = true_regnum (check_reg);
+ nr = HARD_REGNO_NREGS (check_regnum, reload_mode[r]);
+ cant_inherit = 0;
+ for (i = check_regnum + nr - 1; i >= check_regnum; i--)
+ if (! reload_reg_free_for_value_p (i, reload_opnum[r],
+ reload_when_needed[r],
+ reload_in[r],
+ (reload_inherited[r]
+ ? reload_out[r] : const0_rtx),
+ r, 1))
+ {
+ cant_inherit = 1;
+ break;
+ }
+
+ if (cant_inherit)
{
if (pass)
continue;
reload_inherited[r] = 0;
reload_override_in[r] = 0;