This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: bug fix for reload reg selection
- To: Joern Rennecke <amylaar at cambridge dot redhat dot com>
- Subject: Re: bug fix for reload reg selection
- From: Bernd Schmidt <bernds at redhat dot com>
- Date: Wed, 24 Jan 2001 16:42:41 +0000 (GMT)
- Cc: <gcc-patches at gcc dot gnu dot org>
On Wed, 24 Jan 2001, Joern Rennecke wrote:
> Wed Jan 24 13:55:59 2001 J"orn Rennecke <amylaar@redhat.com>
>
> * reload1.c (reload_reg_free_for_value_p): New parameter start_regno.
> Changed all callers. Take it into account when deciding if a
> previously loaded value matches.
Ok, but...
> *************** int reload_spill_index[MAX_RELOADS];
> *** 4725,4733 ****
> /* Subroutine of free_for_value_p, used to check a single register. */
>
> static int
> ! reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
> ! ignore_address_reloads)
> ! int regno;
> int opnum;
> enum reload_type type;
> rtx value, out;
> --- 4726,4734 ----
> /* Subroutine of free_for_value_p, used to check a single register. */
>
> static int
> ! reload_reg_free_for_value_p (start_regno, regno, opnum, type, value, out,
> ! reloadnum, ignore_address_reloads)
> ! int start_regno, regno;
> int opnum;
> enum reload_type type;
> rtx value, out;
Please document the new argument.
> *************** reload_reg_free_for_value_p (regno, opnu
> *** 4820,4826 ****
> <= HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)) - (unsigned)1)
> && i != reloadnum)
> {
> ! if (! rld[i].in || ! rtx_equal_p (rld[i].in, value)
> || rld[i].out || out)
> {
> int time2;
> --- 4821,4832 ----
> <= HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)) - (unsigned)1)
> && i != reloadnum)
> {
> ! rtx value2 = rld[i].in;
> !
> ! if (true_regnum (reg) != start_regno)
> ! value2 = NULL_RTX;
> ! if (! value2 || ! rtx_equal_p (value2, value)
> ! || true_regnum (reg) != start_regno
> || rld[i].out || out)
> {
> int time2;
A comment what's going on would be helpful (e.g. "If the other reload loads
the same input value, that will not cause a conflict only if it's loading
it into the same register").
Maybe the variable could have a better name than "value2", e.g.
"this_input" or something like this.
The second test for true_regnum (reg) != start_regno is redundant.
Bernd