This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: reload bug
- To: Bernd Schmidt <bernds at balti dot cygnus dot co dot uk>
- Subject: Re: reload bug
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 12 Jan 2000 03:52:45 -0700
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
[ This discussion originally started within one of Cygnus's newsgroups
because the change triggered a failure in our nightly testing framework.
I'm moving the discussion to the gcc-patches list. ]
In message <Pine.LNX.4.10.9912151521230.10870-100000@balti.cygnus.co.uk>you w
rite:
> > This change is causing the regressions in plumhall that I posted to
> > gcc-local on Nov 10:
>
> It's also causing the problems with openssl that were reported on the
> external list.
>
> > Thu Nov 4 15:52:35 1999 Andrew Haley <aph@cygnus.com>
> >
> > * reload1.c (reload_reg_free_for_value_p): Don't use a register
> > that is in reload_reg_used.
>
> Below is a patch to fix one half of the problem. This makes Andrew's
> change do what was intended. However, the second half of the problem
> (inheritance not being disabled properly) is still there, and I don't
> know yet how to fix it properly.
Just to recap -- Bernd fixed the inheritance problem last week; this is a
cleanup/improvement of Andrew's patch.
The patch is fine. Please install it.
Thanks for your patience.
> * reload1.c (reload_reg_unavailable): New static variable.
> (reload_reg_free_p): Test it.
> (reload_reg_free_for_value_p): Test it instead of reload_reg_uysed.
> (choose_reload_regs_init): Compute it.
>
> Index: reload1.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
> retrieving revision 1.186
> diff -c -p -r1.186 reload1.c
> *** reload1.c 1999/12/14 12:40:02 1.186
> --- reload1.c 1999/12/15 15:17:30
> *************** forget_old_reloads_1 (x, ignored, data)
> *** 3975,3980 ****
> --- 3975,3982 ----
> /* The following HARD_REG_SETs indicate when each hard register is
> used for a reload of various parts of the current insn. */
>
> + /* If reg is unavailable for all reloads. */
> + static HARD_REG_SET reload_reg_unavailable;
> /* If reg is in use as a reload reg for a RELOAD_OTHER reload. */
> static HARD_REG_SET reload_reg_used;
> /* If reg is in use for a RELOAD_FOR_INPUT_ADDRESS reload for operand I.
> */
> *************** reload_reg_free_p (regno, opnum, type)
> *** 4198,4204 ****
> int i;
>
> /* In use for a RELOAD_OTHER means it's not available for anything. */
> ! if (TEST_HARD_REG_BIT (reload_reg_used, regno))
> return 0;
>
> switch (type)
> --- 4200,4207 ----
> int i;
>
> /* In use for a RELOAD_OTHER means it's not available for anything. */
> ! if (TEST_HARD_REG_BIT (reload_reg_used, regno)
> ! || TEST_HARD_REG_BIT (reload_reg_unavailable, regno))
> return 0;
>
> switch (type)
> *************** reload_reg_free_for_value_p (regno, opnu
> *** 4602,4612 ****
> int i;
> int copy = 0;
>
> ! /* ??? reload_reg_used is abused to hold the registers that are not
> ! available as spill registers, including hard registers that are
> ! earlyclobbered in asms. As a temporary measure, reject anything
> ! in reload_reg_used. */
> ! if (TEST_HARD_REG_BIT (reload_reg_used, regno))
> return 0;
>
> if (out == const0_rtx)
> --- 4605,4611 ----
> int i;
> int copy = 0;
>
> ! if (TEST_HARD_REG_BIT (reload_reg_unavailable, regno))
> return 0;
>
> if (out == const0_rtx)
> *************** choose_reload_regs_init (chain, save_rel
> *** 5050,5056 ****
> CLEAR_HARD_REG_SET (reload_reg_used_in_outaddr_addr[i]);
> }
>
> ! IOR_COMPL_HARD_REG_SET (reload_reg_used, chain->used_spill_regs);
>
> CLEAR_HARD_REG_SET (reload_reg_used_for_inherit);
>
> --- 5049,5055 ----
> CLEAR_HARD_REG_SET (reload_reg_used_in_outaddr_addr[i]);
> }
>
> ! COMPL_HARD_REG_SET (reload_reg_unavailable, chain->used_spill_regs);
>
> CLEAR_HARD_REG_SET (reload_reg_used_for_inherit);
>
>
>