Commit eceef4c9 by Bernd Schmidt Committed by Bernd Schmidt

Use structures not many single arrays in reload

From-SVN: r29361
parent c2a37c55
Sun Sep 12 15:53:20 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* reload.h (reload_in, reload_out, reload_in_reg, reload_out_reg,
reload_reg_class, reload_inmode, reload_outmode, reload_optional,
reload_nongroup, reload_inc, reload_opnum, reload_secondary_p,
reload_secondary_in_reload, reload_secondary_out_reload,
reload_secondary_in_icode, reload_secondary_out_icode,
reload_reg_rtx, reload_when_needed): Delete declarations.
(struct reload): New structure.
(rld): Declare new array.
* reload.c (reload_in, reload_out, reload_in_reg, reload_out_reg,
reload_reg_class, reload_inmode, reload_outmode, reload_optional,
reload_nongroup, reload_inc, reload_opnum, reload_secondary_p,
reload_secondary_in_reload, reload_secondary_out_reload,
reload_secondary_in_icode, reload_secondary_out_icode,
reload_reg_rtx, reload_when_needed): Delete definitions.
(rld): New array.
(whole file): Replace uses of the deleted arrays with uses of rld.
* reload1.c (whole file): Replace uses of the deleted arrays with
uses of rld.
(choose_reload_regs): Copy in/out of save_reload_reg_rtx with
explicit loops, not with bcopy.
Sun Sep 12 05:00:24 1999 Richard Henderson <rth@cygnus.com> Sun Sep 12 05:00:24 1999 Richard Henderson <rth@cygnus.com>
* recog.h (insn_template, insn_outfun, insn_n_operands, insn_n_dups, * recog.h (insn_template, insn_outfun, insn_n_operands, insn_n_dups,
......
...@@ -115,82 +115,10 @@ a register with any other reload. */ ...@@ -115,82 +115,10 @@ a register with any other reload. */
#define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO) #define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO)
#endif #endif
/* The variables set up by `find_reloads' are: /* All reloads of the current insn are recorded here. See reload.h for
comments. */
n_reloads number of distinct reloads needed; max reload # + 1
tables indexed by reload number
reload_in rtx for value to reload from
reload_out rtx for where to store reload-reg afterward if nec
(often the same as reload_in)
reload_reg_class enum reg_class, saying what regs to reload into
reload_inmode enum machine_mode; mode this operand should have
when reloaded, on input.
reload_outmode enum machine_mode; mode this operand should have
when reloaded, on output.
reload_optional char, nonzero for an optional reload.
Optional reloads are ignored unless the
value is already sitting in a register.
reload_nongroup char, nonzero when a reload must use a register
not already allocated to a group.
reload_inc int, positive amount to increment or decrement by if
reload_in is a PRE_DEC, PRE_INC, POST_DEC, POST_INC.
Ignored otherwise (don't assume it is zero).
reload_in_reg rtx. A reg for which reload_in is the equivalent.
If reload_in is a symbol_ref which came from
reg_equiv_constant, then this is the pseudo
which has that symbol_ref as equivalent.
reload_reg_rtx rtx. This is the register to reload into.
If it is zero when `find_reloads' returns,
you must find a suitable register in the class
specified by reload_reg_class, and store here
an rtx for that register with mode from
reload_inmode or reload_outmode.
reload_nocombine char, nonzero if this reload shouldn't be
combined with another reload.
reload_opnum int, operand number being reloaded. This is
used to group related reloads and need not always
be equal to the actual operand number in the insn,
though it current will be; for in-out operands, it
is one of the two operand numbers.
reload_when_needed enum, classifies reload as needed either for
addressing an input reload, addressing an output,
for addressing a non-reloaded mem ref,
or for unspecified purposes (i.e., more than one
of the above).
reload_secondary_p int, 1 if this is a secondary register for one
or more reloads.
reload_secondary_in_reload
reload_secondary_out_reload
int, gives the reload number of a secondary
reload, when needed; otherwise -1
reload_secondary_in_icode
reload_secondary_out_icode
enum insn_code, if a secondary reload is required,
gives the INSN_CODE that uses the secondary
reload as a scratch register, or CODE_FOR_nothing
if the secondary reload register is to be an
intermediate register. */
int n_reloads; int n_reloads;
struct reload rld[MAX_RELOADS];
rtx reload_in[MAX_RELOADS];
rtx reload_out[MAX_RELOADS];
enum reg_class reload_reg_class[MAX_RELOADS];
enum machine_mode reload_inmode[MAX_RELOADS];
enum machine_mode reload_outmode[MAX_RELOADS];
rtx reload_reg_rtx[MAX_RELOADS];
char reload_optional[MAX_RELOADS];
char reload_nongroup[MAX_RELOADS];
int reload_inc[MAX_RELOADS];
rtx reload_in_reg[MAX_RELOADS];
rtx reload_out_reg[MAX_RELOADS];
char reload_nocombine[MAX_RELOADS];
int reload_opnum[MAX_RELOADS];
enum reload_type reload_when_needed[MAX_RELOADS];
int reload_secondary_p[MAX_RELOADS];
int reload_secondary_in_reload[MAX_RELOADS];
int reload_secondary_out_reload[MAX_RELOADS];
enum insn_code reload_secondary_in_icode[MAX_RELOADS];
enum insn_code reload_secondary_out_icode[MAX_RELOADS];
/* All the "earlyclobber" operands of the current insn /* All the "earlyclobber" operands of the current insn
are recorded here. */ are recorded here. */
...@@ -496,58 +424,58 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, ...@@ -496,58 +424,58 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
if (t_class != NO_REGS) if (t_class != NO_REGS)
{ {
for (t_reload = 0; t_reload < n_reloads; t_reload++) for (t_reload = 0; t_reload < n_reloads; t_reload++)
if (reload_secondary_p[t_reload] if (rld[t_reload].secondary_p
&& (reg_class_subset_p (t_class, reload_reg_class[t_reload]) && (reg_class_subset_p (t_class, rld[t_reload].class)
|| reg_class_subset_p (reload_reg_class[t_reload], t_class)) || reg_class_subset_p (rld[t_reload].class, t_class))
&& ((in_p && reload_inmode[t_reload] == t_mode) && ((in_p && rld[t_reload].inmode == t_mode)
|| (! in_p && reload_outmode[t_reload] == t_mode)) || (! in_p && rld[t_reload].outmode == t_mode))
&& ((in_p && (reload_secondary_in_icode[t_reload] && ((in_p && (rld[t_reload].secondary_in_icode
== CODE_FOR_nothing)) == CODE_FOR_nothing))
|| (! in_p &&(reload_secondary_out_icode[t_reload] || (! in_p &&(rld[t_reload].secondary_out_icode
== CODE_FOR_nothing))) == CODE_FOR_nothing)))
&& (reg_class_size[(int) t_class] == 1 || SMALL_REGISTER_CLASSES) && (reg_class_size[(int) t_class] == 1 || SMALL_REGISTER_CLASSES)
&& MERGABLE_RELOADS (secondary_type, && MERGABLE_RELOADS (secondary_type,
reload_when_needed[t_reload], rld[t_reload].when_needed,
opnum, reload_opnum[t_reload])) opnum, rld[t_reload].opnum))
{ {
if (in_p) if (in_p)
reload_inmode[t_reload] = t_mode; rld[t_reload].inmode = t_mode;
if (! in_p) if (! in_p)
reload_outmode[t_reload] = t_mode; rld[t_reload].outmode = t_mode;
if (reg_class_subset_p (t_class, reload_reg_class[t_reload])) if (reg_class_subset_p (t_class, rld[t_reload].class))
reload_reg_class[t_reload] = t_class; rld[t_reload].class = t_class;
reload_opnum[t_reload] = MIN (reload_opnum[t_reload], opnum); rld[t_reload].opnum = MIN (rld[t_reload].opnum, opnum);
reload_optional[t_reload] &= optional; rld[t_reload].optional &= optional;
reload_secondary_p[t_reload] = 1; rld[t_reload].secondary_p = 1;
if (MERGE_TO_OTHER (secondary_type, reload_when_needed[t_reload], if (MERGE_TO_OTHER (secondary_type, rld[t_reload].when_needed,
opnum, reload_opnum[t_reload])) opnum, rld[t_reload].opnum))
reload_when_needed[t_reload] = RELOAD_OTHER; rld[t_reload].when_needed = RELOAD_OTHER;
} }
if (t_reload == n_reloads) if (t_reload == n_reloads)
{ {
/* We need to make a new tertiary reload for this register class. */ /* We need to make a new tertiary reload for this register class. */
reload_in[t_reload] = reload_out[t_reload] = 0; rld[t_reload].in = rld[t_reload].out = 0;
reload_reg_class[t_reload] = t_class; rld[t_reload].class = t_class;
reload_inmode[t_reload] = in_p ? t_mode : VOIDmode; rld[t_reload].inmode = in_p ? t_mode : VOIDmode;
reload_outmode[t_reload] = ! in_p ? t_mode : VOIDmode; rld[t_reload].outmode = ! in_p ? t_mode : VOIDmode;
reload_reg_rtx[t_reload] = 0; rld[t_reload].reg_rtx = 0;
reload_optional[t_reload] = optional; rld[t_reload].optional = optional;
reload_nongroup[t_reload] = 0; rld[t_reload].nongroup = 0;
reload_inc[t_reload] = 0; rld[t_reload].inc = 0;
/* Maybe we could combine these, but it seems too tricky. */ /* Maybe we could combine these, but it seems too tricky. */
reload_nocombine[t_reload] = 1; rld[t_reload].nocombine = 1;
reload_in_reg[t_reload] = 0; rld[t_reload].in_reg = 0;
reload_out_reg[t_reload] = 0; rld[t_reload].out_reg = 0;
reload_opnum[t_reload] = opnum; rld[t_reload].opnum = opnum;
reload_when_needed[t_reload] = secondary_type; rld[t_reload].when_needed = secondary_type;
reload_secondary_in_reload[t_reload] = -1; rld[t_reload].secondary_in_reload = -1;
reload_secondary_out_reload[t_reload] = -1; rld[t_reload].secondary_out_reload = -1;
reload_secondary_in_icode[t_reload] = CODE_FOR_nothing; rld[t_reload].secondary_in_icode = CODE_FOR_nothing;
reload_secondary_out_icode[t_reload] = CODE_FOR_nothing; rld[t_reload].secondary_out_icode = CODE_FOR_nothing;
reload_secondary_p[t_reload] = 1; rld[t_reload].secondary_p = 1;
n_reloads++; n_reloads++;
} }
...@@ -555,33 +483,33 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, ...@@ -555,33 +483,33 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
/* See if we can reuse an existing secondary reload. */ /* See if we can reuse an existing secondary reload. */
for (s_reload = 0; s_reload < n_reloads; s_reload++) for (s_reload = 0; s_reload < n_reloads; s_reload++)
if (reload_secondary_p[s_reload] if (rld[s_reload].secondary_p
&& (reg_class_subset_p (class, reload_reg_class[s_reload]) && (reg_class_subset_p (class, rld[s_reload].class)
|| reg_class_subset_p (reload_reg_class[s_reload], class)) || reg_class_subset_p (rld[s_reload].class, class))
&& ((in_p && reload_inmode[s_reload] == mode) && ((in_p && rld[s_reload].inmode == mode)
|| (! in_p && reload_outmode[s_reload] == mode)) || (! in_p && rld[s_reload].outmode == mode))
&& ((in_p && reload_secondary_in_reload[s_reload] == t_reload) && ((in_p && rld[s_reload].secondary_in_reload == t_reload)
|| (! in_p && reload_secondary_out_reload[s_reload] == t_reload)) || (! in_p && rld[s_reload].secondary_out_reload == t_reload))
&& ((in_p && reload_secondary_in_icode[s_reload] == t_icode) && ((in_p && rld[s_reload].secondary_in_icode == t_icode)
|| (! in_p && reload_secondary_out_icode[s_reload] == t_icode)) || (! in_p && rld[s_reload].secondary_out_icode == t_icode))
&& (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES) && (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES)
&& MERGABLE_RELOADS (secondary_type, reload_when_needed[s_reload], && MERGABLE_RELOADS (secondary_type, rld[s_reload].when_needed,
opnum, reload_opnum[s_reload])) opnum, rld[s_reload].opnum))
{ {
if (in_p) if (in_p)
reload_inmode[s_reload] = mode; rld[s_reload].inmode = mode;
if (! in_p) if (! in_p)
reload_outmode[s_reload] = mode; rld[s_reload].outmode = mode;
if (reg_class_subset_p (class, reload_reg_class[s_reload])) if (reg_class_subset_p (class, rld[s_reload].class))
reload_reg_class[s_reload] = class; rld[s_reload].class = class;
reload_opnum[s_reload] = MIN (reload_opnum[s_reload], opnum); rld[s_reload].opnum = MIN (rld[s_reload].opnum, opnum);
reload_optional[s_reload] &= optional; rld[s_reload].optional &= optional;
reload_secondary_p[s_reload] = 1; rld[s_reload].secondary_p = 1;
if (MERGE_TO_OTHER (secondary_type, reload_when_needed[s_reload], if (MERGE_TO_OTHER (secondary_type, rld[s_reload].when_needed,
opnum, reload_opnum[s_reload])) opnum, rld[s_reload].opnum))
reload_when_needed[s_reload] = RELOAD_OTHER; rld[s_reload].when_needed = RELOAD_OTHER;
} }
if (s_reload == n_reloads) if (s_reload == n_reloads)
...@@ -598,27 +526,27 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, ...@@ -598,27 +526,27 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
#endif #endif
/* We need to make a new secondary reload for this register class. */ /* We need to make a new secondary reload for this register class. */
reload_in[s_reload] = reload_out[s_reload] = 0; rld[s_reload].in = rld[s_reload].out = 0;
reload_reg_class[s_reload] = class; rld[s_reload].class = class;
reload_inmode[s_reload] = in_p ? mode : VOIDmode; rld[s_reload].inmode = in_p ? mode : VOIDmode;
reload_outmode[s_reload] = ! in_p ? mode : VOIDmode; rld[s_reload].outmode = ! in_p ? mode : VOIDmode;
reload_reg_rtx[s_reload] = 0; rld[s_reload].reg_rtx = 0;
reload_optional[s_reload] = optional; rld[s_reload].optional = optional;
reload_nongroup[s_reload] = 0; rld[s_reload].nongroup = 0;
reload_inc[s_reload] = 0; rld[s_reload].inc = 0;
/* Maybe we could combine these, but it seems too tricky. */ /* Maybe we could combine these, but it seems too tricky. */
reload_nocombine[s_reload] = 1; rld[s_reload].nocombine = 1;
reload_in_reg[s_reload] = 0; rld[s_reload].in_reg = 0;
reload_out_reg[s_reload] = 0; rld[s_reload].out_reg = 0;
reload_opnum[s_reload] = opnum; rld[s_reload].opnum = opnum;
reload_when_needed[s_reload] = secondary_type; rld[s_reload].when_needed = secondary_type;
reload_secondary_in_reload[s_reload] = in_p ? t_reload : -1; rld[s_reload].secondary_in_reload = in_p ? t_reload : -1;
reload_secondary_out_reload[s_reload] = ! in_p ? t_reload : -1; rld[s_reload].secondary_out_reload = ! in_p ? t_reload : -1;
reload_secondary_in_icode[s_reload] = in_p ? t_icode : CODE_FOR_nothing; rld[s_reload].secondary_in_icode = in_p ? t_icode : CODE_FOR_nothing;
reload_secondary_out_icode[s_reload] rld[s_reload].secondary_out_icode
= ! in_p ? t_icode : CODE_FOR_nothing; = ! in_p ? t_icode : CODE_FOR_nothing;
reload_secondary_p[s_reload] = 1; rld[s_reload].secondary_p = 1;
n_reloads++; n_reloads++;
...@@ -783,21 +711,19 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share) ...@@ -783,21 +711,19 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share)
than we otherwise would. */ than we otherwise would. */
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if ((reg_class_subset_p (class, reload_reg_class[i]) if ((reg_class_subset_p (class, rld[i].class)
|| reg_class_subset_p (reload_reg_class[i], class)) || reg_class_subset_p (rld[i].class, class))
/* If the existing reload has a register, it must fit our class. */ /* If the existing reload has a register, it must fit our class. */
&& (reload_reg_rtx[i] == 0 && (rld[i].reg_rtx == 0
|| TEST_HARD_REG_BIT (reg_class_contents[(int) class], || TEST_HARD_REG_BIT (reg_class_contents[(int) class],
true_regnum (reload_reg_rtx[i]))) true_regnum (rld[i].reg_rtx)))
&& ((in != 0 && MATCHES (reload_in[i], in) && ! dont_share && ((in != 0 && MATCHES (rld[i].in, in) && ! dont_share
&& (out == 0 || reload_out[i] == 0 || MATCHES (reload_out[i], out))) && (out == 0 || rld[i].out == 0 || MATCHES (rld[i].out, out)))
|| || (out != 0 && MATCHES (rld[i].out, out)
(out != 0 && MATCHES (reload_out[i], out) && (in == 0 || rld[i].in == 0 || MATCHES (rld[i].in, in))))
&& (in == 0 || reload_in[i] == 0 || MATCHES (reload_in[i], in)))) && (rld[i].out == 0 || ! earlyclobber_operand_p (rld[i].out))
&& (reload_out[i] == 0 || ! earlyclobber_operand_p (reload_out[i]))
&& (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES) && (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES)
&& MERGABLE_RELOADS (type, reload_when_needed[i], && MERGABLE_RELOADS (type, rld[i].when_needed, opnum, rld[i].opnum))
opnum, reload_opnum[i]))
return i; return i;
/* Reloading a plain reg for input can match a reload to postincrement /* Reloading a plain reg for input can match a reload to postincrement
...@@ -806,36 +732,36 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share) ...@@ -806,36 +732,36 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share)
the preincrementation as happening before any ref in this insn the preincrementation as happening before any ref in this insn
to that register. */ to that register. */
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if ((reg_class_subset_p (class, reload_reg_class[i]) if ((reg_class_subset_p (class, rld[i].class)
|| reg_class_subset_p (reload_reg_class[i], class)) || reg_class_subset_p (rld[i].class, class))
/* If the existing reload has a register, it must fit our /* If the existing reload has a register, it must fit our
class. */ class. */
&& (reload_reg_rtx[i] == 0 && (rld[i].reg_rtx == 0
|| TEST_HARD_REG_BIT (reg_class_contents[(int) class], || TEST_HARD_REG_BIT (reg_class_contents[(int) class],
true_regnum (reload_reg_rtx[i]))) true_regnum (rld[i].reg_rtx)))
&& out == 0 && reload_out[i] == 0 && reload_in[i] != 0 && out == 0 && rld[i].out == 0 && rld[i].in != 0
&& ((GET_CODE (in) == REG && ((GET_CODE (in) == REG
&& (GET_CODE (reload_in[i]) == POST_INC && (GET_CODE (rld[i].in) == POST_INC
|| GET_CODE (reload_in[i]) == POST_DEC || GET_CODE (rld[i].in) == POST_DEC
|| GET_CODE (reload_in[i]) == PRE_INC || GET_CODE (rld[i].in) == PRE_INC
|| GET_CODE (reload_in[i]) == PRE_DEC) || GET_CODE (rld[i].in) == PRE_DEC)
&& MATCHES (XEXP (reload_in[i], 0), in)) && MATCHES (XEXP (rld[i].in, 0), in))
|| ||
(GET_CODE (reload_in[i]) == REG (GET_CODE (rld[i].in) == REG
&& (GET_CODE (in) == POST_INC && (GET_CODE (in) == POST_INC
|| GET_CODE (in) == POST_DEC || GET_CODE (in) == POST_DEC
|| GET_CODE (in) == PRE_INC || GET_CODE (in) == PRE_INC
|| GET_CODE (in) == PRE_DEC) || GET_CODE (in) == PRE_DEC)
&& MATCHES (XEXP (in, 0), reload_in[i]))) && MATCHES (XEXP (in, 0), rld[i].in)))
&& (reload_out[i] == 0 || ! earlyclobber_operand_p (reload_out[i])) && (rld[i].out == 0 || ! earlyclobber_operand_p (rld[i].out))
&& (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES) && (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES)
&& MERGABLE_RELOADS (type, reload_when_needed[i], && MERGABLE_RELOADS (type, rld[i].when_needed,
opnum, reload_opnum[i])) opnum, rld[i].opnum))
{ {
/* Make sure reload_in ultimately has the increment, /* Make sure reload_in ultimately has the increment,
not the plain register. */ not the plain register. */
if (GET_CODE (in) == REG) if (GET_CODE (in) == REG)
*p_in = reload_in[i]; *p_in = rld[i].in;
return i; return i;
} }
return n_reloads; return n_reloads;
...@@ -1311,25 +1237,25 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1311,25 +1237,25 @@ push_reload (in, out, inloc, outloc, class,
#endif #endif
i = n_reloads; i = n_reloads;
reload_in[i] = in; rld[i].in = in;
reload_out[i] = out; rld[i].out = out;
reload_reg_class[i] = class; rld[i].class = class;
reload_inmode[i] = inmode; rld[i].inmode = inmode;
reload_outmode[i] = outmode; rld[i].outmode = outmode;
reload_reg_rtx[i] = 0; rld[i].reg_rtx = 0;
reload_optional[i] = optional; rld[i].optional = optional;
reload_nongroup[i] = 0; rld[i].nongroup = 0;
reload_inc[i] = 0; rld[i].inc = 0;
reload_nocombine[i] = 0; rld[i].nocombine = 0;
reload_in_reg[i] = inloc ? *inloc : 0; rld[i].in_reg = inloc ? *inloc : 0;
reload_out_reg[i] = outloc ? *outloc : 0; rld[i].out_reg = outloc ? *outloc : 0;
reload_opnum[i] = opnum; rld[i].opnum = opnum;
reload_when_needed[i] = type; rld[i].when_needed = type;
reload_secondary_in_reload[i] = secondary_in_reload; rld[i].secondary_in_reload = secondary_in_reload;
reload_secondary_out_reload[i] = secondary_out_reload; rld[i].secondary_out_reload = secondary_out_reload;
reload_secondary_in_icode[i] = secondary_in_icode; rld[i].secondary_in_icode = secondary_in_icode;
reload_secondary_out_icode[i] = secondary_out_icode; rld[i].secondary_out_icode = secondary_out_icode;
reload_secondary_p[i] = 0; rld[i].secondary_p = 0;
n_reloads++; n_reloads++;
...@@ -1351,11 +1277,11 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1351,11 +1277,11 @@ push_reload (in, out, inloc, outloc, class,
/* The modes can be different. If they are, we want to reload in /* The modes can be different. If they are, we want to reload in
the larger mode, so that the value is valid for both modes. */ the larger mode, so that the value is valid for both modes. */
if (inmode != VOIDmode if (inmode != VOIDmode
&& GET_MODE_SIZE (inmode) > GET_MODE_SIZE (reload_inmode[i])) && GET_MODE_SIZE (inmode) > GET_MODE_SIZE (rld[i].inmode))
reload_inmode[i] = inmode; rld[i].inmode = inmode;
if (outmode != VOIDmode if (outmode != VOIDmode
&& GET_MODE_SIZE (outmode) > GET_MODE_SIZE (reload_outmode[i])) && GET_MODE_SIZE (outmode) > GET_MODE_SIZE (rld[i].outmode))
reload_outmode[i] = outmode; rld[i].outmode = outmode;
if (in != 0) if (in != 0)
{ {
rtx in_reg = inloc ? *inloc : 0; rtx in_reg = inloc ? *inloc : 0;
...@@ -1373,35 +1299,35 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1373,35 +1299,35 @@ push_reload (in, out, inloc, outloc, class,
choose_reload_regs will remove the replacements for address choose_reload_regs will remove the replacements for address
reloads of inherited reloads which results in the same reloads of inherited reloads which results in the same
problem. */ problem. */
if (reload_in[i] != in && rtx_equal_p (in, reload_in[i]) if (rld[i].in != in && rtx_equal_p (in, rld[i].in)
&& ! (reload_optional[i] && optional)) && ! (rld[i].optional && optional))
{ {
/* We must keep the address reload with the lower operand /* We must keep the address reload with the lower operand
number alive. */ number alive. */
if (opnum > reload_opnum[i]) if (opnum > rld[i].opnum)
{ {
remove_address_replacements (in); remove_address_replacements (in);
in = reload_in[i]; in = rld[i].in;
in_reg = reload_in_reg[i]; in_reg = rld[i].in_reg;
} }
else else
remove_address_replacements (reload_in[i]); remove_address_replacements (rld[i].in);
} }
reload_in[i] = in; rld[i].in = in;
reload_in_reg[i] = in_reg; rld[i].in_reg = in_reg;
} }
if (out != 0) if (out != 0)
{ {
reload_out[i] = out; rld[i].out = out;
reload_out_reg[i] = outloc ? *outloc : 0; rld[i].out_reg = outloc ? *outloc : 0;
} }
if (reg_class_subset_p (class, reload_reg_class[i])) if (reg_class_subset_p (class, rld[i].class))
reload_reg_class[i] = class; rld[i].class = class;
reload_optional[i] &= optional; rld[i].optional &= optional;
if (MERGE_TO_OTHER (type, reload_when_needed[i], if (MERGE_TO_OTHER (type, rld[i].when_needed,
opnum, reload_opnum[i])) opnum, rld[i].opnum))
reload_when_needed[i] = RELOAD_OTHER; rld[i].when_needed = RELOAD_OTHER;
reload_opnum[i] = MIN (reload_opnum[i], opnum); rld[i].opnum = MIN (rld[i].opnum, opnum);
} }
/* If the ostensible rtx being reload differs from the rtx found /* If the ostensible rtx being reload differs from the rtx found
...@@ -1409,7 +1335,7 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1409,7 +1335,7 @@ push_reload (in, out, inloc, outloc, class,
because we cannot reliably tell whether it appears in the insn. */ because we cannot reliably tell whether it appears in the insn. */
if (in != 0 && in != *inloc) if (in != 0 && in != *inloc)
reload_nocombine[i] = 1; rld[i].nocombine = 1;
#if 0 #if 0
/* This was replaced by changes in find_reloads_address_1 and the new /* This was replaced by changes in find_reloads_address_1 and the new
...@@ -1423,12 +1349,12 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1423,12 +1349,12 @@ push_reload (in, out, inloc, outloc, class,
if (out != 0 && sets_cc0_p (PATTERN (this_insn))) if (out != 0 && sets_cc0_p (PATTERN (this_insn)))
{ {
out = 0; out = 0;
reload_out[i] = 0; rld[i].out = 0;
reload_inc[i] = find_inc_amount (PATTERN (this_insn), in); rld[i].inc = find_inc_amount (PATTERN (this_insn), in);
/* If we did not find a nonzero amount-to-increment-by, /* If we did not find a nonzero amount-to-increment-by,
that contradicts the belief that IN is being incremented that contradicts the belief that IN is being incremented
in an address in this insn. */ in an address in this insn. */
if (reload_inc[i] == 0) if (rld[i].inc == 0)
abort (); abort ();
} }
#endif #endif
...@@ -1462,25 +1388,25 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1462,25 +1388,25 @@ push_reload (in, out, inloc, outloc, class,
supposed to be made to match, see if either one of the two supposed to be made to match, see if either one of the two
can serve as the place to reload into. can serve as the place to reload into.
If one of them is acceptable, set reload_reg_rtx[i] If one of them is acceptable, set rld[i].reg_rtx
to that one. */ to that one. */
if (in != 0 && out != 0 && in != out && reload_reg_rtx[i] == 0) if (in != 0 && out != 0 && in != out && rld[i].reg_rtx == 0)
{ {
reload_reg_rtx[i] = find_dummy_reload (in, out, inloc, outloc, rld[i].reg_rtx = find_dummy_reload (in, out, inloc, outloc,
inmode, outmode, inmode, outmode,
reload_reg_class[i], i, rld[i].class, i,
earlyclobber_operand_p (out)); earlyclobber_operand_p (out));
/* If the outgoing register already contains the same value /* If the outgoing register already contains the same value
as the incoming one, we can dispense with loading it. as the incoming one, we can dispense with loading it.
The easiest way to tell the caller that is to give a phony The easiest way to tell the caller that is to give a phony
value for the incoming operand (same as outgoing one). */ value for the incoming operand (same as outgoing one). */
if (reload_reg_rtx[i] == out if (rld[i].reg_rtx == out
&& (GET_CODE (in) == REG || CONSTANT_P (in)) && (GET_CODE (in) == REG || CONSTANT_P (in))
&& 0 != find_equiv_reg (in, this_insn, 0, REGNO (out), && 0 != find_equiv_reg (in, this_insn, 0, REGNO (out),
static_reload_reg_p, i, inmode)) static_reload_reg_p, i, inmode))
reload_in[i] = out; rld[i].in = out;
} }
/* If this is an input reload and the operand contains a register that /* If this is an input reload and the operand contains a register that
...@@ -1495,7 +1421,7 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1495,7 +1421,7 @@ push_reload (in, out, inloc, outloc, class,
But if there is no spilling in this block, that is OK. But if there is no spilling in this block, that is OK.
An explicitly used hard reg cannot be a spill reg. */ An explicitly used hard reg cannot be a spill reg. */
if (reload_reg_rtx[i] == 0 && in != 0) if (rld[i].reg_rtx == 0 && in != 0)
{ {
rtx note; rtx note;
int regno; int regno;
...@@ -1536,7 +1462,7 @@ push_reload (in, out, inloc, outloc, class, ...@@ -1536,7 +1462,7 @@ push_reload (in, out, inloc, outloc, class,
&& TEST_HARD_REG_BIT (reg_class_contents[(int) class], regno) && TEST_HARD_REG_BIT (reg_class_contents[(int) class], regno)
&& !fixed_regs[regno]) && !fixed_regs[regno])
{ {
reload_reg_rtx[i] = gen_rtx_REG (inmode, regno); rld[i].reg_rtx = gen_rtx_REG (inmode, regno);
break; break;
} }
} }
...@@ -1614,8 +1540,8 @@ remove_address_replacements (in_rtx) ...@@ -1614,8 +1540,8 @@ remove_address_replacements (in_rtx)
if (reload_flags[i] == 1) if (reload_flags[i] == 1)
{ {
deallocate_reload_reg (i); deallocate_reload_reg (i);
remove_address_replacements (reload_in[i]); remove_address_replacements (rld[i].in);
reload_in[i] = 0; rld[i].in = 0;
something_changed = 1; something_changed = 1;
} }
} }
...@@ -1672,103 +1598,103 @@ combine_reloads () ...@@ -1672,103 +1598,103 @@ combine_reloads ()
and that one is mandatory. */ and that one is mandatory. */
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if (reload_out[i] != 0) if (rld[i].out != 0)
{ {
if (output_reload >= 0) if (output_reload >= 0)
return; return;
output_reload = i; output_reload = i;
} }
if (output_reload < 0 || reload_optional[output_reload]) if (output_reload < 0 || rld[output_reload].optional)
return; return;
/* An input-output reload isn't combinable. */ /* An input-output reload isn't combinable. */
if (reload_in[output_reload] != 0) if (rld[output_reload].in != 0)
return; return;
/* If this reload is for an earlyclobber operand, we can't do anything. */ /* If this reload is for an earlyclobber operand, we can't do anything. */
if (earlyclobber_operand_p (reload_out[output_reload])) if (earlyclobber_operand_p (rld[output_reload].out))
return; return;
/* Check each input reload; can we combine it? */ /* Check each input reload; can we combine it? */
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if (reload_in[i] && ! reload_optional[i] && ! reload_nocombine[i] if (rld[i].in && ! rld[i].optional && ! rld[i].nocombine
/* Life span of this reload must not extend past main insn. */ /* Life span of this reload must not extend past main insn. */
&& reload_when_needed[i] != RELOAD_FOR_OUTPUT_ADDRESS && rld[i].when_needed != RELOAD_FOR_OUTPUT_ADDRESS
&& reload_when_needed[i] != RELOAD_FOR_OUTADDR_ADDRESS && rld[i].when_needed != RELOAD_FOR_OUTADDR_ADDRESS
&& reload_when_needed[i] != RELOAD_OTHER && rld[i].when_needed != RELOAD_OTHER
&& (CLASS_MAX_NREGS (reload_reg_class[i], reload_inmode[i]) && (CLASS_MAX_NREGS (rld[i].class, rld[i].inmode)
== CLASS_MAX_NREGS (reload_reg_class[output_reload], == CLASS_MAX_NREGS (rld[output_reload].class,
reload_outmode[output_reload])) rld[output_reload].outmode))
&& reload_inc[i] == 0 && rld[i].inc == 0
&& reload_reg_rtx[i] == 0 && rld[i].reg_rtx == 0
#ifdef SECONDARY_MEMORY_NEEDED #ifdef SECONDARY_MEMORY_NEEDED
/* Don't combine two reloads with different secondary /* Don't combine two reloads with different secondary
memory locations. */ memory locations. */
&& (secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[i]] == 0 && (secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[i].opnum] == 0
|| secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]] == 0 || secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[output_reload].opnum] == 0
|| rtx_equal_p (secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[i]], || rtx_equal_p (secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[i].opnum],
secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]])) secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[output_reload].opnum]))
#endif #endif
&& (SMALL_REGISTER_CLASSES && (SMALL_REGISTER_CLASSES
? (reload_reg_class[i] == reload_reg_class[output_reload]) ? (rld[i].class == rld[output_reload].class)
: (reg_class_subset_p (reload_reg_class[i], : (reg_class_subset_p (rld[i].class,
reload_reg_class[output_reload]) rld[output_reload].class)
|| reg_class_subset_p (reload_reg_class[output_reload], || reg_class_subset_p (rld[output_reload].class,
reload_reg_class[i]))) rld[i].class)))
&& (MATCHES (reload_in[i], reload_out[output_reload]) && (MATCHES (rld[i].in, rld[output_reload].out)
/* Args reversed because the first arg seems to be /* Args reversed because the first arg seems to be
the one that we imagine being modified the one that we imagine being modified
while the second is the one that might be affected. */ while the second is the one that might be affected. */
|| (! reg_overlap_mentioned_for_reload_p (reload_out[output_reload], || (! reg_overlap_mentioned_for_reload_p (rld[output_reload].out,
reload_in[i]) rld[i].in)
/* However, if the input is a register that appears inside /* However, if the input is a register that appears inside
the output, then we also can't share. the output, then we also can't share.
Imagine (set (mem (reg 69)) (plus (reg 69) ...)). Imagine (set (mem (reg 69)) (plus (reg 69) ...)).
If the same reload reg is used for both reg 69 and the If the same reload reg is used for both reg 69 and the
result to be stored in memory, then that result result to be stored in memory, then that result
will clobber the address of the memory ref. */ will clobber the address of the memory ref. */
&& ! (GET_CODE (reload_in[i]) == REG && ! (GET_CODE (rld[i].in) == REG
&& reg_overlap_mentioned_for_reload_p (reload_in[i], && reg_overlap_mentioned_for_reload_p (rld[i].in,
reload_out[output_reload])))) rld[output_reload].out))))
&& (reg_class_size[(int) reload_reg_class[i]] && (reg_class_size[(int) rld[i].class]
|| SMALL_REGISTER_CLASSES) || SMALL_REGISTER_CLASSES)
/* We will allow making things slightly worse by combining an /* We will allow making things slightly worse by combining an
input and an output, but no worse than that. */ input and an output, but no worse than that. */
&& (reload_when_needed[i] == RELOAD_FOR_INPUT && (rld[i].when_needed == RELOAD_FOR_INPUT
|| reload_when_needed[i] == RELOAD_FOR_OUTPUT)) || rld[i].when_needed == RELOAD_FOR_OUTPUT))
{ {
int j; int j;
/* We have found a reload to combine with! */ /* We have found a reload to combine with! */
reload_out[i] = reload_out[output_reload]; rld[i].out = rld[output_reload].out;
reload_out_reg[i] = reload_out_reg[output_reload]; rld[i].out_reg = rld[output_reload].out_reg;
reload_outmode[i] = reload_outmode[output_reload]; rld[i].outmode = rld[output_reload].outmode;
/* Mark the old output reload as inoperative. */ /* Mark the old output reload as inoperative. */
reload_out[output_reload] = 0; rld[output_reload].out = 0;
/* The combined reload is needed for the entire insn. */ /* The combined reload is needed for the entire insn. */
reload_when_needed[i] = RELOAD_OTHER; rld[i].when_needed = RELOAD_OTHER;
/* If the output reload had a secondary reload, copy it. */ /* If the output reload had a secondary reload, copy it. */
if (reload_secondary_out_reload[output_reload] != -1) if (rld[output_reload].secondary_out_reload != -1)
{ {
reload_secondary_out_reload[i] rld[i].secondary_out_reload
= reload_secondary_out_reload[output_reload]; = rld[output_reload].secondary_out_reload;
reload_secondary_out_icode[i] rld[i].secondary_out_icode
= reload_secondary_out_icode[output_reload]; = rld[output_reload].secondary_out_icode;
} }
#ifdef SECONDARY_MEMORY_NEEDED #ifdef SECONDARY_MEMORY_NEEDED
/* Copy any secondary MEM. */ /* Copy any secondary MEM. */
if (secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]] != 0) if (secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[output_reload].opnum] != 0)
secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[i]] secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[i].opnum]
= secondary_memlocs_elim[(int) reload_outmode[output_reload]][reload_opnum[output_reload]]; = secondary_memlocs_elim[(int) rld[output_reload].outmode][rld[output_reload].opnum];
#endif #endif
/* If required, minimize the register class. */ /* If required, minimize the register class. */
if (reg_class_subset_p (reload_reg_class[output_reload], if (reg_class_subset_p (rld[output_reload].class,
reload_reg_class[i])) rld[i].class))
reload_reg_class[i] = reload_reg_class[output_reload]; rld[i].class = rld[output_reload].class;
/* Transfer all replacements from the old reload to the combined. */ /* Transfer all replacements from the old reload to the combined. */
for (j = 0; j < n_replacements; j++) for (j = 0; j < n_replacements; j++)
...@@ -1799,27 +1725,27 @@ combine_reloads () ...@@ -1799,27 +1725,27 @@ combine_reloads ()
if (REG_NOTE_KIND (note) == REG_DEAD if (REG_NOTE_KIND (note) == REG_DEAD
&& GET_CODE (XEXP (note, 0)) == REG && GET_CODE (XEXP (note, 0)) == REG
&& ! reg_overlap_mentioned_for_reload_p (XEXP (note, 0), && ! reg_overlap_mentioned_for_reload_p (XEXP (note, 0),
reload_out[output_reload]) rld[output_reload].out)
&& REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER && REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER
&& HARD_REGNO_MODE_OK (REGNO (XEXP (note, 0)), reload_outmode[output_reload]) && HARD_REGNO_MODE_OK (REGNO (XEXP (note, 0)), rld[output_reload].outmode)
&& TEST_HARD_REG_BIT (reg_class_contents[(int) reload_reg_class[output_reload]], && TEST_HARD_REG_BIT (reg_class_contents[(int) rld[output_reload].class],
REGNO (XEXP (note, 0))) REGNO (XEXP (note, 0)))
&& (HARD_REGNO_NREGS (REGNO (XEXP (note, 0)), reload_outmode[output_reload]) && (HARD_REGNO_NREGS (REGNO (XEXP (note, 0)), rld[output_reload].outmode)
<= HARD_REGNO_NREGS (REGNO (XEXP (note, 0)), GET_MODE (XEXP (note, 0)))) <= HARD_REGNO_NREGS (REGNO (XEXP (note, 0)), GET_MODE (XEXP (note, 0))))
/* Ensure that a secondary or tertiary reload for this output /* Ensure that a secondary or tertiary reload for this output
won't want this register. */ won't want this register. */
&& ((secondary_out = reload_secondary_out_reload[output_reload]) == -1 && ((secondary_out = rld[output_reload].secondary_out_reload) == -1
|| (! (TEST_HARD_REG_BIT || (! (TEST_HARD_REG_BIT
(reg_class_contents[(int) reload_reg_class[secondary_out]], (reg_class_contents[(int) rld[secondary_out].class],
REGNO (XEXP (note, 0)))) REGNO (XEXP (note, 0))))
&& ((secondary_out = reload_secondary_out_reload[secondary_out]) == -1 && ((secondary_out = rld[secondary_out].secondary_out_reload) == -1
|| ! (TEST_HARD_REG_BIT || ! (TEST_HARD_REG_BIT
(reg_class_contents[(int) reload_reg_class[secondary_out]], (reg_class_contents[(int) rld[secondary_out].class],
REGNO (XEXP (note, 0))))))) REGNO (XEXP (note, 0)))))))
&& ! fixed_regs[REGNO (XEXP (note, 0))]) && ! fixed_regs[REGNO (XEXP (note, 0))])
{ {
reload_reg_rtx[output_reload] rld[output_reload].reg_rtx
= gen_rtx_REG (reload_outmode[output_reload], = gen_rtx_REG (rld[output_reload].outmode,
REGNO (XEXP (note, 0))); REGNO (XEXP (note, 0)));
return; return;
} }
...@@ -1835,7 +1761,7 @@ combine_reloads () ...@@ -1835,7 +1761,7 @@ combine_reloads ()
If FOR_REAL is >= 0, it is the number of the reload, If FOR_REAL is >= 0, it is the number of the reload,
and in some cases when it can be discovered that OUT doesn't need and in some cases when it can be discovered that OUT doesn't need
to be computed, clear out reload_out[FOR_REAL]. to be computed, clear out rld[FOR_REAL].out.
If FOR_REAL is -1, this should not be done, because this call If FOR_REAL is -1, this should not be done, because this call
is just to see if a register can be found, not to find and install it. is just to see if a register can be found, not to find and install it.
...@@ -1974,7 +1900,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc, ...@@ -1974,7 +1900,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
and changed our mind, it means OUT is a dummy that and changed our mind, it means OUT is a dummy that
dies here. So don't bother copying value to it. */ dies here. So don't bother copying value to it. */
if (for_real >= 0 && value == real_out) if (for_real >= 0 && value == real_out)
reload_out[for_real] = 0; rld[for_real].out = 0;
if (GET_CODE (real_in) == REG) if (GET_CODE (real_in) == REG)
value = real_in; value = real_in;
else else
...@@ -2707,7 +2633,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -2707,7 +2633,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
&& (set == 0 || &SET_DEST (set) != recog_data.operand_loc[i])) && (set == 0 || &SET_DEST (set) != recog_data.operand_loc[i]))
{ {
/* Record the existing mode so that the check if constants are /* Record the existing mode so that the check if constants are
allowed will work when operand_mode isn't specified. */ allowed will work when operand_mode isn't specified. */
if (operand_mode[i] == VOIDmode) if (operand_mode[i] == VOIDmode)
operand_mode[i] = GET_MODE (recog_data.operand[i]); operand_mode[i] = GET_MODE (recog_data.operand[i]);
...@@ -2742,7 +2668,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -2742,7 +2668,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
"no input reloads" requirement for this insn. */ "no input reloads" requirement for this insn. */
if (no_input_reloads) if (no_input_reloads)
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if (reload_in[i] != 0) if (rld[i].in != 0)
abort (); abort ();
#endif #endif
...@@ -3576,10 +3502,10 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3576,10 +3502,10 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
{ {
if (reload_opnum[i] == commutative) if (rld[i].opnum == commutative)
reload_opnum[i] = commutative + 1; rld[i].opnum = commutative + 1;
else if (reload_opnum[i] == commutative + 1) else if (rld[i].opnum == commutative + 1)
reload_opnum[i] = commutative; rld[i].opnum = commutative;
} }
} }
...@@ -3662,7 +3588,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3662,7 +3588,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
BASE_REG_CLASS, BASE_REG_CLASS,
GET_MODE (XEXP (recog_data.operand[i], 0)), GET_MODE (XEXP (recog_data.operand[i], 0)),
VOIDmode, 0, 0, i, RELOAD_FOR_INPUT); VOIDmode, 0, 0, i, RELOAD_FOR_INPUT);
reload_inc[operand_reloadnum[i]] rld[operand_reloadnum[i]].inc
= GET_MODE_SIZE (GET_MODE (recog_data.operand[i])); = GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));
/* If this operand is an output, we will have made any /* If this operand is an output, we will have made any
...@@ -3674,13 +3600,13 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3674,13 +3600,13 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{ {
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
{ {
if (reload_opnum[j] == i) if (rld[j].opnum == i)
{ {
if (reload_when_needed[j] == RELOAD_FOR_OUTPUT_ADDRESS) if (rld[j].when_needed == RELOAD_FOR_OUTPUT_ADDRESS)
reload_when_needed[j] = RELOAD_FOR_INPUT_ADDRESS; rld[j].when_needed = RELOAD_FOR_INPUT_ADDRESS;
else if (reload_when_needed[j] else if (rld[j].when_needed
== RELOAD_FOR_OUTADDR_ADDRESS) == RELOAD_FOR_OUTADDR_ADDRESS)
reload_when_needed[j] = RELOAD_FOR_INPADDR_ADDRESS; rld[j].when_needed = RELOAD_FOR_INPADDR_ADDRESS;
} }
} }
} }
...@@ -3908,18 +3834,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3908,18 +3834,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
search for an existing equivalent reg (same value now) in the right class. search for an existing equivalent reg (same value now) in the right class.
We can use it as long as we don't need to change its contents. */ We can use it as long as we don't need to change its contents. */
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if (reload_reg_rtx[i] == 0 if (rld[i].reg_rtx == 0
&& reload_in[i] != 0 && rld[i].in != 0
&& GET_CODE (reload_in[i]) == REG && GET_CODE (rld[i].in) == REG
&& reload_out[i] == 0) && rld[i].out == 0)
{ {
reload_reg_rtx[i] rld[i].reg_rtx
= find_equiv_reg (reload_in[i], insn, reload_reg_class[i], -1, = find_equiv_reg (rld[i].in, insn, rld[i].class, -1,
static_reload_reg_p, 0, reload_inmode[i]); static_reload_reg_p, 0, rld[i].inmode);
/* Prevent generation of insn to load the value /* Prevent generation of insn to load the value
because the one we found already has the value. */ because the one we found already has the value. */
if (reload_reg_rtx[i]) if (rld[i].reg_rtx)
reload_in[i] = reload_reg_rtx[i]; rld[i].in = rld[i].reg_rtx;
} }
#endif #endif
...@@ -3938,33 +3864,33 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3938,33 +3864,33 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
int k; int k;
for (j = i + 1; j < n_reloads; j++) for (j = i + 1; j < n_reloads; j++)
if ((reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS if ((rld[i].when_needed == RELOAD_FOR_INPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OUTPUT_ADDRESS || rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS || rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OUTADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
&& (reload_when_needed[j] == RELOAD_FOR_INPUT_ADDRESS && (rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS
|| reload_when_needed[j] == RELOAD_FOR_OUTPUT_ADDRESS || rld[j].when_needed == RELOAD_FOR_OUTPUT_ADDRESS
|| reload_when_needed[j] == RELOAD_FOR_INPADDR_ADDRESS || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS
|| reload_when_needed[j] == RELOAD_FOR_OUTADDR_ADDRESS) || rld[j].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
&& rtx_equal_p (reload_in[i], reload_in[j]) && rtx_equal_p (rld[i].in, rld[j].in)
&& (operand_reloadnum[reload_opnum[i]] < 0 && (operand_reloadnum[rld[i].opnum] < 0
|| reload_optional[operand_reloadnum[reload_opnum[i]]]) || rld[operand_reloadnum[rld[i].opnum]].optional)
&& (operand_reloadnum[reload_opnum[j]] < 0 && (operand_reloadnum[rld[j].opnum] < 0
|| reload_optional[operand_reloadnum[reload_opnum[j]]]) || rld[operand_reloadnum[rld[j].opnum]].optional)
&& (goal_alternative_matches[reload_opnum[i]] == reload_opnum[j] && (goal_alternative_matches[rld[i].opnum] == rld[j].opnum
|| (goal_alternative_matches[reload_opnum[j]] || (goal_alternative_matches[rld[j].opnum]
== reload_opnum[i]))) == rld[i].opnum)))
{ {
for (k = 0; k < n_replacements; k++) for (k = 0; k < n_replacements; k++)
if (replacements[k].what == j) if (replacements[k].what == j)
replacements[k].what = i; replacements[k].what = i;
if (reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS if (rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OUTADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
reload_when_needed[i] = RELOAD_FOR_OPADDR_ADDR; rld[i].when_needed = RELOAD_FOR_OPADDR_ADDR;
else else
reload_when_needed[i] = RELOAD_FOR_OPERAND_ADDRESS; rld[i].when_needed = RELOAD_FOR_OPERAND_ADDRESS;
reload_in[j] = 0; rld[j].in = 0;
} }
} }
...@@ -3987,68 +3913,68 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -3987,68 +3913,68 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
{ {
if (reload_secondary_p[i] if (rld[i].secondary_p
&& reload_when_needed[i] == operand_type[reload_opnum[i]]) && rld[i].when_needed == operand_type[rld[i].opnum])
reload_when_needed[i] = address_type[reload_opnum[i]]; rld[i].when_needed = address_type[rld[i].opnum];
if ((reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS if ((rld[i].when_needed == RELOAD_FOR_INPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OUTPUT_ADDRESS || rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS || rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OUTADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
&& (operand_reloadnum[reload_opnum[i]] < 0 && (operand_reloadnum[rld[i].opnum] < 0
|| reload_optional[operand_reloadnum[reload_opnum[i]]])) || rld[operand_reloadnum[rld[i].opnum]].optional))
{ {
/* If we have a secondary reload to go along with this reload, /* If we have a secondary reload to go along with this reload,
change its type to RELOAD_FOR_OPADDR_ADDR. */ change its type to RELOAD_FOR_OPADDR_ADDR. */
if ((reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS if ((rld[i].when_needed == RELOAD_FOR_INPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
&& reload_secondary_in_reload[i] != -1) && rld[i].secondary_in_reload != -1)
{ {
int secondary_in_reload = reload_secondary_in_reload[i]; int secondary_in_reload = rld[i].secondary_in_reload;
reload_when_needed[secondary_in_reload] rld[secondary_in_reload].when_needed
= RELOAD_FOR_OPADDR_ADDR; = RELOAD_FOR_OPADDR_ADDR;
/* If there's a tertiary reload we have to change it also. */ /* If there's a tertiary reload we have to change it also. */
if (secondary_in_reload > 0 if (secondary_in_reload > 0
&& reload_secondary_in_reload[secondary_in_reload] != -1) && rld[secondary_in_reload].secondary_in_reload != -1)
reload_when_needed[reload_secondary_in_reload[secondary_in_reload]] rld[rld[secondary_in_reload].secondary_in_reload].when_needed
= RELOAD_FOR_OPADDR_ADDR; = RELOAD_FOR_OPADDR_ADDR;
} }
if ((reload_when_needed[i] == RELOAD_FOR_OUTPUT_ADDRESS if ((rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OUTADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
&& reload_secondary_out_reload[i] != -1) && rld[i].secondary_out_reload != -1)
{ {
int secondary_out_reload = reload_secondary_out_reload[i]; int secondary_out_reload = rld[i].secondary_out_reload;
reload_when_needed[secondary_out_reload] rld[secondary_out_reload].when_needed
= RELOAD_FOR_OPADDR_ADDR; = RELOAD_FOR_OPADDR_ADDR;
/* If there's a tertiary reload we have to change it also. */ /* If there's a tertiary reload we have to change it also. */
if (secondary_out_reload if (secondary_out_reload
&& reload_secondary_out_reload[secondary_out_reload] != -1) && rld[secondary_out_reload].secondary_out_reload != -1)
reload_when_needed[reload_secondary_out_reload[secondary_out_reload]] rld[rld[secondary_out_reload].secondary_out_reload].when_needed
= RELOAD_FOR_OPADDR_ADDR; = RELOAD_FOR_OPADDR_ADDR;
} }
if (reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS if (rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OUTADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
reload_when_needed[i] = RELOAD_FOR_OPADDR_ADDR; rld[i].when_needed = RELOAD_FOR_OPADDR_ADDR;
else else
reload_when_needed[i] = RELOAD_FOR_OPERAND_ADDRESS; rld[i].when_needed = RELOAD_FOR_OPERAND_ADDRESS;
} }
if ((reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS if ((rld[i].when_needed == RELOAD_FOR_INPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
&& operand_reloadnum[reload_opnum[i]] >= 0 && operand_reloadnum[rld[i].opnum] >= 0
&& (reload_when_needed[operand_reloadnum[reload_opnum[i]]] && (rld[operand_reloadnum[rld[i].opnum]].when_needed
== RELOAD_OTHER)) == RELOAD_OTHER))
reload_when_needed[i] = RELOAD_FOR_OTHER_ADDRESS; rld[i].when_needed = RELOAD_FOR_OTHER_ADDRESS;
if (goal_alternative_matches[reload_opnum[i]] >= 0) if (goal_alternative_matches[rld[i].opnum] >= 0)
reload_opnum[i] = goal_alternative_matches[reload_opnum[i]]; rld[i].opnum = goal_alternative_matches[rld[i].opnum];
} }
/* Scan all the reloads, and check for RELOAD_FOR_OPERAND_ADDRESS reloads. /* Scan all the reloads, and check for RELOAD_FOR_OPERAND_ADDRESS reloads.
...@@ -4089,7 +4015,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -4089,7 +4015,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
first_inpaddr_num[i] = first_outpaddr_num[i] = -2; first_inpaddr_num[i] = first_outpaddr_num[i] = -2;
for (i = n_reloads - 1; i >= 0; i--) for (i = n_reloads - 1; i >= 0; i--)
{ {
switch (reload_when_needed[i]) switch (rld[i].when_needed)
{ {
case RELOAD_FOR_OPERAND_ADDRESS: case RELOAD_FOR_OPERAND_ADDRESS:
if (++first_op_addr_num >= 0) if (++first_op_addr_num >= 0)
...@@ -4099,16 +4025,16 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -4099,16 +4025,16 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
} }
break; break;
case RELOAD_FOR_INPUT_ADDRESS: case RELOAD_FOR_INPUT_ADDRESS:
if (++first_inpaddr_num[reload_opnum[i]] >= 0) if (++first_inpaddr_num[rld[i].opnum] >= 0)
{ {
first_inpaddr_num[reload_opnum[i]] = i; first_inpaddr_num[rld[i].opnum] = i;
need_change = 1; need_change = 1;
} }
break; break;
case RELOAD_FOR_OUTPUT_ADDRESS: case RELOAD_FOR_OUTPUT_ADDRESS:
if (++first_outpaddr_num[reload_opnum[i]] >= 0) if (++first_outpaddr_num[rld[i].opnum] >= 0)
{ {
first_outpaddr_num[reload_opnum[i]] = i; first_outpaddr_num[rld[i].opnum] = i;
need_change = 1; need_change = 1;
} }
break; break;
...@@ -4123,18 +4049,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -4123,18 +4049,18 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
{ {
int first_num, type; int first_num, type;
switch (reload_when_needed[i]) switch (rld[i].when_needed)
{ {
case RELOAD_FOR_OPADDR_ADDR: case RELOAD_FOR_OPADDR_ADDR:
first_num = first_op_addr_num; first_num = first_op_addr_num;
type = RELOAD_FOR_OPERAND_ADDRESS; type = RELOAD_FOR_OPERAND_ADDRESS;
break; break;
case RELOAD_FOR_INPADDR_ADDRESS: case RELOAD_FOR_INPADDR_ADDRESS:
first_num = first_inpaddr_num[reload_opnum[i]]; first_num = first_inpaddr_num[rld[i].opnum];
type = RELOAD_FOR_INPUT_ADDRESS; type = RELOAD_FOR_INPUT_ADDRESS;
break; break;
case RELOAD_FOR_OUTADDR_ADDRESS: case RELOAD_FOR_OUTADDR_ADDRESS:
first_num = first_outpaddr_num[reload_opnum[i]]; first_num = first_outpaddr_num[rld[i].opnum];
type = RELOAD_FOR_OUTPUT_ADDRESS; type = RELOAD_FOR_OUTPUT_ADDRESS;
break; break;
default: default:
...@@ -4143,19 +4069,19 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -4143,19 +4069,19 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
if (first_num < 0) if (first_num < 0)
continue; continue;
else if (i > first_num) else if (i > first_num)
reload_when_needed[i] = type; rld[i].when_needed = type;
else else
{ {
/* Check if the only TYPE reload that uses reload I is /* Check if the only TYPE reload that uses reload I is
reload FIRST_NUM. */ reload FIRST_NUM. */
for (j = n_reloads - 1; j > first_num; j--) for (j = n_reloads - 1; j > first_num; j--)
{ {
if (reload_when_needed[j] == type if (rld[j].when_needed == type
&& (reload_secondary_p[i] && (rld[i].secondary_p
? reload_secondary_in_reload[j] == i ? rld[j].secondary_in_reload == i
: reg_mentioned_p (reload_in[i], reload_in[j]))) : reg_mentioned_p (rld[i].in, rld[j].in)))
{ {
reload_when_needed[i] = type; rld[i].when_needed = type;
break; break;
} }
} }
...@@ -4170,21 +4096,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -4170,21 +4096,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
check for the most common cases. */ check for the most common cases. */
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if (reload_in[i] != 0 && reload_out[i] == 0 if (rld[i].in != 0 && rld[i].out == 0
&& (reload_when_needed[i] == RELOAD_FOR_OPERAND_ADDRESS && (rld[i].when_needed == RELOAD_FOR_OPERAND_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_OPADDR_ADDR || rld[i].when_needed == RELOAD_FOR_OPADDR_ADDR
|| reload_when_needed[i] == RELOAD_FOR_OTHER_ADDRESS)) || rld[i].when_needed == RELOAD_FOR_OTHER_ADDRESS))
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if (i != j && reload_in[j] != 0 && reload_out[j] == 0 if (i != j && rld[j].in != 0 && rld[j].out == 0
&& reload_when_needed[j] == reload_when_needed[i] && rld[j].when_needed == rld[i].when_needed
&& MATCHES (reload_in[i], reload_in[j]) && MATCHES (rld[i].in, rld[j].in)
&& reload_reg_class[i] == reload_reg_class[j] && rld[i].class == rld[j].class
&& !reload_nocombine[i] && !reload_nocombine[j] && !rld[i].nocombine && !rld[j].nocombine
&& reload_reg_rtx[i] == reload_reg_rtx[j]) && rld[i].reg_rtx == rld[j].reg_rtx)
{ {
reload_opnum[i] = MIN (reload_opnum[i], reload_opnum[j]); rld[i].opnum = MIN (rld[i].opnum, rld[j].opnum);
transfer_replacements (i, j); transfer_replacements (i, j);
reload_in[j] = 0; rld[j].in = 0;
} }
/* Set which reloads must use registers not used in any group. Start /* Set which reloads must use registers not used in any group. Start
...@@ -4194,28 +4120,28 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -4194,28 +4120,28 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
changed = 0; changed = 0;
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
{ {
enum machine_mode mode = reload_inmode[i]; enum machine_mode mode = rld[i].inmode;
enum reg_class class = reload_reg_class[i]; enum reg_class class = rld[i].class;
int size; int size;
if (GET_MODE_SIZE (reload_outmode[i]) > GET_MODE_SIZE (mode)) if (GET_MODE_SIZE (rld[i].outmode) > GET_MODE_SIZE (mode))
mode = reload_outmode[i]; mode = rld[i].outmode;
size = CLASS_MAX_NREGS (class, mode); size = CLASS_MAX_NREGS (class, mode);
if (size == 1) if (size == 1)
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if ((CLASS_MAX_NREGS (reload_reg_class[j], if ((CLASS_MAX_NREGS (rld[j].class,
(GET_MODE_SIZE (reload_outmode[j]) (GET_MODE_SIZE (rld[j].outmode)
> GET_MODE_SIZE (reload_inmode[j])) > GET_MODE_SIZE (rld[j].inmode))
? reload_outmode[j] : reload_inmode[j]) ? rld[j].outmode : rld[j].inmode)
> 1) > 1)
&& !reload_optional[j] && !rld[j].optional
&& (reload_in[j] != 0 || reload_out[j] != 0 && (rld[j].in != 0 || rld[j].out != 0
|| reload_secondary_p[j]) || rld[j].secondary_p)
&& reloads_conflict (i, j) && reloads_conflict (i, j)
&& reg_classes_intersect_p (class, reload_reg_class[j])) && reg_classes_intersect_p (class, rld[j].class))
{ {
reload_nongroup[i] = 1; rld[i].nongroup = 1;
changed = 1; changed = 1;
break; break;
} }
...@@ -4227,21 +4153,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) ...@@ -4227,21 +4153,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
{ {
enum machine_mode mode = reload_inmode[i]; enum machine_mode mode = rld[i].inmode;
enum reg_class class = reload_reg_class[i]; enum reg_class class = rld[i].class;
int size; int size;
if (GET_MODE_SIZE (reload_outmode[i]) > GET_MODE_SIZE (mode)) if (GET_MODE_SIZE (rld[i].outmode) > GET_MODE_SIZE (mode))
mode = reload_outmode[i]; mode = rld[i].outmode;
size = CLASS_MAX_NREGS (class, mode); size = CLASS_MAX_NREGS (class, mode);
if (! reload_nongroup[i] && size == 1) if (! rld[i].nongroup && size == 1)
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if (reload_nongroup[j] if (rld[j].nongroup
&& reloads_conflict (i, j) && reloads_conflict (i, j)
&& reg_classes_intersect_p (class, reload_reg_class[j])) && reg_classes_intersect_p (class, rld[j].class))
{ {
reload_nongroup[i] = 1; rld[i].nongroup = 1;
changed = 1; changed = 1;
break; break;
} }
...@@ -5363,7 +5289,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn) ...@@ -5363,7 +5289,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
(context ? INDEX_REG_CLASS : BASE_REG_CLASS), (context ? INDEX_REG_CLASS : BASE_REG_CLASS),
GET_MODE (x), GET_MODE (x), 0, 0, GET_MODE (x), GET_MODE (x), 0, 0,
opnum, type); opnum, type);
reload_inc[reloadnum] rld[reloadnum].inc
= find_inc_amount (PATTERN (this_insn), XEXP (x_orig, 0)); = find_inc_amount (PATTERN (this_insn), XEXP (x_orig, 0));
value = 1; value = 1;
...@@ -5388,7 +5314,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn) ...@@ -5388,7 +5314,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
of an equivalent address for a pseudo that was not allocated to a of an equivalent address for a pseudo that was not allocated to a
hard register. Verify that the specified address is valid and hard register. Verify that the specified address is valid and
reload it into a register. */ reload it into a register. */
/* Variable `tem' might or might not be used in FIND_REG_INC_NOTE. */ /* Variable `tem' might or might not be used in FIND_REG_INC_NOTE. */
rtx tem ATTRIBUTE_UNUSED = XEXP (x, 0); rtx tem ATTRIBUTE_UNUSED = XEXP (x, 0);
register rtx link; register rtx link;
int reloadnum; int reloadnum;
...@@ -5409,7 +5335,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn) ...@@ -5409,7 +5335,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
reloadnum = push_reload (x, NULL_RTX, loc, NULL_PTR, reloadnum = push_reload (x, NULL_RTX, loc, NULL_PTR,
(context ? INDEX_REG_CLASS : BASE_REG_CLASS), (context ? INDEX_REG_CLASS : BASE_REG_CLASS),
GET_MODE (x), VOIDmode, 0, 0, opnum, type); GET_MODE (x), VOIDmode, 0, 0, opnum, type);
reload_inc[reloadnum] rld[reloadnum].inc
= find_inc_amount (PATTERN (this_insn), XEXP (x, 0)); = find_inc_amount (PATTERN (this_insn), XEXP (x, 0));
link = FIND_REG_INC_NOTE (this_insn, tem); link = FIND_REG_INC_NOTE (this_insn, tem);
...@@ -5725,7 +5651,7 @@ subst_reloads () ...@@ -5725,7 +5651,7 @@ subst_reloads ()
for (i = 0; i < n_replacements; i++) for (i = 0; i < n_replacements; i++)
{ {
register struct replacement *r = &replacements[i]; register struct replacement *r = &replacements[i];
register rtx reloadreg = reload_reg_rtx[r->what]; register rtx reloadreg = rld[r->what].reg_rtx;
if (reloadreg) if (reloadreg)
{ {
/* Encapsulate RELOADREG so its machine mode matches what /* Encapsulate RELOADREG so its machine mode matches what
...@@ -5754,7 +5680,7 @@ subst_reloads () ...@@ -5754,7 +5680,7 @@ subst_reloads ()
*r->where = reloadreg; *r->where = reloadreg;
} }
/* If reload got no reg and isn't optional, something's wrong. */ /* If reload got no reg and isn't optional, something's wrong. */
else if (! reload_optional[r->what]) else if (! rld[r->what].optional)
abort (); abort ();
} }
} }
...@@ -5831,7 +5757,7 @@ find_replacement (loc) ...@@ -5831,7 +5757,7 @@ find_replacement (loc)
for (r = &replacements[0]; r < &replacements[n_replacements]; r++) for (r = &replacements[0]; r < &replacements[n_replacements]; r++)
{ {
rtx reloadreg = reload_reg_rtx[r->what]; rtx reloadreg = rld[r->what].reg_rtx;
if (reloadreg && r->where == loc) if (reloadreg && r->where == loc)
{ {
...@@ -6334,11 +6260,11 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode) ...@@ -6334,11 +6260,11 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
{ {
int i; int i;
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if (reload_reg_rtx[i] != 0 && reload_in[i]) if (rld[i].reg_rtx != 0 && rld[i].in)
{ {
int regno1 = REGNO (reload_reg_rtx[i]); int regno1 = REGNO (rld[i].reg_rtx);
int nregs1 = HARD_REGNO_NREGS (regno1, int nregs1 = HARD_REGNO_NREGS (regno1,
GET_MODE (reload_reg_rtx[i])); GET_MODE (rld[i].reg_rtx));
if (regno1 < valueno + valuenregs if (regno1 < valueno + valuenregs
&& regno1 + nregs1 > valueno) && regno1 + nregs1 > valueno)
return 0; return 0;
...@@ -6663,84 +6589,84 @@ debug_reload_to_stream (f) ...@@ -6663,84 +6589,84 @@ debug_reload_to_stream (f)
{ {
fprintf (f, "Reload %d: ", r); fprintf (f, "Reload %d: ", r);
if (reload_in[r] != 0) if (rld[r].in != 0)
{ {
fprintf (f, "reload_in (%s) = ", fprintf (f, "reload_in (%s) = ",
GET_MODE_NAME (reload_inmode[r])); GET_MODE_NAME (rld[r].inmode));
print_inline_rtx (f, reload_in[r], 24); print_inline_rtx (f, rld[r].in, 24);
fprintf (f, "\n\t"); fprintf (f, "\n\t");
} }
if (reload_out[r] != 0) if (rld[r].out != 0)
{ {
fprintf (f, "reload_out (%s) = ", fprintf (f, "reload_out (%s) = ",
GET_MODE_NAME (reload_outmode[r])); GET_MODE_NAME (rld[r].outmode));
print_inline_rtx (f, reload_out[r], 24); print_inline_rtx (f, rld[r].out, 24);
fprintf (f, "\n\t"); fprintf (f, "\n\t");
} }
fprintf (f, "%s, ", reg_class_names[(int) reload_reg_class[r]]); fprintf (f, "%s, ", reg_class_names[(int) rld[r].class]);
fprintf (f, "%s (opnum = %d)", fprintf (f, "%s (opnum = %d)",
reload_when_needed_name[(int) reload_when_needed[r]], reload_when_needed_name[(int) rld[r].when_needed],
reload_opnum[r]); rld[r].opnum);
if (reload_optional[r]) if (rld[r].optional)
fprintf (f, ", optional"); fprintf (f, ", optional");
if (reload_nongroup[r]) if (rld[r].nongroup)
fprintf (stderr, ", nongroup"); fprintf (stderr, ", nongroup");
if (reload_inc[r] != 0) if (rld[r].inc != 0)
fprintf (f, ", inc by %d", reload_inc[r]); fprintf (f, ", inc by %d", rld[r].inc);
if (reload_nocombine[r]) if (rld[r].nocombine)
fprintf (f, ", can't combine"); fprintf (f, ", can't combine");
if (reload_secondary_p[r]) if (rld[r].secondary_p)
fprintf (f, ", secondary_reload_p"); fprintf (f, ", secondary_reload_p");
if (reload_in_reg[r] != 0) if (rld[r].in_reg != 0)
{ {
fprintf (f, "\n\treload_in_reg: "); fprintf (f, "\n\treload_in_reg: ");
print_inline_rtx (f, reload_in_reg[r], 24); print_inline_rtx (f, rld[r].in_reg, 24);
} }
if (reload_out_reg[r] != 0) if (rld[r].out_reg != 0)
{ {
fprintf (f, "\n\treload_out_reg: "); fprintf (f, "\n\treload_out_reg: ");
print_inline_rtx (f, reload_out_reg[r], 24); print_inline_rtx (f, rld[r].out_reg, 24);
} }
if (reload_reg_rtx[r] != 0) if (rld[r].reg_rtx != 0)
{ {
fprintf (f, "\n\treload_reg_rtx: "); fprintf (f, "\n\treload_reg_rtx: ");
print_inline_rtx (f, reload_reg_rtx[r], 24); print_inline_rtx (f, rld[r].reg_rtx, 24);
} }
prefix = "\n\t"; prefix = "\n\t";
if (reload_secondary_in_reload[r] != -1) if (rld[r].secondary_in_reload != -1)
{ {
fprintf (f, "%ssecondary_in_reload = %d", fprintf (f, "%ssecondary_in_reload = %d",
prefix, reload_secondary_in_reload[r]); prefix, rld[r].secondary_in_reload);
prefix = ", "; prefix = ", ";
} }
if (reload_secondary_out_reload[r] != -1) if (rld[r].secondary_out_reload != -1)
fprintf (f, "%ssecondary_out_reload = %d\n", fprintf (f, "%ssecondary_out_reload = %d\n",
prefix, reload_secondary_out_reload[r]); prefix, rld[r].secondary_out_reload);
prefix = "\n\t"; prefix = "\n\t";
if (reload_secondary_in_icode[r] != CODE_FOR_nothing) if (rld[r].secondary_in_icode != CODE_FOR_nothing)
{ {
fprintf (stderr, "%ssecondary_in_icode = %s", prefix, fprintf (stderr, "%ssecondary_in_icode = %s", prefix,
insn_data[reload_secondary_in_icode[r]].name); insn_data[rld[r].secondary_in_icode].name);
prefix = ", "; prefix = ", ";
} }
if (reload_secondary_out_icode[r] != CODE_FOR_nothing) if (rld[r].secondary_out_icode != CODE_FOR_nothing)
fprintf (stderr, "%ssecondary_out_icode = %s", prefix, fprintf (stderr, "%ssecondary_out_icode = %s", prefix,
insn_data[reload_secondary_out_icode[r]].name); insn_data[rld[r].secondary_out_icode].name);
fprintf (f, "\n"); fprintf (f, "\n");
} }
......
...@@ -45,33 +45,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -45,33 +45,9 @@ Boston, MA 02111-1307, USA. */
#endif #endif
extern int memory_move_secondary_cost PROTO ((enum machine_mode, enum reg_class, int)); extern int memory_move_secondary_cost PROTO ((enum machine_mode, enum reg_class, int));
/* See reload.c and reload1.c for comments on these variables. */
/* Maximum number of reloads we can need. */ /* Maximum number of reloads we can need. */
#define MAX_RELOADS (2 * MAX_RECOG_OPERANDS * (MAX_REGS_PER_ADDRESS + 1)) #define MAX_RELOADS (2 * MAX_RECOG_OPERANDS * (MAX_REGS_PER_ADDRESS + 1))
extern rtx reload_in[MAX_RELOADS];
extern rtx reload_out[MAX_RELOADS];
extern rtx reload_in_reg[MAX_RELOADS];
extern rtx reload_out_reg[MAX_RELOADS];
extern enum reg_class reload_reg_class[MAX_RELOADS];
extern enum machine_mode reload_inmode[MAX_RELOADS];
extern enum machine_mode reload_outmode[MAX_RELOADS];
extern char reload_optional[MAX_RELOADS];
extern char reload_nongroup[MAX_RELOADS];
extern int reload_inc[MAX_RELOADS];
extern int reload_opnum[MAX_RELOADS];
extern int reload_secondary_p[MAX_RELOADS];
extern int reload_secondary_in_reload[MAX_RELOADS];
extern int reload_secondary_out_reload[MAX_RELOADS];
#ifdef MAX_INSN_CODE
extern enum insn_code reload_secondary_in_icode[MAX_RELOADS];
extern enum insn_code reload_secondary_out_icode[MAX_RELOADS];
#endif
extern int n_reloads;
extern rtx reload_reg_rtx[MAX_RELOADS];
/* Encode the usage of a reload. The following codes are supported: /* Encode the usage of a reload. The following codes are supported:
RELOAD_FOR_INPUT reload of an input operand RELOAD_FOR_INPUT reload of an input operand
...@@ -105,7 +81,81 @@ enum reload_type ...@@ -105,7 +81,81 @@ enum reload_type
RELOAD_OTHER, RELOAD_FOR_OTHER_ADDRESS RELOAD_OTHER, RELOAD_FOR_OTHER_ADDRESS
}; };
extern enum reload_type reload_when_needed[MAX_RELOADS]; #ifdef MAX_INSN_CODE
/* Each reload is recorded with a structure like this. */
struct reload
{
/* The value to reload from */
rtx in;
/* Where to store reload-reg afterward if nec (often the same as
reload_in) */
rtx out;
/* The class of registers to reload into. */
enum reg_class class;
/* The mode this operand should have when reloaded, on input. */
enum machine_mode inmode;
/* The mode this operand should have when reloaded, on output. */
enum machine_mode outmode;
/* Positive amount to increment or decrement by if
reload_in is a PRE_DEC, PRE_INC, POST_DEC, POST_INC.
Ignored otherwise (don't assume it is zero). */
int inc;
/* A reg for which reload_in is the equivalent.
If reload_in is a symbol_ref which came from
reg_equiv_constant, then this is the pseudo
which has that symbol_ref as equivalent. */
rtx in_reg;
rtx out_reg;
/* Used in find_reload_regs to record the allocated register. */
int regno;
/* This is the register to reload into. If it is zero when `find_reloads'
returns, you must find a suitable register in the class specified by
reload_reg_class, and store here an rtx for that register with mode from
reload_inmode or reload_outmode. */
rtx reg_rtx;
/* The operand number being reloaded. This is used to group related reloads
and need not always be equal to the actual operand number in the insn,
though it current will be; for in-out operands, it is one of the two
operand numbers. */
int opnum;
/* Gives the reload number of a secondary input reload, when needed;
otherwise -1. */
int secondary_in_reload;
/* Gives the reload number of a secondary output reload, when needed;
otherwise -1. */
int secondary_out_reload;
/* If a secondary input reload is required, gives the INSN_CODE that uses the
secondary reload as a scratch register, or CODE_FOR_nothing if the
secondary reload register is to be an intermediate register. */
enum insn_code secondary_in_icode;
/* Likewise, for a secondary output reload. */
enum insn_code secondary_out_icode;
/* Classifies reload as needed either for addressing an input reload,
addressing an output, for addressing a non-reloaded mem ref, or for
unspecified purposes (i.e., more than one of the above). */
enum reload_type when_needed;
/* Nonzero for an optional reload. Optional reloads are ignored unless the
value is already sitting in a register. */
unsigned int optional:1;
/* nonzero if this reload shouldn't be combined with another reload. */
unsigned int nocombine:1;
/* Nonzero if this is a secondary register for one or more reloads. */
unsigned int secondary_p:1;
/* Nonzero if this reload must use a register not already allocated to a
group. */
unsigned int nongroup:1;
};
extern struct reload rld[MAX_RELOADS];
extern int n_reloads;
#endif
extern rtx *reg_equiv_constant; extern rtx *reg_equiv_constant;
extern rtx *reg_equiv_memory_loc; extern rtx *reg_equiv_memory_loc;
......
...@@ -1502,7 +1502,7 @@ calculate_needs (chain) ...@@ -1502,7 +1502,7 @@ calculate_needs (chain)
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
{ {
register enum reg_class *p; register enum reg_class *p;
enum reg_class class = reload_reg_class[i]; enum reg_class class = rld[i].class;
int size; int size;
enum machine_mode mode; enum machine_mode mode;
struct needs *this_needs; struct needs *this_needs;
...@@ -1511,19 +1511,19 @@ calculate_needs (chain) ...@@ -1511,19 +1511,19 @@ calculate_needs (chain)
regs mentioned in the insn can be used for reloading. regs mentioned in the insn can be used for reloading.
Don't count optional reloads. Don't count optional reloads.
Don't count reloads that got combined with others. */ Don't count reloads that got combined with others. */
if (reload_reg_rtx[i] != 0 if (rld[i].reg_rtx != 0
|| reload_optional[i] != 0 || rld[i].optional != 0
|| (reload_out[i] == 0 && reload_in[i] == 0 || (rld[i].out == 0 && rld[i].in == 0
&& ! reload_secondary_p[i])) && ! rld[i].secondary_p))
continue; continue;
mode = reload_inmode[i]; mode = rld[i].inmode;
if (GET_MODE_SIZE (reload_outmode[i]) > GET_MODE_SIZE (mode)) if (GET_MODE_SIZE (rld[i].outmode) > GET_MODE_SIZE (mode))
mode = reload_outmode[i]; mode = rld[i].outmode;
size = CLASS_MAX_NREGS (class, mode); size = CLASS_MAX_NREGS (class, mode);
/* Decide which time-of-use to count this reload for. */ /* Decide which time-of-use to count this reload for. */
switch (reload_when_needed[i]) switch (rld[i].when_needed)
{ {
case RELOAD_OTHER: case RELOAD_OTHER:
this_needs = &insn_needs.other; this_needs = &insn_needs.other;
...@@ -1541,16 +1541,16 @@ calculate_needs (chain) ...@@ -1541,16 +1541,16 @@ calculate_needs (chain)
this_needs = &insn_needs.other_addr; this_needs = &insn_needs.other_addr;
break; break;
case RELOAD_FOR_INPUT_ADDRESS: case RELOAD_FOR_INPUT_ADDRESS:
this_needs = &insn_needs.in_addr[reload_opnum[i]]; this_needs = &insn_needs.in_addr[rld[i].opnum];
break; break;
case RELOAD_FOR_INPADDR_ADDRESS: case RELOAD_FOR_INPADDR_ADDRESS:
this_needs = &insn_needs.in_addr_addr[reload_opnum[i]]; this_needs = &insn_needs.in_addr_addr[rld[i].opnum];
break; break;
case RELOAD_FOR_OUTPUT_ADDRESS: case RELOAD_FOR_OUTPUT_ADDRESS:
this_needs = &insn_needs.out_addr[reload_opnum[i]]; this_needs = &insn_needs.out_addr[rld[i].opnum];
break; break;
case RELOAD_FOR_OUTADDR_ADDRESS: case RELOAD_FOR_OUTADDR_ADDRESS:
this_needs = &insn_needs.out_addr_addr[reload_opnum[i]]; this_needs = &insn_needs.out_addr_addr[rld[i].opnum];
break; break;
case RELOAD_FOR_OPERAND_ADDRESS: case RELOAD_FOR_OPERAND_ADDRESS:
this_needs = &insn_needs.op_addr; this_needs = &insn_needs.op_addr;
...@@ -1601,10 +1601,10 @@ calculate_needs (chain) ...@@ -1601,10 +1601,10 @@ calculate_needs (chain)
} }
else if (size == 1) else if (size == 1)
{ {
this_needs->regs[(unsigned char)reload_nongroup[i]][(int) class] += 1; this_needs->regs[(unsigned char)rld[i].nongroup][(int) class] += 1;
p = reg_class_superclasses[(int) class]; p = reg_class_superclasses[(int) class];
while (*p != LIM_REG_CLASSES) while (*p != LIM_REG_CLASSES)
this_needs->regs[(unsigned char)reload_nongroup[i]][(int) *p++] += 1; this_needs->regs[(unsigned char)rld[i].nongroup][(int) *p++] += 1;
} }
else else
abort (); abort ();
...@@ -4353,7 +4353,7 @@ reload_as_needed (live_known) ...@@ -4353,7 +4353,7 @@ reload_as_needed (live_known)
which have been performed by subst_reloads above. */ which have been performed by subst_reloads above. */
for (i = n_reloads - 1; i >= 0; i--) for (i = n_reloads - 1; i >= 0; i--)
{ {
rtx in_reg = reload_in_reg[i]; rtx in_reg = rld[i].in_reg;
if (in_reg) if (in_reg)
{ {
enum rtx_code code = GET_CODE (in_reg); enum rtx_code code = GET_CODE (in_reg);
...@@ -4364,14 +4364,14 @@ reload_as_needed (live_known) ...@@ -4364,14 +4364,14 @@ reload_as_needed (live_known)
or we can't use the reload register for inheritance. */ or we can't use the reload register for inheritance. */
if ((code == POST_INC || code == POST_DEC) if ((code == POST_INC || code == POST_DEC)
&& TEST_HARD_REG_BIT (reg_reloaded_valid, && TEST_HARD_REG_BIT (reg_reloaded_valid,
REGNO (reload_reg_rtx[i])) REGNO (rld[i].reg_rtx))
/* Make sure it is the inc/dec pseudo, and not /* Make sure it is the inc/dec pseudo, and not
some other (e.g. output operand) pseudo. */ some other (e.g. output operand) pseudo. */
&& (reg_reloaded_contents[REGNO (reload_reg_rtx[i])] && (reg_reloaded_contents[REGNO (rld[i].reg_rtx)]
== REGNO (XEXP (in_reg, 0)))) == REGNO (XEXP (in_reg, 0))))
{ {
rtx reload_reg = reload_reg_rtx[i]; rtx reload_reg = rld[i].reg_rtx;
enum machine_mode mode = GET_MODE (reload_reg); enum machine_mode mode = GET_MODE (reload_reg);
int n = 0; int n = 0;
rtx p; rtx p;
...@@ -4430,14 +4430,14 @@ reload_as_needed (live_known) ...@@ -4430,14 +4430,14 @@ reload_as_needed (live_known)
} }
else if ((code == PRE_INC || code == PRE_DEC) else if ((code == PRE_INC || code == PRE_DEC)
&& TEST_HARD_REG_BIT (reg_reloaded_valid, && TEST_HARD_REG_BIT (reg_reloaded_valid,
REGNO (reload_reg_rtx[i])) REGNO (rld[i].reg_rtx))
/* Make sure it is the inc/dec pseudo, and not /* Make sure it is the inc/dec pseudo, and not
some other (e.g. output operand) pseudo. */ some other (e.g. output operand) pseudo. */
&& (reg_reloaded_contents[REGNO (reload_reg_rtx[i])] && (reg_reloaded_contents[REGNO (rld[i].reg_rtx)]
== REGNO (XEXP (in_reg, 0)))) == REGNO (XEXP (in_reg, 0))))
{ {
SET_HARD_REG_BIT (reg_is_output_reload, SET_HARD_REG_BIT (reg_is_output_reload,
REGNO (reload_reg_rtx[i])); REGNO (rld[i].reg_rtx));
reg_has_output_reload[REGNO (XEXP (in_reg, 0))] = 1; reg_has_output_reload[REGNO (XEXP (in_reg, 0))] = 1;
} }
} }
...@@ -4452,7 +4452,7 @@ reload_as_needed (live_known) ...@@ -4452,7 +4452,7 @@ reload_as_needed (live_known)
If so, its last-reload info is still valid If so, its last-reload info is still valid
because it is based on this insn's reload. */ because it is based on this insn's reload. */
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
if (reload_out[i] == XEXP (x, 0)) if (rld[i].out == XEXP (x, 0))
break; break;
if (i == n_reloads) if (i == n_reloads)
...@@ -4559,13 +4559,13 @@ reload_reg_class_lower (r1p, r2p) ...@@ -4559,13 +4559,13 @@ reload_reg_class_lower (r1p, r2p)
register int t; register int t;
/* Consider required reloads before optional ones. */ /* Consider required reloads before optional ones. */
t = reload_optional[r1] - reload_optional[r2]; t = rld[r1].optional - rld[r2].optional;
if (t != 0) if (t != 0)
return t; return t;
/* Count all solitary classes before non-solitary ones. */ /* Count all solitary classes before non-solitary ones. */
t = ((reg_class_size[(int) reload_reg_class[r2]] == 1) t = ((reg_class_size[(int) rld[r2].class] == 1)
- (reg_class_size[(int) reload_reg_class[r1]] == 1)); - (reg_class_size[(int) rld[r1].class] == 1));
if (t != 0) if (t != 0)
return t; return t;
...@@ -4575,7 +4575,7 @@ reload_reg_class_lower (r1p, r2p) ...@@ -4575,7 +4575,7 @@ reload_reg_class_lower (r1p, r2p)
return t; return t;
/* Consider reloads in order of increasing reg-class number. */ /* Consider reloads in order of increasing reg-class number. */
t = (int) reload_reg_class[r1] - (int) reload_reg_class[r2]; t = (int) rld[r1].class - (int) rld[r2].class;
if (t != 0) if (t != 0)
return t; return t;
...@@ -4774,11 +4774,11 @@ clear_reload_reg_in_use (regno, opnum, type, mode) ...@@ -4774,11 +4774,11 @@ clear_reload_reg_in_use (regno, opnum, type, mode)
{ {
for (i = n_reloads - 1; i >= 0; i--) for (i = n_reloads - 1; i >= 0; i--)
{ {
if (reload_when_needed[i] == type if (rld[i].when_needed == type
&& (check_any || reload_opnum[i] == opnum) && (check_any || rld[i].opnum == opnum)
&& reload_reg_rtx[i]) && rld[i].reg_rtx)
{ {
int conflict_start = true_regnum (reload_reg_rtx[i]); int conflict_start = true_regnum (rld[i].reg_rtx);
int conflict_end int conflict_end
= (conflict_start = (conflict_start
+ HARD_REGNO_NREGS (conflict_start, reload_mode[i])); + HARD_REGNO_NREGS (conflict_start, reload_mode[i]));
...@@ -5093,10 +5093,10 @@ int ...@@ -5093,10 +5093,10 @@ int
reloads_conflict (r1, r2) reloads_conflict (r1, r2)
int r1, r2; int r1, r2;
{ {
enum reload_type r1_type = reload_when_needed[r1]; enum reload_type r1_type = rld[r1].when_needed;
enum reload_type r2_type = reload_when_needed[r2]; enum reload_type r2_type = rld[r2].when_needed;
int r1_opnum = reload_opnum[r1]; int r1_opnum = rld[r1].opnum;
int r2_opnum = reload_opnum[r2]; int r2_opnum = rld[r2].opnum;
/* RELOAD_OTHER conflicts with everything. */ /* RELOAD_OTHER conflicts with everything. */
if (r2_type == RELOAD_OTHER) if (r2_type == RELOAD_OTHER)
...@@ -5282,17 +5282,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5282,17 +5282,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
for (i = 0; i < n_reloads; i++) for (i = 0; i < n_reloads; i++)
{ {
rtx reg = reload_reg_rtx[i]; rtx reg = rld[i].reg_rtx;
if (reg && GET_CODE (reg) == REG if (reg && GET_CODE (reg) == REG
&& ((unsigned) regno - true_regnum (reg) && ((unsigned) regno - true_regnum (reg)
<= HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)) - (unsigned)1) <= HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)) - (unsigned)1)
&& i != reloadnum) && i != reloadnum)
{ {
if (! reload_in[i] || ! rtx_equal_p (reload_in[i], value) if (! rld[i].in || ! rtx_equal_p (rld[i].in, value)
|| reload_out[i] || out) || rld[i].out || out)
{ {
int time2; int time2;
switch (reload_when_needed[i]) switch (rld[i].when_needed)
{ {
case RELOAD_FOR_OTHER_ADDRESS: case RELOAD_FOR_OTHER_ADDRESS:
time2 = 0; time2 = 0;
...@@ -5309,34 +5309,34 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5309,34 +5309,34 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
/* Unless the RELOAD_FOR_INPUT is an auto_inc expression. /* Unless the RELOAD_FOR_INPUT is an auto_inc expression.
Then the address address is still needed to store Then the address address is still needed to store
back the new address. */ back the new address. */
&& ! reload_out[reloadnum]) && ! rld[reloadnum].out)
continue; continue;
/* Likewise, if a RELOAD_FOR_INPUT can inherit a value, its /* Likewise, if a RELOAD_FOR_INPUT can inherit a value, its
RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS
reloads go away. */ reloads go away. */
if (type == RELOAD_FOR_INPUT && opnum == reload_opnum[i] if (type == RELOAD_FOR_INPUT && opnum == rld[i].opnum
&& ignore_address_reloads && ignore_address_reloads
/* Unless we are reloading an auto_inc expression. */ /* Unless we are reloading an auto_inc expression. */
&& ! reload_out[reloadnum]) && ! rld[reloadnum].out)
continue; continue;
time2 = reload_opnum[i] * 4 + 2; time2 = rld[i].opnum * 4 + 2;
break; break;
case RELOAD_FOR_INPUT_ADDRESS: case RELOAD_FOR_INPUT_ADDRESS:
if (type == RELOAD_FOR_INPUT && opnum == reload_opnum[i] if (type == RELOAD_FOR_INPUT && opnum == rld[i].opnum
&& ignore_address_reloads && ignore_address_reloads
&& ! reload_out[reloadnum]) && ! rld[reloadnum].out)
continue; continue;
time2 = reload_opnum[i] * 4 + 3; time2 = rld[i].opnum * 4 + 3;
break; break;
case RELOAD_FOR_INPUT: case RELOAD_FOR_INPUT:
time2 = reload_opnum[i] * 4 + 4; time2 = rld[i].opnum * 4 + 4;
break; break;
/* reload_opnum[i] * 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4 /* rld[i].opnum * 4 + 4 <= (MAX_RECOG_OPERAND - 1) * 4 + 4
== MAX_RECOG_OPERAND * 4 */ == MAX_RECOG_OPERAND * 4 */
case RELOAD_FOR_OPADDR_ADDR: case RELOAD_FOR_OPADDR_ADDR:
if (type == RELOAD_FOR_OPERAND_ADDRESS && reloadnum == i + 1 if (type == RELOAD_FOR_OPERAND_ADDRESS && reloadnum == i + 1
&& ignore_address_reloads && ignore_address_reloads
&& ! reload_out[reloadnum]) && ! rld[reloadnum].out)
continue; continue;
time2 = MAX_RECOG_OPERANDS * 4 + 1; time2 = MAX_RECOG_OPERANDS * 4 + 1;
break; break;
...@@ -5357,17 +5357,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5357,17 +5357,17 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
case RELOAD_FOR_OUTADDR_ADDRESS: case RELOAD_FOR_OUTADDR_ADDRESS:
if (type == RELOAD_FOR_OUTPUT_ADDRESS && reloadnum == i + 1 if (type == RELOAD_FOR_OUTPUT_ADDRESS && reloadnum == i + 1
&& ignore_address_reloads && ignore_address_reloads
&& ! reload_out[reloadnum]) && ! rld[reloadnum].out)
continue; continue;
time2 = MAX_RECOG_OPERANDS * 4 + 4 + reload_opnum[i]; time2 = MAX_RECOG_OPERANDS * 4 + 4 + rld[i].opnum;
break; break;
case RELOAD_FOR_OUTPUT_ADDRESS: case RELOAD_FOR_OUTPUT_ADDRESS:
time2 = MAX_RECOG_OPERANDS * 4 + 5 + reload_opnum[i]; time2 = MAX_RECOG_OPERANDS * 4 + 5 + rld[i].opnum;
break; break;
case RELOAD_OTHER: case RELOAD_OTHER:
/* If there is no conflict in the input part, handle this /* If there is no conflict in the input part, handle this
like an output reload. */ like an output reload. */
if (! reload_in[i] || rtx_equal_p (reload_in[i], value)) if (! rld[i].in || rtx_equal_p (rld[i].in, value))
{ {
time2 = MAX_RECOG_OPERANDS * 4 + 4; time2 = MAX_RECOG_OPERANDS * 4 + 4;
break; break;
...@@ -5384,9 +5384,9 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5384,9 +5384,9 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
return 0; return 0;
} }
if ((time1 >= time2 if ((time1 >= time2
&& (! reload_in[i] || reload_out[i] && (! rld[i].in || rld[i].out
|| ! rtx_equal_p (reload_in[i], value))) || ! rtx_equal_p (rld[i].in, value)))
|| (out && reload_out_reg[reloadnum] || (out && rld[reloadnum].out_reg
&& time2 >= MAX_RECOG_OPERANDS * 4 + 3)) && time2 >= MAX_RECOG_OPERANDS * 4 + 3))
return 0; return 0;
} }
...@@ -5399,7 +5399,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum, ...@@ -5399,7 +5399,7 @@ reload_reg_free_for_value_p (regno, opnum, type, value, out, reloadnum,
LAST_RELOAD is non-zero if this is the last reload for the insn being LAST_RELOAD is non-zero if this is the last reload for the insn being
processed. processed.
Set reload_reg_rtx[R] to the register allocated. Set rld[R].reg_rtx to the register allocated.
If NOERROR is nonzero, we return 1 if successful, If NOERROR is nonzero, we return 1 if successful,
or 0 if we couldn't find a spill reg and we didn't change anything. */ or 0 if we couldn't find a spill reg and we didn't change anything. */
...@@ -5461,7 +5461,7 @@ allocate_reload_reg (chain, r, last_reload, noerror) ...@@ -5461,7 +5461,7 @@ allocate_reload_reg (chain, r, last_reload, noerror)
for (count = 0; count < n_spills; count++) for (count = 0; count < n_spills; count++)
{ {
int class = (int) reload_reg_class[r]; int class = (int) rld[r].class;
int regnum; int regnum;
i++; i++;
...@@ -5469,17 +5469,17 @@ allocate_reload_reg (chain, r, last_reload, noerror) ...@@ -5469,17 +5469,17 @@ allocate_reload_reg (chain, r, last_reload, noerror)
i -= n_spills; i -= n_spills;
regnum = spill_regs[i]; regnum = spill_regs[i];
if ((reload_reg_free_p (regnum, reload_opnum[r], if ((reload_reg_free_p (regnum, rld[r].opnum,
reload_when_needed[r]) rld[r].when_needed)
|| (reload_in[r] || (rld[r].in
/* We check reload_reg_used to make sure we /* We check reload_reg_used to make sure we
don't clobber the return register. */ don't clobber the return register. */
&& ! TEST_HARD_REG_BIT (reload_reg_used, regnum) && ! TEST_HARD_REG_BIT (reload_reg_used, regnum)
&& reload_reg_free_for_value_p (regnum, && reload_reg_free_for_value_p (regnum,
reload_opnum[r], rld[r].opnum,
reload_when_needed[r], rld[r].when_needed,
reload_in[r], rld[r].in,
reload_out[r], r, 1))) rld[r].out, r, 1)))
&& TEST_HARD_REG_BIT (reg_class_contents[class], regnum) && TEST_HARD_REG_BIT (reg_class_contents[class], regnum)
&& HARD_REGNO_MODE_OK (regnum, reload_mode[r]) && HARD_REGNO_MODE_OK (regnum, reload_mode[r])
/* Look first for regs to share, then for unshared. But /* Look first for regs to share, then for unshared. But
...@@ -5496,7 +5496,7 @@ allocate_reload_reg (chain, r, last_reload, noerror) ...@@ -5496,7 +5496,7 @@ allocate_reload_reg (chain, r, last_reload, noerror)
(on 68000) got us two FP regs. If NR is 1, (on 68000) got us two FP regs. If NR is 1,
we would reject both of them. */ we would reject both of them. */
if (force_group) if (force_group)
nr = CLASS_MAX_NREGS (reload_reg_class[r], reload_mode[r]); nr = CLASS_MAX_NREGS (rld[r].class, reload_mode[r]);
/* If we need only one reg, we have already won. */ /* If we need only one reg, we have already won. */
if (nr == 1) if (nr == 1)
{ {
...@@ -5515,8 +5515,8 @@ allocate_reload_reg (chain, r, last_reload, noerror) ...@@ -5515,8 +5515,8 @@ allocate_reload_reg (chain, r, last_reload, noerror)
regno = regnum + nr - 1; regno = regnum + nr - 1;
if (!(TEST_HARD_REG_BIT (reg_class_contents[class], regno) if (!(TEST_HARD_REG_BIT (reg_class_contents[class], regno)
&& spill_reg_order[regno] >= 0 && spill_reg_order[regno] >= 0
&& reload_reg_free_p (regno, reload_opnum[r], && reload_reg_free_p (regno, rld[r].opnum,
reload_when_needed[r]) rld[r].when_needed)
&& ! TEST_HARD_REG_BIT (chain->counted_for_nongroups, && ! TEST_HARD_REG_BIT (chain->counted_for_nongroups,
regno))) regno)))
break; break;
...@@ -5556,28 +5556,28 @@ allocate_reload_reg (chain, r, last_reload, noerror) ...@@ -5556,28 +5556,28 @@ allocate_reload_reg (chain, r, last_reload, noerror)
if (HARD_REGNO_MODE_OK (regno, reload_mode[r])) if (HARD_REGNO_MODE_OK (regno, reload_mode[r]))
{ {
enum machine_mode test_mode = VOIDmode; enum machine_mode test_mode = VOIDmode;
if (reload_in[r]) if (rld[r].in)
test_mode = GET_MODE (reload_in[r]); test_mode = GET_MODE (rld[r].in);
/* If reload_in[r] has VOIDmode, it means we will load it /* If rld[r].in has VOIDmode, it means we will load it
in whatever mode the reload reg has: to wit, reload_mode[r]. in whatever mode the reload reg has: to wit, reload_mode[r].
We have already tested that for validity. */ We have already tested that for validity. */
/* Aside from that, we need to test that the expressions /* Aside from that, we need to test that the expressions
to reload from or into have modes which are valid for this to reload from or into have modes which are valid for this
reload register. Otherwise the reload insns would be invalid. */ reload register. Otherwise the reload insns would be invalid. */
if (! (reload_in[r] != 0 && test_mode != VOIDmode if (! (rld[r].in != 0 && test_mode != VOIDmode
&& ! HARD_REGNO_MODE_OK (regno, test_mode))) && ! HARD_REGNO_MODE_OK (regno, test_mode)))
if (! (reload_out[r] != 0 if (! (rld[r].out != 0
&& ! HARD_REGNO_MODE_OK (regno, GET_MODE (reload_out[r])))) && ! HARD_REGNO_MODE_OK (regno, GET_MODE (rld[r].out))))
{ {
/* The reg is OK. */ /* The reg is OK. */
last_spill_reg = i; last_spill_reg = i;
/* Mark as in use for this insn the reload regs we use /* Mark as in use for this insn the reload regs we use
for this. */ for this. */
mark_reload_reg_in_use (spill_regs[i], reload_opnum[r], mark_reload_reg_in_use (spill_regs[i], rld[r].opnum,
reload_when_needed[r], reload_mode[r]); rld[r].when_needed, reload_mode[r]);
reload_reg_rtx[r] = new; rld[r].reg_rtx = new;
reload_spill_index[r] = spill_regs[i]; reload_spill_index[r] = spill_regs[i];
return 1; return 1;
} }
...@@ -5596,11 +5596,11 @@ allocate_reload_reg (chain, r, last_reload, noerror) ...@@ -5596,11 +5596,11 @@ allocate_reload_reg (chain, r, last_reload, noerror)
don't match. Disable this reload so we don't crash in final. */ don't match. Disable this reload so we don't crash in final. */
error_for_asm (insn, error_for_asm (insn,
"`asm' operand constraint incompatible with operand size"); "`asm' operand constraint incompatible with operand size");
reload_in[r] = 0; rld[r].in = 0;
reload_out[r] = 0; rld[r].out = 0;
reload_reg_rtx[r] = 0; rld[r].reg_rtx = 0;
reload_optional[r] = 1; rld[r].optional = 1;
reload_secondary_p[r] = 1; rld[r].secondary_p = 1;
return 1; return 1;
} }
...@@ -5685,11 +5685,11 @@ choose_reload_regs (chain) ...@@ -5685,11 +5685,11 @@ choose_reload_regs (chain)
{ {
int tem = 0; int tem = 0;
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if (! reload_optional[j] if (! rld[j].optional
&& (reload_in[j] != 0 || reload_out[j] != 0 || reload_secondary_p[j]) && (rld[j].in != 0 || rld[j].out != 0 || rld[j].secondary_p)
&& (reload_reg_rtx[j] == 0 && (rld[j].reg_rtx == 0
|| (! rtx_equal_p (reload_reg_rtx[j], reload_in[j]) || (! rtx_equal_p (rld[j].reg_rtx, rld[j].in)
&& ! rtx_equal_p (reload_reg_rtx[j], reload_out[j])))) && ! rtx_equal_p (rld[j].reg_rtx, rld[j].out))))
tem++; tem++;
if (tem > n_spills) if (tem > n_spills)
must_reuse = 1; must_reuse = 1;
...@@ -5710,32 +5710,30 @@ choose_reload_regs (chain) ...@@ -5710,32 +5710,30 @@ choose_reload_regs (chain)
reload_order[j] = j; reload_order[j] = j;
reload_spill_index[j] = -1; reload_spill_index[j] = -1;
reload_mode[j] reload_mode[j] = ((rld[j].inmode == VOIDmode
= ((reload_inmode[j] == VOIDmode || (GET_MODE_SIZE (rld[j].outmode)
|| (GET_MODE_SIZE (reload_outmode[j]) > GET_MODE_SIZE (rld[j].inmode)))
> GET_MODE_SIZE (reload_inmode[j]))) ? rld[j].outmode : rld[j].inmode);
? reload_outmode[j] : reload_inmode[j]);
reload_nregs[j] = CLASS_MAX_NREGS (reload_reg_class[j], reload_mode[j]); reload_nregs[j] = CLASS_MAX_NREGS (rld[j].class, reload_mode[j]);
if (reload_nregs[j] > 1) if (reload_nregs[j] > 1)
{ {
max_group_size = MAX (reload_nregs[j], max_group_size); max_group_size = MAX (reload_nregs[j], max_group_size);
group_class = reg_class_superunion[(int)reload_reg_class[j]][(int)group_class]; group_class = reg_class_superunion[(int)rld[j].class][(int)group_class];
} }
save_reload_reg_rtx[j] = rld[j].reg_rtx;
/* If we have already decided to use a certain register, /* If we have already decided to use a certain register,
don't use it in another way. */ don't use it in another way. */
if (reload_reg_rtx[j]) if (rld[j].reg_rtx)
mark_reload_reg_in_use (REGNO (reload_reg_rtx[j]), reload_opnum[j], mark_reload_reg_in_use (REGNO (rld[j].reg_rtx), rld[j].opnum,
reload_when_needed[j], reload_mode[j]); rld[j].when_needed, reload_mode[j]);
} }
if (n_reloads > 1) if (n_reloads > 1)
qsort (reload_order, n_reloads, sizeof (short), reload_reg_class_lower); qsort (reload_order, n_reloads, sizeof (short), reload_reg_class_lower);
bcopy ((char *) reload_reg_rtx, (char *) save_reload_reg_rtx,
sizeof reload_reg_rtx);
bcopy (reload_inherited, save_reload_inherited, sizeof reload_inherited); bcopy (reload_inherited, save_reload_inherited, sizeof reload_inherited);
bcopy ((char *) reload_inheritance_insn, bcopy ((char *) reload_inheritance_insn,
(char *) save_reload_inheritance_insn, (char *) save_reload_inheritance_insn,
...@@ -5807,8 +5805,8 @@ choose_reload_regs (chain) ...@@ -5807,8 +5805,8 @@ choose_reload_regs (chain)
rtx search_equiv = NULL_RTX; rtx search_equiv = NULL_RTX;
/* Ignore reloads that got marked inoperative. */ /* Ignore reloads that got marked inoperative. */
if (reload_out[r] == 0 && reload_in[r] == 0 if (rld[r].out == 0 && rld[r].in == 0
&& ! reload_secondary_p[r]) && ! rld[r].secondary_p)
continue; continue;
/* If find_reloads chose to use reload_in or reload_out as a reload /* If find_reloads chose to use reload_in or reload_out as a reload
...@@ -5816,11 +5814,11 @@ choose_reload_regs (chain) ...@@ -5816,11 +5814,11 @@ choose_reload_regs (chain)
found one since we might save an insn if we find the value lying found one since we might save an insn if we find the value lying
around. around.
Try also when reload_in is a pseudo without a hard reg. */ Try also when reload_in is a pseudo without a hard reg. */
if (reload_in[r] != 0 && reload_reg_rtx[r] != 0 if (rld[r].in != 0 && rld[r].reg_rtx != 0
&& (rtx_equal_p (reload_in[r], reload_reg_rtx[r]) && (rtx_equal_p (rld[r].in, rld[r].reg_rtx)
|| (rtx_equal_p (reload_out[r], reload_reg_rtx[r]) || (rtx_equal_p (rld[r].out, rld[r].reg_rtx)
&& GET_CODE (reload_in[r]) != MEM && GET_CODE (rld[r].in) != MEM
&& true_regnum (reload_in[r]) < FIRST_PSEUDO_REGISTER))) && true_regnum (rld[r].in) < FIRST_PSEUDO_REGISTER)))
continue; continue;
#if 0 /* No longer needed for correct operation. #if 0 /* No longer needed for correct operation.
...@@ -5829,13 +5827,13 @@ choose_reload_regs (chain) ...@@ -5829,13 +5827,13 @@ choose_reload_regs (chain)
until we are sure that any non-optional reloads have been allocated. until we are sure that any non-optional reloads have been allocated.
The following code takes advantage of the fact that optional reloads The following code takes advantage of the fact that optional reloads
are at the end of reload_order. */ are at the end of reload_order. */
if (reload_optional[r] != 0) if (rld[r].optional != 0)
for (i = 0; i < j; i++) for (i = 0; i < j; i++)
if ((reload_out[reload_order[i]] != 0 if ((rld[reload_order[i]].out != 0
|| reload_in[reload_order[i]] != 0 || rld[reload_order[i]].in != 0
|| reload_secondary_p[reload_order[i]]) || rld[reload_order[i]].secondary_p)
&& ! reload_optional[reload_order[i]] && ! rld[reload_order[i]].optional
&& reload_reg_rtx[reload_order[i]] == 0) && rld[reload_order[i]].reg_rtx == 0)
allocate_reload_reg (chain, reload_order[i], 0, inheritance); allocate_reload_reg (chain, reload_order[i], 0, inheritance);
#endif #endif
...@@ -5859,51 +5857,51 @@ choose_reload_regs (chain) ...@@ -5859,51 +5857,51 @@ choose_reload_regs (chain)
register int regno = -1; register int regno = -1;
enum machine_mode mode = VOIDmode; enum machine_mode mode = VOIDmode;
if (reload_in[r] == 0) if (rld[r].in == 0)
; ;
else if (GET_CODE (reload_in[r]) == REG) else if (GET_CODE (rld[r].in) == REG)
{ {
regno = REGNO (reload_in[r]); regno = REGNO (rld[r].in);
mode = GET_MODE (reload_in[r]); mode = GET_MODE (rld[r].in);
} }
else if (GET_CODE (reload_in_reg[r]) == REG) else if (GET_CODE (rld[r].in_reg) == REG)
{ {
regno = REGNO (reload_in_reg[r]); regno = REGNO (rld[r].in_reg);
mode = GET_MODE (reload_in_reg[r]); mode = GET_MODE (rld[r].in_reg);
} }
else if (GET_CODE (reload_in_reg[r]) == SUBREG else if (GET_CODE (rld[r].in_reg) == SUBREG
&& GET_CODE (SUBREG_REG (reload_in_reg[r])) == REG) && GET_CODE (SUBREG_REG (rld[r].in_reg)) == REG)
{ {
word = SUBREG_WORD (reload_in_reg[r]); word = SUBREG_WORD (rld[r].in_reg);
regno = REGNO (SUBREG_REG (reload_in_reg[r])); regno = REGNO (SUBREG_REG (rld[r].in_reg));
if (regno < FIRST_PSEUDO_REGISTER) if (regno < FIRST_PSEUDO_REGISTER)
regno += word; regno += word;
mode = GET_MODE (reload_in_reg[r]); mode = GET_MODE (rld[r].in_reg);
} }
#ifdef AUTO_INC_DEC #ifdef AUTO_INC_DEC
else if ((GET_CODE (reload_in_reg[r]) == PRE_INC else if ((GET_CODE (rld[r].in_reg) == PRE_INC
|| GET_CODE (reload_in_reg[r]) == PRE_DEC || GET_CODE (rld[r].in_reg) == PRE_DEC
|| GET_CODE (reload_in_reg[r]) == POST_INC || GET_CODE (rld[r].in_reg) == POST_INC
|| GET_CODE (reload_in_reg[r]) == POST_DEC) || GET_CODE (rld[r].in_reg) == POST_DEC)
&& GET_CODE (XEXP (reload_in_reg[r], 0)) == REG) && GET_CODE (XEXP (rld[r].in_reg, 0)) == REG)
{ {
regno = REGNO (XEXP (reload_in_reg[r], 0)); regno = REGNO (XEXP (rld[r].in_reg, 0));
mode = GET_MODE (XEXP (reload_in_reg[r], 0)); mode = GET_MODE (XEXP (rld[r].in_reg, 0));
reload_out[r] = reload_in[r]; rld[r].out = rld[r].in;
} }
#endif #endif
#if 0 #if 0
/* This won't work, since REGNO can be a pseudo reg number. /* This won't work, since REGNO can be a pseudo reg number.
Also, it takes much more hair to keep track of all the things Also, it takes much more hair to keep track of all the things
that can invalidate an inherited reload of part of a pseudoreg. */ that can invalidate an inherited reload of part of a pseudoreg. */
else if (GET_CODE (reload_in[r]) == SUBREG else if (GET_CODE (rld[r].in) == SUBREG
&& GET_CODE (SUBREG_REG (reload_in[r])) == REG) && GET_CODE (SUBREG_REG (rld[r].in)) == REG)
regno = REGNO (SUBREG_REG (reload_in[r])) + SUBREG_WORD (reload_in[r]); regno = REGNO (SUBREG_REG (rld[r].in)) + SUBREG_WORD (rld[r].in);
#endif #endif
if (regno >= 0 && reg_last_reload_reg[regno] != 0) if (regno >= 0 && reg_last_reload_reg[regno] != 0)
{ {
enum reg_class class = reload_reg_class[r], last_class; enum reg_class class = rld[r].class, last_class;
rtx last_reg = reg_last_reload_reg[regno]; rtx last_reg = reg_last_reload_reg[regno];
i = REGNO (last_reg) + word; i = REGNO (last_reg) + word;
...@@ -5934,9 +5932,9 @@ choose_reload_regs (chain) ...@@ -5934,9 +5932,9 @@ choose_reload_regs (chain)
&& (reload_nregs[r] == max_group_size && (reload_nregs[r] == max_group_size
|| ! TEST_HARD_REG_BIT (reg_class_contents[(int) group_class], || ! TEST_HARD_REG_BIT (reg_class_contents[(int) group_class],
i)) i))
&& reload_reg_free_for_value_p (i, reload_opnum[r], && reload_reg_free_for_value_p (i, rld[r].opnum,
reload_when_needed[r], rld[r].when_needed,
reload_in[r], rld[r].in,
const0_rtx, r, 1)) const0_rtx, r, 1))
{ {
/* If a group is needed, verify that all the subsequent /* If a group is needed, verify that all the subsequent
...@@ -5972,28 +5970,28 @@ choose_reload_regs (chain) ...@@ -5972,28 +5970,28 @@ choose_reload_regs (chain)
if (i1 != n_earlyclobbers if (i1 != n_earlyclobbers
|| ! (reload_reg_free_for_value_p || ! (reload_reg_free_for_value_p
(i, reload_opnum[r], reload_when_needed[r], (i, rld[r].opnum, rld[r].when_needed,
reload_in[r], reload_out[r], r, 1)) rld[r].in, rld[r].out, r, 1))
/* Don't use it if we'd clobber a pseudo reg. */ /* Don't use it if we'd clobber a pseudo reg. */
|| (TEST_HARD_REG_BIT (reg_used_in_insn, i) || (TEST_HARD_REG_BIT (reg_used_in_insn, i)
&& reload_out[r] && rld[r].out
&& ! TEST_HARD_REG_BIT (reg_reloaded_dead, i)) && ! TEST_HARD_REG_BIT (reg_reloaded_dead, i))
/* Don't clobber the frame pointer. */ /* Don't clobber the frame pointer. */
|| (i == HARD_FRAME_POINTER_REGNUM || (i == HARD_FRAME_POINTER_REGNUM
&& reload_out[r]) && rld[r].out)
/* Don't really use the inherited spill reg /* Don't really use the inherited spill reg
if we need it wider than we've got it. */ if we need it wider than we've got it. */
|| (GET_MODE_SIZE (reload_mode[r]) || (GET_MODE_SIZE (reload_mode[r])
> GET_MODE_SIZE (mode)) > GET_MODE_SIZE (mode))
|| ! TEST_HARD_REG_BIT (reg_class_contents[(int) reload_reg_class[r]], || ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].class],
i) i)
/* If find_reloads chose reload_out as reload /* If find_reloads chose reload_out as reload
register, stay with it - that leaves the register, stay with it - that leaves the
inherited register for subsequent reloads. */ inherited register for subsequent reloads. */
|| (reload_out[r] && reload_reg_rtx[r] || (rld[r].out && rld[r].reg_rtx
&& rtx_equal_p (reload_out[r], && rtx_equal_p (rld[r].out,
reload_reg_rtx[r]))) rld[r].reg_rtx)))
{ {
reload_override_in[r] = last_reg; reload_override_in[r] = last_reg;
reload_inheritance_insn[r] reload_inheritance_insn[r]
...@@ -6006,10 +6004,10 @@ choose_reload_regs (chain) ...@@ -6006,10 +6004,10 @@ choose_reload_regs (chain)
/* Mark the register as in use for this part of /* Mark the register as in use for this part of
the insn. */ the insn. */
mark_reload_reg_in_use (i, mark_reload_reg_in_use (i,
reload_opnum[r], rld[r].opnum,
reload_when_needed[r], rld[r].when_needed,
reload_mode[r]); reload_mode[r]);
reload_reg_rtx[r] = last_reg; rld[r].reg_rtx = last_reg;
reload_inherited[r] = 1; reload_inherited[r] = 1;
reload_inheritance_insn[r] reload_inheritance_insn[r]
= reg_reloaded_insn[i]; = reg_reloaded_insn[i];
...@@ -6025,24 +6023,24 @@ choose_reload_regs (chain) ...@@ -6025,24 +6023,24 @@ choose_reload_regs (chain)
/* Here's another way to see if the value is already lying around. */ /* Here's another way to see if the value is already lying around. */
if (inheritance if (inheritance
&& reload_in[r] != 0 && rld[r].in != 0
&& ! reload_inherited[r] && ! reload_inherited[r]
&& reload_out[r] == 0 && rld[r].out == 0
&& (CONSTANT_P (reload_in[r]) && (CONSTANT_P (rld[r].in)
|| GET_CODE (reload_in[r]) == PLUS || GET_CODE (rld[r].in) == PLUS
|| GET_CODE (reload_in[r]) == REG || GET_CODE (rld[r].in) == REG
|| GET_CODE (reload_in[r]) == MEM) || GET_CODE (rld[r].in) == MEM)
&& (reload_nregs[r] == max_group_size && (reload_nregs[r] == max_group_size
|| ! reg_classes_intersect_p (reload_reg_class[r], group_class))) || ! reg_classes_intersect_p (rld[r].class, group_class)))
search_equiv = reload_in[r]; search_equiv = rld[r].in;
/* If this is an output reload from a simple move insn, look /* If this is an output reload from a simple move insn, look
if an equivalence for the input is available. */ if an equivalence for the input is available. */
else if (inheritance && reload_in[r] == 0 && reload_out[r] != 0) else if (inheritance && rld[r].in == 0 && rld[r].out != 0)
{ {
rtx set = single_set (insn); rtx set = single_set (insn);
if (set if (set
&& rtx_equal_p (reload_out[r], SET_DEST (set)) && rtx_equal_p (rld[r].out, SET_DEST (set))
&& CONSTANT_P (SET_SRC (set))) && CONSTANT_P (SET_SRC (set)))
search_equiv = SET_SRC (set); search_equiv = SET_SRC (set);
} }
...@@ -6050,7 +6048,7 @@ choose_reload_regs (chain) ...@@ -6050,7 +6048,7 @@ choose_reload_regs (chain)
if (search_equiv) if (search_equiv)
{ {
register rtx equiv register rtx equiv
= find_equiv_reg (search_equiv, insn, reload_reg_class[r], = find_equiv_reg (search_equiv, insn, rld[r].class,
-1, NULL_PTR, 0, reload_mode[r]); -1, NULL_PTR, 0, reload_mode[r]);
int regno; int regno;
...@@ -6075,11 +6073,11 @@ choose_reload_regs (chain) ...@@ -6075,11 +6073,11 @@ choose_reload_regs (chain)
and of the desired class. */ and of the desired class. */
if (equiv != 0 if (equiv != 0
&& ((TEST_HARD_REG_BIT (reload_reg_used_at_all, regno) && ((TEST_HARD_REG_BIT (reload_reg_used_at_all, regno)
&& ! reload_reg_free_for_value_p (regno, reload_opnum[r], && ! reload_reg_free_for_value_p (regno, rld[r].opnum,
reload_when_needed[r], rld[r].when_needed,
reload_in[r], rld[r].in,
reload_out[r], r, 1)) rld[r].out, r, 1))
|| ! TEST_HARD_REG_BIT (reg_class_contents[(int) reload_reg_class[r]], || ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].class],
regno))) regno)))
equiv = 0; equiv = 0;
...@@ -6109,7 +6107,7 @@ choose_reload_regs (chain) ...@@ -6109,7 +6107,7 @@ choose_reload_regs (chain)
if (equiv != 0 && regno_clobbered_p (regno, insn)) if (equiv != 0 && regno_clobbered_p (regno, insn))
{ {
switch (reload_when_needed[r]) switch (rld[r].when_needed)
{ {
case RELOAD_FOR_OTHER_ADDRESS: case RELOAD_FOR_OTHER_ADDRESS:
case RELOAD_FOR_INPADDR_ADDRESS: case RELOAD_FOR_INPADDR_ADDRESS:
...@@ -6133,7 +6131,7 @@ choose_reload_regs (chain) ...@@ -6133,7 +6131,7 @@ choose_reload_regs (chain)
{ {
int nr = HARD_REGNO_NREGS (regno, reload_mode[r]); int nr = HARD_REGNO_NREGS (regno, reload_mode[r]);
int k; int k;
reload_reg_rtx[r] = equiv; rld[r].reg_rtx = equiv;
reload_inherited[r] = 1; reload_inherited[r] = 1;
/* If reg_reloaded_valid is not set for this register, /* If reg_reloaded_valid is not set for this register,
...@@ -6149,8 +6147,8 @@ choose_reload_regs (chain) ...@@ -6149,8 +6147,8 @@ choose_reload_regs (chain)
i = spill_reg_order[regno + k]; i = spill_reg_order[regno + k];
if (i >= 0) if (i >= 0)
{ {
mark_reload_reg_in_use (regno, reload_opnum[r], mark_reload_reg_in_use (regno, rld[r].opnum,
reload_when_needed[r], rld[r].when_needed,
reload_mode[r]); reload_mode[r]);
SET_HARD_REG_BIT (reload_reg_used_for_inherit, SET_HARD_REG_BIT (reload_reg_used_for_inherit,
regno + k); regno + k);
...@@ -6161,7 +6159,7 @@ choose_reload_regs (chain) ...@@ -6161,7 +6159,7 @@ choose_reload_regs (chain)
/* If we found a register to use already, or if this is an optional /* If we found a register to use already, or if this is an optional
reload, we are done. */ reload, we are done. */
if (reload_reg_rtx[r] != 0 || reload_optional[r] != 0) if (rld[r].reg_rtx != 0 || rld[r].optional != 0)
continue; continue;
#if 0 /* No longer needed for correct operation. Might or might not #if 0 /* No longer needed for correct operation. Might or might not
...@@ -6180,14 +6178,14 @@ choose_reload_regs (chain) ...@@ -6180,14 +6178,14 @@ choose_reload_regs (chain)
{ {
int s = reload_order[i]; int s = reload_order[i];
if ((reload_in[s] == 0 && reload_out[s] == 0 if ((rld[s].in == 0 && rld[s].out == 0
&& ! reload_secondary_p[s]) && ! rld[s].secondary_p)
|| reload_optional[s]) || rld[s].optional)
continue; continue;
if ((reload_reg_class[s] != reload_reg_class[r] if ((rld[s].class != rld[r].class
&& reg_classes_intersect_p (reload_reg_class[r], && reg_classes_intersect_p (rld[r].class,
reload_reg_class[s])) rld[s].class))
|| reload_nregs[s] < reload_nregs[r]) || reload_nregs[s] < reload_nregs[r])
break; break;
} }
...@@ -6206,12 +6204,12 @@ choose_reload_regs (chain) ...@@ -6206,12 +6204,12 @@ choose_reload_regs (chain)
register int r = reload_order[j]; register int r = reload_order[j];
/* Ignore reloads that got marked inoperative. */ /* Ignore reloads that got marked inoperative. */
if (reload_out[r] == 0 && reload_in[r] == 0 && ! reload_secondary_p[r]) if (rld[r].out == 0 && rld[r].in == 0 && ! rld[r].secondary_p)
continue; continue;
/* Skip reloads that already have a register allocated or are /* Skip reloads that already have a register allocated or are
optional. */ optional. */
if (reload_reg_rtx[r] != 0 || reload_optional[r]) if (rld[r].reg_rtx != 0 || rld[r].optional)
continue; continue;
if (! allocate_reload_reg (chain, r, j == n_reloads - 1, inheritance)) if (! allocate_reload_reg (chain, r, j == n_reloads - 1, inheritance))
...@@ -6225,8 +6223,8 @@ choose_reload_regs (chain) ...@@ -6225,8 +6223,8 @@ choose_reload_regs (chain)
/* Loop around and try without any inheritance. */ /* Loop around and try without any inheritance. */
/* First undo everything done by the failed attempt /* First undo everything done by the failed attempt
to allocate with inheritance. */ to allocate with inheritance. */
bcopy ((char *) save_reload_reg_rtx, (char *) reload_reg_rtx, for (i = 0; i < n_reloads; i++)
sizeof reload_reg_rtx); rld[i].reg_rtx = save_reload_reg_rtx[i];
bcopy ((char *) save_reload_inherited, (char *) reload_inherited, bcopy ((char *) save_reload_inherited, (char *) reload_inherited,
sizeof reload_inherited); sizeof reload_inherited);
bcopy ((char *) save_reload_inheritance_insn, bcopy ((char *) save_reload_inheritance_insn,
...@@ -6278,8 +6276,8 @@ choose_reload_regs (chain) ...@@ -6278,8 +6276,8 @@ choose_reload_regs (chain)
{ {
register int r = reload_order[j]; register int r = reload_order[j];
rtx check_reg; rtx check_reg;
if (reload_inherited[r] && reload_reg_rtx[r]) if (reload_inherited[r] && rld[r].reg_rtx)
check_reg = reload_reg_rtx[r]; check_reg = rld[r].reg_rtx;
else if (reload_override_in[r] else if (reload_override_in[r]
&& (GET_CODE (reload_override_in[r]) == REG && (GET_CODE (reload_override_in[r]) == REG
|| GET_CODE (reload_override_in[r]) == SUBREG)) || GET_CODE (reload_override_in[r]) == SUBREG))
...@@ -6287,11 +6285,11 @@ choose_reload_regs (chain) ...@@ -6287,11 +6285,11 @@ choose_reload_regs (chain)
else else
continue; continue;
if (! reload_reg_free_for_value_p (true_regnum (check_reg), if (! reload_reg_free_for_value_p (true_regnum (check_reg),
reload_opnum[r], rld[r].opnum,
reload_when_needed[r], rld[r].when_needed,
reload_in[r], rld[r].in,
(reload_inherited[r] (reload_inherited[r]
? reload_out[r] : const0_rtx), ? rld[r].out : const0_rtx),
r, 1)) r, 1))
{ {
if (pass) if (pass)
...@@ -6311,9 +6309,9 @@ choose_reload_regs (chain) ...@@ -6311,9 +6309,9 @@ choose_reload_regs (chain)
If we suceeded removing some reload and we are doing a preliminary If we suceeded removing some reload and we are doing a preliminary
pass just to remove such reloads, make another pass, since the pass just to remove such reloads, make another pass, since the
removal of one reload might allow us to inherit another one. */ removal of one reload might allow us to inherit another one. */
else if (reload_in[r] else if (rld[r].in
&& reload_out[r] != reload_in[r] && rld[r].out != rld[r].in
&& remove_address_replacements (reload_in[r]) && pass) && remove_address_replacements (rld[r].in) && pass)
pass = 2; pass = 2;
} }
} }
...@@ -6322,23 +6320,23 @@ choose_reload_regs (chain) ...@@ -6322,23 +6320,23 @@ choose_reload_regs (chain)
actually override reload_in. */ actually override reload_in. */
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if (reload_override_in[j]) if (reload_override_in[j])
reload_in[j] = reload_override_in[j]; rld[j].in = reload_override_in[j];
/* If this reload won't be done because it has been cancelled or is /* If this reload won't be done because it has been cancelled or is
optional and not inherited, clear reload_reg_rtx so other optional and not inherited, clear reload_reg_rtx so other
routines (such as subst_reloads) don't get confused. */ routines (such as subst_reloads) don't get confused. */
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if (reload_reg_rtx[j] != 0 if (rld[j].reg_rtx != 0
&& ((reload_optional[j] && ! reload_inherited[j]) && ((rld[j].optional && ! reload_inherited[j])
|| (reload_in[j] == 0 && reload_out[j] == 0 || (rld[j].in == 0 && rld[j].out == 0
&& ! reload_secondary_p[j]))) && ! rld[j].secondary_p)))
{ {
int regno = true_regnum (reload_reg_rtx[j]); int regno = true_regnum (rld[j].reg_rtx);
if (spill_reg_order[regno] >= 0) if (spill_reg_order[regno] >= 0)
clear_reload_reg_in_use (regno, reload_opnum[j], clear_reload_reg_in_use (regno, rld[j].opnum,
reload_when_needed[j], reload_mode[j]); rld[j].when_needed, reload_mode[j]);
reload_reg_rtx[j] = 0; rld[j].reg_rtx = 0;
} }
/* Record which pseudos and which spill regs have output reloads. */ /* Record which pseudos and which spill regs have output reloads. */
...@@ -6349,12 +6347,12 @@ choose_reload_regs (chain) ...@@ -6349,12 +6347,12 @@ choose_reload_regs (chain)
i = reload_spill_index[r]; i = reload_spill_index[r];
/* I is nonneg if this reload uses a register. /* I is nonneg if this reload uses a register.
If reload_reg_rtx[r] is 0, this is an optional reload If rld[r].reg_rtx is 0, this is an optional reload
that we opted to ignore. */ that we opted to ignore. */
if (reload_out_reg[r] != 0 && GET_CODE (reload_out_reg[r]) == REG if (rld[r].out_reg != 0 && GET_CODE (rld[r].out_reg) == REG
&& reload_reg_rtx[r] != 0) && rld[r].reg_rtx != 0)
{ {
register int nregno = REGNO (reload_out_reg[r]); register int nregno = REGNO (rld[r].out_reg);
int nr = 1; int nr = 1;
if (nregno < FIRST_PSEUDO_REGISTER) if (nregno < FIRST_PSEUDO_REGISTER)
...@@ -6370,9 +6368,9 @@ choose_reload_regs (chain) ...@@ -6370,9 +6368,9 @@ choose_reload_regs (chain)
SET_HARD_REG_BIT (reg_is_output_reload, i + nr); SET_HARD_REG_BIT (reg_is_output_reload, i + nr);
} }
if (reload_when_needed[r] != RELOAD_OTHER if (rld[r].when_needed != RELOAD_OTHER
&& reload_when_needed[r] != RELOAD_FOR_OUTPUT && rld[r].when_needed != RELOAD_FOR_OUTPUT
&& reload_when_needed[r] != RELOAD_FOR_INSN) && rld[r].when_needed != RELOAD_FOR_INSN)
abort (); abort ();
} }
} }
...@@ -6386,12 +6384,12 @@ deallocate_reload_reg (r) ...@@ -6386,12 +6384,12 @@ deallocate_reload_reg (r)
{ {
int regno; int regno;
if (! reload_reg_rtx[r]) if (! rld[r].reg_rtx)
return; return;
regno = true_regnum (reload_reg_rtx[r]); regno = true_regnum (rld[r].reg_rtx);
reload_reg_rtx[r] = 0; rld[r].reg_rtx = 0;
if (spill_reg_order[regno] >= 0) if (spill_reg_order[regno] >= 0)
clear_reload_reg_in_use (regno, reload_opnum[r], reload_when_needed[r], clear_reload_reg_in_use (regno, rld[r].opnum, rld[r].when_needed,
reload_mode[r]); reload_mode[r]);
reload_spill_index[r] = -1; reload_spill_index[r] = -1;
} }
...@@ -6425,9 +6423,9 @@ merge_assigned_reloads (insn) ...@@ -6425,9 +6423,9 @@ merge_assigned_reloads (insn)
int max_input_address_opnum = -1; int max_input_address_opnum = -1;
int min_conflicting_input_opnum = MAX_RECOG_OPERANDS; int min_conflicting_input_opnum = MAX_RECOG_OPERANDS;
if (reload_in[i] == 0 || reload_when_needed[i] == RELOAD_OTHER if (rld[i].in == 0 || rld[i].when_needed == RELOAD_OTHER
|| reload_out[i] != 0 || reload_reg_rtx[i] == 0 || rld[i].out != 0 || rld[i].reg_rtx == 0
|| reg_set_p (reload_reg_rtx[i], insn)) || reg_set_p (rld[i].reg_rtx, insn))
continue; continue;
/* Look at all other reloads. Ensure that the only use of this /* Look at all other reloads. Ensure that the only use of this
...@@ -6438,32 +6436,32 @@ merge_assigned_reloads (insn) ...@@ -6438,32 +6436,32 @@ merge_assigned_reloads (insn)
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
{ {
if (i == j || reload_reg_rtx[j] == 0 if (i == j || rld[j].reg_rtx == 0
|| ! reg_overlap_mentioned_p (reload_reg_rtx[j], || ! reg_overlap_mentioned_p (rld[j].reg_rtx,
reload_reg_rtx[i])) rld[i].reg_rtx))
continue; continue;
if (reload_when_needed[j] == RELOAD_FOR_INPUT_ADDRESS if (rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS
&& reload_opnum[j] > max_input_address_opnum) && rld[j].opnum > max_input_address_opnum)
max_input_address_opnum = reload_opnum[j]; max_input_address_opnum = rld[j].opnum;
/* If the reload regs aren't exactly the same (e.g, different modes) /* If the reload regs aren't exactly the same (e.g, different modes)
or if the values are different, we can't merge this reload. or if the values are different, we can't merge this reload.
But if it is an input reload, we might still merge But if it is an input reload, we might still merge
RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_OTHER_ADDRESS reloads. */ RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_OTHER_ADDRESS reloads. */
if (! rtx_equal_p (reload_reg_rtx[i], reload_reg_rtx[j]) if (! rtx_equal_p (rld[i].reg_rtx, rld[j].reg_rtx)
|| reload_out[j] != 0 || reload_in[j] == 0 || rld[j].out != 0 || rld[j].in == 0
|| ! rtx_equal_p (reload_in[i], reload_in[j])) || ! rtx_equal_p (rld[i].in, rld[j].in))
{ {
if (reload_when_needed[j] != RELOAD_FOR_INPUT if (rld[j].when_needed != RELOAD_FOR_INPUT
|| ((reload_when_needed[i] != RELOAD_FOR_INPUT_ADDRESS || ((rld[i].when_needed != RELOAD_FOR_INPUT_ADDRESS
|| reload_opnum[i] > reload_opnum[j]) || rld[i].opnum > rld[j].opnum)
&& reload_when_needed[i] != RELOAD_FOR_OTHER_ADDRESS)) && rld[i].when_needed != RELOAD_FOR_OTHER_ADDRESS))
break; break;
conflicting_input = 1; conflicting_input = 1;
if (min_conflicting_input_opnum > reload_opnum[j]) if (min_conflicting_input_opnum > rld[j].opnum)
min_conflicting_input_opnum = reload_opnum[j]; min_conflicting_input_opnum = rld[j].opnum;
} }
} }
...@@ -6474,14 +6472,14 @@ merge_assigned_reloads (insn) ...@@ -6474,14 +6472,14 @@ merge_assigned_reloads (insn)
&& max_input_address_opnum <= min_conflicting_input_opnum) && max_input_address_opnum <= min_conflicting_input_opnum)
{ {
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if (i != j && reload_reg_rtx[j] != 0 if (i != j && rld[j].reg_rtx != 0
&& rtx_equal_p (reload_reg_rtx[i], reload_reg_rtx[j]) && rtx_equal_p (rld[i].reg_rtx, rld[j].reg_rtx)
&& (! conflicting_input && (! conflicting_input
|| reload_when_needed[j] == RELOAD_FOR_INPUT_ADDRESS || rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS
|| reload_when_needed[j] == RELOAD_FOR_OTHER_ADDRESS)) || rld[j].when_needed == RELOAD_FOR_OTHER_ADDRESS))
{ {
reload_when_needed[i] = RELOAD_OTHER; rld[i].when_needed = RELOAD_OTHER;
reload_in[j] = 0; rld[j].in = 0;
reload_spill_index[j] = -1; reload_spill_index[j] = -1;
transfer_replacements (i, j); transfer_replacements (i, j);
} }
...@@ -6492,15 +6490,15 @@ merge_assigned_reloads (insn) ...@@ -6492,15 +6490,15 @@ merge_assigned_reloads (insn)
this test is equivalent to looking for reloads for this operand this test is equivalent to looking for reloads for this operand
number. */ number. */
if (reload_when_needed[i] == RELOAD_OTHER) if (rld[i].when_needed == RELOAD_OTHER)
for (j = 0; j < n_reloads; j++) for (j = 0; j < n_reloads; j++)
if (reload_in[j] != 0 if (rld[j].in != 0
&& reload_when_needed[i] != RELOAD_OTHER && rld[i].when_needed != RELOAD_OTHER
&& reg_overlap_mentioned_for_reload_p (reload_in[j], && reg_overlap_mentioned_for_reload_p (rld[j].in,
reload_in[i])) rld[i].in))
reload_when_needed[j] rld[j].when_needed
= ((reload_when_needed[i] == RELOAD_FOR_INPUT_ADDRESS = ((rld[i].when_needed == RELOAD_FOR_INPUT_ADDRESS
|| reload_when_needed[i] == RELOAD_FOR_INPADDR_ADDRESS) || rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
? RELOAD_FOR_OTHER_ADDRESS : RELOAD_OTHER); ? RELOAD_FOR_OTHER_ADDRESS : RELOAD_OTHER);
} }
} }
...@@ -6555,28 +6553,28 @@ emit_reload_insns (chain) ...@@ -6555,28 +6553,28 @@ emit_reload_insns (chain)
rtx this_reload_insn = 0; rtx this_reload_insn = 0;
int expect_occurrences = 1; int expect_occurrences = 1;
if (reload_reg_rtx[j] if (rld[j].reg_rtx
&& REGNO (reload_reg_rtx[j]) < FIRST_PSEUDO_REGISTER) && REGNO (rld[j].reg_rtx) < FIRST_PSEUDO_REGISTER)
new_spill_reg_store[REGNO (reload_reg_rtx[j])] = 0; new_spill_reg_store[REGNO (rld[j].reg_rtx)] = 0;
old = (reload_in[j] && GET_CODE (reload_in[j]) == MEM old = (rld[j].in && GET_CODE (rld[j].in) == MEM
? reload_in_reg[j] : reload_in[j]); ? rld[j].in_reg : rld[j].in);
if (old != 0 if (old != 0
/* AUTO_INC reloads need to be handled even if inherited. We got an /* AUTO_INC reloads need to be handled even if inherited. We got an
AUTO_INC reload if reload_out is set but reload_out_reg isn't. */ AUTO_INC reload if reload_out is set but reload_out_reg isn't. */
&& (! reload_inherited[j] || (reload_out[j] && ! reload_out_reg[j])) && (! reload_inherited[j] || (rld[j].out && ! rld[j].out_reg))
&& ! rtx_equal_p (reload_reg_rtx[j], old) && ! rtx_equal_p (rld[j].reg_rtx, old)
&& reload_reg_rtx[j] != 0) && rld[j].reg_rtx != 0)
{ {
register rtx reloadreg = reload_reg_rtx[j]; register rtx reloadreg = rld[j].reg_rtx;
rtx oldequiv = 0; rtx oldequiv = 0;
enum machine_mode mode; enum machine_mode mode;
rtx *where; rtx *where;
/* Determine the mode to reload in. /* Determine the mode to reload in.
This is very tricky because we have three to choose from. This is very tricky because we have three to choose from.
There is the mode the insn operand wants (reload_inmode[J]). There is the mode the insn operand wants (rld[J].inmode).
There is the mode of the reload register RELOADREG. There is the mode of the reload register RELOADREG.
There is the intrinsic mode of the operand, which we could find There is the intrinsic mode of the operand, which we could find
by stripping some SUBREGs. by stripping some SUBREGs.
...@@ -6608,7 +6606,7 @@ emit_reload_insns (chain) ...@@ -6608,7 +6606,7 @@ emit_reload_insns (chain)
mode = GET_MODE (old); mode = GET_MODE (old);
if (mode == VOIDmode) if (mode == VOIDmode)
mode = reload_inmode[j]; mode = rld[j].inmode;
#ifdef SECONDARY_INPUT_RELOAD_CLASS #ifdef SECONDARY_INPUT_RELOAD_CLASS
/* If we need a secondary register for this operation, see if /* If we need a secondary register for this operation, see if
...@@ -6616,12 +6614,12 @@ emit_reload_insns (chain) ...@@ -6616,12 +6614,12 @@ emit_reload_insns (chain)
do this if the secondary register will be used as a scratch do this if the secondary register will be used as a scratch
register. */ register. */
if (reload_secondary_in_reload[j] >= 0 if (rld[j].secondary_in_reload >= 0
&& reload_secondary_in_icode[j] == CODE_FOR_nothing && rld[j].secondary_in_icode == CODE_FOR_nothing
&& optimize) && optimize)
oldequiv oldequiv
= find_equiv_reg (old, insn, = find_equiv_reg (old, insn,
reload_reg_class[reload_secondary_in_reload[j]], rld[rld[j].secondary_in_reload].class,
-1, NULL_PTR, 0, mode); -1, NULL_PTR, 0, mode);
#endif #endif
...@@ -6647,9 +6645,9 @@ emit_reload_insns (chain) ...@@ -6647,9 +6645,9 @@ emit_reload_insns (chain)
/* Don't use OLDEQUIV if any other reload changes it at an /* Don't use OLDEQUIV if any other reload changes it at an
earlier stage of this insn or at this stage. */ earlier stage of this insn or at this stage. */
if (! reload_reg_free_for_value_p (regno, reload_opnum[j], if (! reload_reg_free_for_value_p (regno, rld[j].opnum,
reload_when_needed[j], rld[j].when_needed,
reload_in[j], const0_rtx, j, rld[j].in, const0_rtx, j,
0)) 0))
oldequiv = 0; oldequiv = 0;
...@@ -6659,18 +6657,18 @@ emit_reload_insns (chain) ...@@ -6659,18 +6657,18 @@ emit_reload_insns (chain)
or memory. */ or memory. */
if (oldequiv != 0 if (oldequiv != 0
&& ((REGNO_REG_CLASS (regno) != reload_reg_class[j] && ((REGNO_REG_CLASS (regno) != rld[j].class
&& (REGISTER_MOVE_COST (REGNO_REG_CLASS (regno), && (REGISTER_MOVE_COST (REGNO_REG_CLASS (regno),
reload_reg_class[j]) rld[j].class)
>= MEMORY_MOVE_COST (mode, reload_reg_class[j], 1))) >= MEMORY_MOVE_COST (mode, rld[j].class, 1)))
#ifdef SECONDARY_INPUT_RELOAD_CLASS #ifdef SECONDARY_INPUT_RELOAD_CLASS
|| (SECONDARY_INPUT_RELOAD_CLASS (reload_reg_class[j], || (SECONDARY_INPUT_RELOAD_CLASS (rld[j].class,
mode, oldequiv) mode, oldequiv)
!= NO_REGS) != NO_REGS)
#endif #endif
#ifdef SECONDARY_MEMORY_NEEDED #ifdef SECONDARY_MEMORY_NEEDED
|| SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (regno), || SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (regno),
reload_reg_class[j], rld[j].class,
mode) mode)
#endif #endif
)) ))
...@@ -6683,10 +6681,10 @@ emit_reload_insns (chain) ...@@ -6683,10 +6681,10 @@ emit_reload_insns (chain)
find the pseudo in RELOAD_IN_REG. */ find the pseudo in RELOAD_IN_REG. */
if (oldequiv == 0 if (oldequiv == 0
&& reload_override_in[j] && reload_override_in[j]
&& GET_CODE (reload_in_reg[j]) == REG) && GET_CODE (rld[j].in_reg) == REG)
{ {
oldequiv = old; oldequiv = old;
old = reload_in_reg[j]; old = rld[j].in_reg;
} }
if (oldequiv == 0) if (oldequiv == 0)
oldequiv = old; oldequiv = old;
...@@ -6705,7 +6703,7 @@ emit_reload_insns (chain) ...@@ -6705,7 +6703,7 @@ emit_reload_insns (chain)
&& GET_CODE (old) == REG && GET_CODE (old) == REG
&& (dead_or_set_p (insn, spill_reg_stored_to[REGNO (oldequiv)]) && (dead_or_set_p (insn, spill_reg_stored_to[REGNO (oldequiv)])
|| rtx_equal_p (spill_reg_stored_to[REGNO (oldequiv)], || rtx_equal_p (spill_reg_stored_to[REGNO (oldequiv)],
reload_out_reg[j]))) rld[j].out_reg)))
delete_output_reload (insn, j, REGNO (oldequiv)); delete_output_reload (insn, j, REGNO (oldequiv));
/* Encapsulate both RELOADREG and OLDEQUIV into that mode, /* Encapsulate both RELOADREG and OLDEQUIV into that mode,
...@@ -6723,25 +6721,25 @@ emit_reload_insns (chain) ...@@ -6723,25 +6721,25 @@ emit_reload_insns (chain)
oldequiv = gen_rtx_SUBREG (mode, oldequiv, 0); oldequiv = gen_rtx_SUBREG (mode, oldequiv, 0);
/* Switch to the right place to emit the reload insns. */ /* Switch to the right place to emit the reload insns. */
switch (reload_when_needed[j]) switch (rld[j].when_needed)
{ {
case RELOAD_OTHER: case RELOAD_OTHER:
where = &other_input_reload_insns; where = &other_input_reload_insns;
break; break;
case RELOAD_FOR_INPUT: case RELOAD_FOR_INPUT:
where = &input_reload_insns[reload_opnum[j]]; where = &input_reload_insns[rld[j].opnum];
break; break;
case RELOAD_FOR_INPUT_ADDRESS: case RELOAD_FOR_INPUT_ADDRESS:
where = &input_address_reload_insns[reload_opnum[j]]; where = &input_address_reload_insns[rld[j].opnum];
break; break;
case RELOAD_FOR_INPADDR_ADDRESS: case RELOAD_FOR_INPADDR_ADDRESS:
where = &inpaddr_address_reload_insns[reload_opnum[j]]; where = &inpaddr_address_reload_insns[rld[j].opnum];
break; break;
case RELOAD_FOR_OUTPUT_ADDRESS: case RELOAD_FOR_OUTPUT_ADDRESS:
where = &output_address_reload_insns[reload_opnum[j]]; where = &output_address_reload_insns[rld[j].opnum];
break; break;
case RELOAD_FOR_OUTADDR_ADDRESS: case RELOAD_FOR_OUTADDR_ADDRESS:
where = &outaddr_address_reload_insns[reload_opnum[j]]; where = &outaddr_address_reload_insns[rld[j].opnum];
break; break;
case RELOAD_FOR_OPERAND_ADDRESS: case RELOAD_FOR_OPERAND_ADDRESS:
where = &operand_reload_insns; where = &operand_reload_insns;
...@@ -6760,18 +6758,18 @@ emit_reload_insns (chain) ...@@ -6760,18 +6758,18 @@ emit_reload_insns (chain)
special = 0; special = 0;
/* Auto-increment addresses must be reloaded in a special way. */ /* Auto-increment addresses must be reloaded in a special way. */
if (reload_out[j] && ! reload_out_reg[j]) if (rld[j].out && ! rld[j].out_reg)
{ {
/* We are not going to bother supporting the case where a /* We are not going to bother supporting the case where a
incremented register can't be copied directly from incremented register can't be copied directly from
OLDEQUIV since this seems highly unlikely. */ OLDEQUIV since this seems highly unlikely. */
if (reload_secondary_in_reload[j] >= 0) if (rld[j].secondary_in_reload >= 0)
abort (); abort ();
if (reload_inherited[j]) if (reload_inherited[j])
oldequiv = reloadreg; oldequiv = reloadreg;
old = XEXP (reload_in_reg[j], 0); old = XEXP (rld[j].in_reg, 0);
if (optimize && GET_CODE (oldequiv) == REG if (optimize && GET_CODE (oldequiv) == REG
&& REGNO (oldequiv) < FIRST_PSEUDO_REGISTER && REGNO (oldequiv) < FIRST_PSEUDO_REGISTER
...@@ -6787,8 +6785,8 @@ emit_reload_insns (chain) ...@@ -6787,8 +6785,8 @@ emit_reload_insns (chain)
special = 1; special = 1;
/* Output a special code sequence for this case. */ /* Output a special code sequence for this case. */
new_spill_reg_store[REGNO (reloadreg)] new_spill_reg_store[REGNO (reloadreg)]
= inc_for_reload (reloadreg, oldequiv, reload_out[j], = inc_for_reload (reloadreg, oldequiv, rld[j].out,
reload_inc[j]); rld[j].inc);
} }
/* If we are reloading a pseudo-register that was set by the previous /* If we are reloading a pseudo-register that was set by the previous
...@@ -6801,9 +6799,9 @@ emit_reload_insns (chain) ...@@ -6801,9 +6799,9 @@ emit_reload_insns (chain)
/* This is unsafe if some other reload /* This is unsafe if some other reload
uses the same reg first. */ uses the same reg first. */
&& reload_reg_free_for_value_p (REGNO (reloadreg), && reload_reg_free_for_value_p (REGNO (reloadreg),
reload_opnum[j], rld[j].opnum,
reload_when_needed[j], rld[j].when_needed,
old, reload_out[j], old, rld[j].out,
j, 0)) j, 0))
{ {
rtx temp = PREV_INSN (insn); rtx temp = PREV_INSN (insn);
...@@ -6843,7 +6841,7 @@ emit_reload_insns (chain) ...@@ -6843,7 +6841,7 @@ emit_reload_insns (chain)
if (REG_N_DEATHS (REGNO (old)) == 1 if (REG_N_DEATHS (REGNO (old)) == 1
&& REG_N_SETS (REGNO (old)) == 1) && REG_N_SETS (REGNO (old)) == 1)
{ {
reg_renumber[REGNO (old)] = REGNO (reload_reg_rtx[j]); reg_renumber[REGNO (old)] = REGNO (rld[j].reg_rtx);
alter_reg (REGNO (old), -1); alter_reg (REGNO (old), -1);
} }
special = 1; special = 1;
...@@ -6869,9 +6867,9 @@ emit_reload_insns (chain) ...@@ -6869,9 +6867,9 @@ emit_reload_insns (chain)
because we don't make such reloads when both the input and because we don't make such reloads when both the input and
output need secondary reload registers. */ output need secondary reload registers. */
if (reload_secondary_in_reload[j] >= 0) if (rld[j].secondary_in_reload >= 0)
{ {
int secondary_reload = reload_secondary_in_reload[j]; int secondary_reload = rld[j].secondary_in_reload;
rtx real_oldequiv = oldequiv; rtx real_oldequiv = oldequiv;
rtx real_old = old; rtx real_old = old;
rtx tmp; rtx tmp;
...@@ -6900,7 +6898,7 @@ emit_reload_insns (chain) ...@@ -6900,7 +6898,7 @@ emit_reload_insns (chain)
if (! reg_equiv_mem[REGNO (tmp)] if (! reg_equiv_mem[REGNO (tmp)]
|| num_not_at_initial_offset || num_not_at_initial_offset
|| GET_CODE (oldequiv) == SUBREG) || GET_CODE (oldequiv) == SUBREG)
real_oldequiv = reload_in[j]; real_oldequiv = rld[j].in;
else else
real_oldequiv = reg_equiv_mem[REGNO (tmp)]; real_oldequiv = reg_equiv_mem[REGNO (tmp)];
} }
...@@ -6916,19 +6914,19 @@ emit_reload_insns (chain) ...@@ -6916,19 +6914,19 @@ emit_reload_insns (chain)
if (! reg_equiv_mem[REGNO (tmp)] if (! reg_equiv_mem[REGNO (tmp)]
|| num_not_at_initial_offset || num_not_at_initial_offset
|| GET_CODE (old) == SUBREG) || GET_CODE (old) == SUBREG)
real_old = reload_in[j]; real_old = rld[j].in;
else else
real_old = reg_equiv_mem[REGNO (tmp)]; real_old = reg_equiv_mem[REGNO (tmp)];
} }
second_reload_reg = reload_reg_rtx[secondary_reload]; second_reload_reg = rld[secondary_reload].reg_rtx;
icode = reload_secondary_in_icode[j]; icode = rld[j].secondary_in_icode;
if ((old != oldequiv && ! rtx_equal_p (old, oldequiv)) if ((old != oldequiv && ! rtx_equal_p (old, oldequiv))
|| (reload_in[j] != 0 && reload_out[j] != 0)) || (rld[j].in != 0 && rld[j].out != 0))
{ {
enum reg_class new_class enum reg_class new_class
= SECONDARY_INPUT_RELOAD_CLASS (reload_reg_class[j], = SECONDARY_INPUT_RELOAD_CLASS (rld[j].class,
mode, real_oldequiv); mode, real_oldequiv);
if (new_class == NO_REGS) if (new_class == NO_REGS)
...@@ -6992,12 +6990,12 @@ emit_reload_insns (chain) ...@@ -6992,12 +6990,12 @@ emit_reload_insns (chain)
/* See if we need a scratch register to load the /* See if we need a scratch register to load the
intermediate register (a tertiary reload). */ intermediate register (a tertiary reload). */
enum insn_code tertiary_icode enum insn_code tertiary_icode
= reload_secondary_in_icode[secondary_reload]; = rld[secondary_reload].secondary_in_icode;
if (tertiary_icode != CODE_FOR_nothing) if (tertiary_icode != CODE_FOR_nothing)
{ {
rtx third_reload_reg rtx third_reload_reg
= reload_reg_rtx[reload_secondary_in_reload[secondary_reload]]; = rld[rld[secondary_reload].secondary_in_reload].reg_rtx;
emit_insn ((GEN_FCN (tertiary_icode) emit_insn ((GEN_FCN (tertiary_icode)
(second_reload_reg, real_oldequiv, (second_reload_reg, real_oldequiv,
...@@ -7005,8 +7003,8 @@ emit_reload_insns (chain) ...@@ -7005,8 +7003,8 @@ emit_reload_insns (chain)
} }
else else
gen_reload (second_reload_reg, real_oldequiv, gen_reload (second_reload_reg, real_oldequiv,
reload_opnum[j], rld[j].opnum,
reload_when_needed[j]); rld[j].when_needed);
oldequiv = second_reload_reg; oldequiv = second_reload_reg;
} }
...@@ -7030,9 +7028,9 @@ emit_reload_insns (chain) ...@@ -7030,9 +7028,9 @@ emit_reload_insns (chain)
[REGNO (SUBREG_REG (oldequiv))] != 0) [REGNO (SUBREG_REG (oldequiv))] != 0)
|| (reg_equiv_constant || (reg_equiv_constant
[REGNO (SUBREG_REG (oldequiv))] != 0)))) [REGNO (SUBREG_REG (oldequiv))] != 0))))
real_oldequiv = reload_in[j]; real_oldequiv = rld[j].in;
gen_reload (reloadreg, real_oldequiv, reload_opnum[j], gen_reload (reloadreg, real_oldequiv, rld[j].opnum,
reload_when_needed[j]); rld[j].when_needed);
} }
} }
...@@ -7048,18 +7046,18 @@ emit_reload_insns (chain) ...@@ -7048,18 +7046,18 @@ emit_reload_insns (chain)
reload_override_in[j] = oldequiv; reload_override_in[j] = oldequiv;
} }
/* When inheriting a wider reload, we have a MEM in reload_in[j], /* When inheriting a wider reload, we have a MEM in rld[j].in,
e.g. inheriting a SImode output reload for e.g. inheriting a SImode output reload for
(mem:HI (plus:SI (reg:SI 14 fp) (const_int 10))) */ (mem:HI (plus:SI (reg:SI 14 fp) (const_int 10))) */
if (optimize && reload_inherited[j] && reload_in[j] if (optimize && reload_inherited[j] && rld[j].in
&& GET_CODE (reload_in[j]) == MEM && GET_CODE (rld[j].in) == MEM
&& GET_CODE (reload_in_reg[j]) == MEM && GET_CODE (rld[j].in_reg) == MEM
&& reload_spill_index[j] >= 0 && reload_spill_index[j] >= 0
&& TEST_HARD_REG_BIT (reg_reloaded_valid, reload_spill_index[j])) && TEST_HARD_REG_BIT (reg_reloaded_valid, reload_spill_index[j]))
{ {
expect_occurrences expect_occurrences
= count_occurrences (PATTERN (insn), reload_in[j]) == 1 ? 0 : -1; = count_occurrences (PATTERN (insn), rld[j].in) == 1 ? 0 : -1;
reload_in[j] rld[j].in
= regno_reg_rtx[reg_reloaded_contents[reload_spill_index[j]]]; = regno_reg_rtx[reg_reloaded_contents[reload_spill_index[j]]];
} }
...@@ -7069,28 +7067,28 @@ emit_reload_insns (chain) ...@@ -7069,28 +7067,28 @@ emit_reload_insns (chain)
if (optimize if (optimize
&& (reload_inherited[j] || reload_override_in[j]) && (reload_inherited[j] || reload_override_in[j])
&& reload_reg_rtx[j] && rld[j].reg_rtx
&& GET_CODE (reload_reg_rtx[j]) == REG && GET_CODE (rld[j].reg_rtx) == REG
&& spill_reg_store[REGNO (reload_reg_rtx[j])] != 0 && spill_reg_store[REGNO (rld[j].reg_rtx)] != 0
#if 0 #if 0
/* There doesn't seem to be any reason to restrict this to pseudos /* There doesn't seem to be any reason to restrict this to pseudos
and doing so loses in the case where we are copying from a and doing so loses in the case where we are copying from a
register of the wrong class. */ register of the wrong class. */
&& (REGNO (spill_reg_stored_to[REGNO (reload_reg_rtx[j])]) && (REGNO (spill_reg_stored_to[REGNO (rld[j].reg_rtx)])
>= FIRST_PSEUDO_REGISTER) >= FIRST_PSEUDO_REGISTER)
#endif #endif
/* The insn might have already some references to stackslots /* The insn might have already some references to stackslots
replaced by MEMs, while reload_out_reg still names the replaced by MEMs, while reload_out_reg still names the
original pseudo. */ original pseudo. */
&& (dead_or_set_p (insn, && (dead_or_set_p (insn,
spill_reg_stored_to[REGNO (reload_reg_rtx[j])]) spill_reg_stored_to[REGNO (rld[j].reg_rtx)])
|| rtx_equal_p (spill_reg_stored_to[REGNO (reload_reg_rtx[j])], || rtx_equal_p (spill_reg_stored_to[REGNO (rld[j].reg_rtx)],
reload_out_reg[j]))) rld[j].out_reg)))
delete_output_reload (insn, j, REGNO (reload_reg_rtx[j])); delete_output_reload (insn, j, REGNO (rld[j].reg_rtx));
/* Input-reloading is done. Now do output-reloading, /* Input-reloading is done. Now do output-reloading,
storing the value from the reload-register after the main insn storing the value from the reload-register after the main insn
if reload_out[j] is nonzero. if rld[j].out is nonzero.
??? At some point we need to support handling output reloads of ??? At some point we need to support handling output reloads of
JUMP_INSNs or insns that set cc0. */ JUMP_INSNs or insns that set cc0. */
...@@ -7099,11 +7097,11 @@ emit_reload_insns (chain) ...@@ -7099,11 +7097,11 @@ emit_reload_insns (chain)
not loaded in this same reload, see if we can eliminate a previous not loaded in this same reload, see if we can eliminate a previous
store. */ store. */
{ {
rtx pseudo = reload_out_reg[j]; rtx pseudo = rld[j].out_reg;
if (pseudo if (pseudo
&& GET_CODE (pseudo) == REG && GET_CODE (pseudo) == REG
&& ! rtx_equal_p (reload_in_reg[j], pseudo) && ! rtx_equal_p (rld[j].in_reg, pseudo)
&& REGNO (pseudo) >= FIRST_PSEUDO_REGISTER && REGNO (pseudo) >= FIRST_PSEUDO_REGISTER
&& reg_last_reload_reg[REGNO (pseudo)]) && reg_last_reload_reg[REGNO (pseudo)])
{ {
...@@ -7120,12 +7118,12 @@ emit_reload_insns (chain) ...@@ -7120,12 +7118,12 @@ emit_reload_insns (chain)
} }
} }
old = reload_out_reg[j]; old = rld[j].out_reg;
if (old != 0 if (old != 0
&& reload_reg_rtx[j] != old && rld[j].reg_rtx != old
&& reload_reg_rtx[j] != 0) && rld[j].reg_rtx != 0)
{ {
register rtx reloadreg = reload_reg_rtx[j]; register rtx reloadreg = rld[j].reg_rtx;
#ifdef SECONDARY_OUTPUT_RELOAD_CLASS #ifdef SECONDARY_OUTPUT_RELOAD_CLASS
register rtx second_reloadreg = 0; register rtx second_reloadreg = 0;
#endif #endif
...@@ -7139,7 +7137,7 @@ emit_reload_insns (chain) ...@@ -7139,7 +7137,7 @@ emit_reload_insns (chain)
if ((GET_CODE (old) == REG || GET_CODE (old) == SCRATCH) if ((GET_CODE (old) == REG || GET_CODE (old) == SCRATCH)
&& (note = find_reg_note (insn, REG_UNUSED, old)) != 0) && (note = find_reg_note (insn, REG_UNUSED, old)) != 0)
{ {
XEXP (note, 0) = reload_reg_rtx[j]; XEXP (note, 0) = rld[j].reg_rtx;
continue; continue;
} }
/* Likewise for a SUBREG of an operand that dies. */ /* Likewise for a SUBREG of an operand that dies. */
...@@ -7149,7 +7147,7 @@ emit_reload_insns (chain) ...@@ -7149,7 +7147,7 @@ emit_reload_insns (chain)
SUBREG_REG (old)))) SUBREG_REG (old))))
{ {
XEXP (note, 0) = gen_lowpart_common (GET_MODE (old), XEXP (note, 0) = gen_lowpart_common (GET_MODE (old),
reload_reg_rtx[j]); rld[j].reg_rtx);
continue; continue;
} }
else if (GET_CODE (old) == SCRATCH) else if (GET_CODE (old) == SCRATCH)
...@@ -7171,12 +7169,12 @@ emit_reload_insns (chain) ...@@ -7171,12 +7169,12 @@ emit_reload_insns (chain)
if (GET_CODE (insn) == JUMP_INSN) if (GET_CODE (insn) == JUMP_INSN)
abort (); abort ();
if (reload_when_needed[j] == RELOAD_OTHER) if (rld[j].when_needed == RELOAD_OTHER)
start_sequence (); start_sequence ();
else else
push_to_sequence (output_reload_insns[reload_opnum[j]]); push_to_sequence (output_reload_insns[rld[j].opnum]);
old = reload_out[j]; old = rld[j].out;
/* Determine the mode to reload in. /* Determine the mode to reload in.
See comments above (for input reloading). */ See comments above (for input reloading). */
...@@ -7203,7 +7201,7 @@ emit_reload_insns (chain) ...@@ -7203,7 +7201,7 @@ emit_reload_insns (chain)
one, since it will be stored into OLD. We might need a secondary one, since it will be stored into OLD. We might need a secondary
register only for an input reload, so check again here. */ register only for an input reload, so check again here. */
if (reload_secondary_out_reload[j] >= 0) if (rld[j].secondary_out_reload >= 0)
{ {
rtx real_old = old; rtx real_old = old;
...@@ -7211,18 +7209,18 @@ emit_reload_insns (chain) ...@@ -7211,18 +7209,18 @@ emit_reload_insns (chain)
&& reg_equiv_mem[REGNO (old)] != 0) && reg_equiv_mem[REGNO (old)] != 0)
real_old = reg_equiv_mem[REGNO (old)]; real_old = reg_equiv_mem[REGNO (old)];
if((SECONDARY_OUTPUT_RELOAD_CLASS (reload_reg_class[j], if((SECONDARY_OUTPUT_RELOAD_CLASS (rld[j].class,
mode, real_old) mode, real_old)
!= NO_REGS)) != NO_REGS))
{ {
second_reloadreg = reloadreg; second_reloadreg = reloadreg;
reloadreg = reload_reg_rtx[reload_secondary_out_reload[j]]; reloadreg = rld[rld[j].secondary_out_reload].reg_rtx;
/* See if RELOADREG is to be used as a scratch register /* See if RELOADREG is to be used as a scratch register
or as an intermediate register. */ or as an intermediate register. */
if (reload_secondary_out_icode[j] != CODE_FOR_nothing) if (rld[j].secondary_out_icode != CODE_FOR_nothing)
{ {
emit_insn ((GEN_FCN (reload_secondary_out_icode[j]) emit_insn ((GEN_FCN (rld[j].secondary_out_icode)
(real_old, second_reloadreg, reloadreg))); (real_old, second_reloadreg, reloadreg)));
special = 1; special = 1;
} }
...@@ -7231,9 +7229,9 @@ emit_reload_insns (chain) ...@@ -7231,9 +7229,9 @@ emit_reload_insns (chain)
/* See if we need both a scratch and intermediate reload /* See if we need both a scratch and intermediate reload
register. */ register. */
int secondary_reload = reload_secondary_out_reload[j]; int secondary_reload = rld[j].secondary_out_reload;
enum insn_code tertiary_icode enum insn_code tertiary_icode
= reload_secondary_out_icode[secondary_reload]; = rld[secondary_reload].secondary_out_icode;
if (GET_MODE (reloadreg) != mode) if (GET_MODE (reloadreg) != mode)
reloadreg = gen_rtx_REG (mode, REGNO (reloadreg)); reloadreg = gen_rtx_REG (mode, REGNO (reloadreg));
...@@ -7241,7 +7239,7 @@ emit_reload_insns (chain) ...@@ -7241,7 +7239,7 @@ emit_reload_insns (chain)
if (tertiary_icode != CODE_FOR_nothing) if (tertiary_icode != CODE_FOR_nothing)
{ {
rtx third_reloadreg rtx third_reloadreg
= reload_reg_rtx[reload_secondary_out_reload[secondary_reload]]; = rld[rld[secondary_reload].secondary_out_reload].reg_rtx;
rtx tem; rtx tem;
/* Copy primary reload reg to secondary reload reg. /* Copy primary reload reg to secondary reload reg.
...@@ -7260,7 +7258,7 @@ emit_reload_insns (chain) ...@@ -7260,7 +7258,7 @@ emit_reload_insns (chain)
real_old = SUBREG_REG (real_old), reloadreg = tem; real_old = SUBREG_REG (real_old), reloadreg = tem;
gen_reload (reloadreg, second_reloadreg, gen_reload (reloadreg, second_reloadreg,
reload_opnum[j], reload_when_needed[j]); rld[j].opnum, rld[j].when_needed);
emit_insn ((GEN_FCN (tertiary_icode) emit_insn ((GEN_FCN (tertiary_icode)
(real_old, reloadreg, third_reloadreg))); (real_old, reloadreg, third_reloadreg)));
special = 1; special = 1;
...@@ -7271,7 +7269,7 @@ emit_reload_insns (chain) ...@@ -7271,7 +7269,7 @@ emit_reload_insns (chain)
OUT later. */ OUT later. */
gen_reload (reloadreg, second_reloadreg, gen_reload (reloadreg, second_reloadreg,
reload_opnum[j], reload_when_needed[j]); rld[j].opnum, rld[j].when_needed);
} }
} }
} }
...@@ -7290,8 +7288,8 @@ emit_reload_insns (chain) ...@@ -7290,8 +7288,8 @@ emit_reload_insns (chain)
|| rtx_equal_p (old, SET_DEST (set)) || rtx_equal_p (old, SET_DEST (set))
|| !reg_mentioned_p (old, SET_SRC (set)) || !reg_mentioned_p (old, SET_SRC (set))
|| !regno_clobbered_p (REGNO (old), insn)) || !regno_clobbered_p (REGNO (old), insn))
gen_reload (old, reloadreg, reload_opnum[j], gen_reload (old, reloadreg, rld[j].opnum,
reload_when_needed[j]); rld[j].when_needed);
} }
/* Look at all insns we emitted, just to be safe. */ /* Look at all insns we emitted, just to be safe. */
...@@ -7306,12 +7304,12 @@ emit_reload_insns (chain) ...@@ -7306,12 +7304,12 @@ emit_reload_insns (chain)
reg_has_output_reload will make this do nothing. */ reg_has_output_reload will make this do nothing. */
note_stores (pat, forget_old_reloads_1); note_stores (pat, forget_old_reloads_1);
if (reg_mentioned_p (reload_reg_rtx[j], pat)) if (reg_mentioned_p (rld[j].reg_rtx, pat))
{ {
rtx set = single_set (insn); rtx set = single_set (insn);
if (reload_spill_index[j] < 0 if (reload_spill_index[j] < 0
&& set && set
&& SET_SRC (set) == reload_reg_rtx[j]) && SET_SRC (set) == rld[j].reg_rtx)
{ {
int src = REGNO (SET_SRC (set)); int src = REGNO (SET_SRC (set));
...@@ -7320,9 +7318,9 @@ emit_reload_insns (chain) ...@@ -7320,9 +7318,9 @@ emit_reload_insns (chain)
if (find_regno_note (insn, REG_DEAD, src)) if (find_regno_note (insn, REG_DEAD, src))
SET_HARD_REG_BIT (reg_reloaded_died, src); SET_HARD_REG_BIT (reg_reloaded_died, src);
} }
if (REGNO (reload_reg_rtx[j]) < FIRST_PSEUDO_REGISTER) if (REGNO (rld[j].reg_rtx) < FIRST_PSEUDO_REGISTER)
{ {
int s = reload_secondary_out_reload[j]; int s = rld[j].secondary_out_reload;
set = single_set (p); set = single_set (p);
/* If this reload copies only to the secondary reload /* If this reload copies only to the secondary reload
register, the secondary reload does the actual register, the secondary reload does the actual
...@@ -7332,17 +7330,17 @@ emit_reload_insns (chain) ...@@ -7332,17 +7330,17 @@ emit_reload_insns (chain)
has and where the actual store to the pseudo is has and where the actual store to the pseudo is
made; leave new_spill_reg_store alone. */ made; leave new_spill_reg_store alone. */
else if (s >= 0 else if (s >= 0
&& SET_SRC (set) == reload_reg_rtx[j] && SET_SRC (set) == rld[j].reg_rtx
&& SET_DEST (set) == reload_reg_rtx[s]) && SET_DEST (set) == rld[s].reg_rtx)
{ {
/* Usually the next instruction will be the /* Usually the next instruction will be the
secondary reload insn; if we can confirm secondary reload insn; if we can confirm
that it is, setting new_spill_reg_store to that it is, setting new_spill_reg_store to
that insn will allow an extra optimization. */ that insn will allow an extra optimization. */
rtx s_reg = reload_reg_rtx[s]; rtx s_reg = rld[s].reg_rtx;
rtx next = NEXT_INSN (p); rtx next = NEXT_INSN (p);
reload_out[s] = reload_out[j]; rld[s].out = rld[j].out;
reload_out_reg[s] = reload_out_reg[j]; rld[s].out_reg = rld[j].out_reg;
set = single_set (next); set = single_set (next);
if (set && SET_SRC (set) == s_reg if (set && SET_SRC (set) == s_reg
&& ! new_spill_reg_store[REGNO (s_reg)]) && ! new_spill_reg_store[REGNO (s_reg)])
...@@ -7353,18 +7351,18 @@ emit_reload_insns (chain) ...@@ -7353,18 +7351,18 @@ emit_reload_insns (chain)
} }
} }
else else
new_spill_reg_store[REGNO (reload_reg_rtx[j])] = p; new_spill_reg_store[REGNO (rld[j].reg_rtx)] = p;
} }
} }
} }
if (reload_when_needed[j] == RELOAD_OTHER) if (rld[j].when_needed == RELOAD_OTHER)
{ {
emit_insns (other_output_reload_insns[reload_opnum[j]]); emit_insns (other_output_reload_insns[rld[j].opnum]);
other_output_reload_insns[reload_opnum[j]] = get_insns (); other_output_reload_insns[rld[j].opnum] = get_insns ();
} }
else else
output_reload_insns[reload_opnum[j]] = get_insns (); output_reload_insns[rld[j].opnum] = get_insns ();
end_sequence (); end_sequence ();
} }
...@@ -7440,10 +7438,10 @@ emit_reload_insns (chain) ...@@ -7440,10 +7438,10 @@ emit_reload_insns (chain)
clear any memory of a previous store to the same pseudo. Only do clear any memory of a previous store to the same pseudo. Only do
something if there will not be an output reload for the pseudo something if there will not be an output reload for the pseudo
being reloaded. */ being reloaded. */
if (reload_in_reg[r] != 0 if (rld[r].in_reg != 0
&& ! (reload_inherited[r] || reload_override_in[r])) && ! (reload_inherited[r] || reload_override_in[r]))
{ {
rtx reg = reload_in_reg[r]; rtx reg = rld[r].in_reg;
if (GET_CODE (reg) == SUBREG) if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg); reg = SUBREG_REG (reg);
...@@ -7465,13 +7463,13 @@ emit_reload_insns (chain) ...@@ -7465,13 +7463,13 @@ emit_reload_insns (chain)
} }
/* I is nonneg if this reload used a register. /* I is nonneg if this reload used a register.
If reload_reg_rtx[r] is 0, this is an optional reload If rld[r].reg_rtx is 0, this is an optional reload
that we opted to ignore. */ that we opted to ignore. */
if (i >= 0 && reload_reg_rtx[r] != 0) if (i >= 0 && rld[r].reg_rtx != 0)
{ {
int nr int nr
= HARD_REGNO_NREGS (i, GET_MODE (reload_reg_rtx[r])); = HARD_REGNO_NREGS (i, GET_MODE (rld[r].reg_rtx));
int k; int k;
int part_reaches_end = 0; int part_reaches_end = 0;
int all_reaches_end = 1; int all_reaches_end = 1;
...@@ -7480,8 +7478,8 @@ emit_reload_insns (chain) ...@@ -7480,8 +7478,8 @@ emit_reload_insns (chain)
of the value lives to the end. */ of the value lives to the end. */
for (k = 0; k < nr; k++) for (k = 0; k < nr; k++)
{ {
if (reload_reg_reaches_end_p (i + k, reload_opnum[r], if (reload_reg_reaches_end_p (i + k, rld[r].opnum,
reload_when_needed[r])) rld[r].when_needed))
part_reaches_end = 1; part_reaches_end = 1;
else else
all_reaches_end = 0; all_reaches_end = 0;
...@@ -7498,26 +7496,26 @@ emit_reload_insns (chain) ...@@ -7498,26 +7496,26 @@ emit_reload_insns (chain)
CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k); CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k);
/* Maybe the spill reg contains a copy of reload_out. */ /* Maybe the spill reg contains a copy of reload_out. */
if (reload_out[r] != 0 if (rld[r].out != 0
&& (GET_CODE (reload_out[r]) == REG && (GET_CODE (rld[r].out) == REG
#ifdef AUTO_INC_DEC #ifdef AUTO_INC_DEC
|| ! reload_out_reg[r] || ! rld[r].out_reg
#endif #endif
|| GET_CODE (reload_out_reg[r]) == REG)) || GET_CODE (rld[r].out_reg) == REG))
{ {
rtx out = (GET_CODE (reload_out[r]) == REG rtx out = (GET_CODE (rld[r].out) == REG
? reload_out[r] ? rld[r].out
: reload_out_reg[r] : rld[r].out_reg
? reload_out_reg[r] ? rld[r].out_reg
/* AUTO_INC */ : XEXP (reload_in_reg[r], 0)); /* AUTO_INC */ : XEXP (rld[r].in_reg, 0));
register int nregno = REGNO (out); register int nregno = REGNO (out);
int nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1 int nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1
: HARD_REGNO_NREGS (nregno, : HARD_REGNO_NREGS (nregno,
GET_MODE (reload_reg_rtx[r]))); GET_MODE (rld[r].reg_rtx)));
spill_reg_store[i] = new_spill_reg_store[i]; spill_reg_store[i] = new_spill_reg_store[i];
spill_reg_stored_to[i] = out; spill_reg_stored_to[i] = out;
reg_last_reload_reg[nregno] = reload_reg_rtx[r]; reg_last_reload_reg[nregno] = rld[r].reg_rtx;
/* If NREGNO is a hard register, it may occupy more than /* If NREGNO is a hard register, it may occupy more than
one register. If it does, say what is in the one register. If it does, say what is in the
...@@ -7529,8 +7527,8 @@ emit_reload_insns (chain) ...@@ -7529,8 +7527,8 @@ emit_reload_insns (chain)
for (k = 1; k < nnr; k++) for (k = 1; k < nnr; k++)
reg_last_reload_reg[nregno + k] reg_last_reload_reg[nregno + k]
= (nr == nnr = (nr == nnr
? gen_rtx_REG (reg_raw_mode[REGNO (reload_reg_rtx[r]) + k], ? gen_rtx_REG (reg_raw_mode[REGNO (rld[r].reg_rtx) + k],
REGNO (reload_reg_rtx[r]) + k) REGNO (rld[r].reg_rtx) + k)
: 0); : 0);
/* Now do the inverse operation. */ /* Now do the inverse operation. */
...@@ -7549,38 +7547,38 @@ emit_reload_insns (chain) ...@@ -7549,38 +7547,38 @@ emit_reload_insns (chain)
/* Maybe the spill reg contains a copy of reload_in. Only do /* Maybe the spill reg contains a copy of reload_in. Only do
something if there will not be an output reload for something if there will not be an output reload for
the register being reloaded. */ the register being reloaded. */
else if (reload_out_reg[r] == 0 else if (rld[r].out_reg == 0
&& reload_in[r] != 0 && rld[r].in != 0
&& ((GET_CODE (reload_in[r]) == REG && ((GET_CODE (rld[r].in) == REG
&& REGNO (reload_in[r]) >= FIRST_PSEUDO_REGISTER && REGNO (rld[r].in) >= FIRST_PSEUDO_REGISTER
&& ! reg_has_output_reload[REGNO (reload_in[r])]) && ! reg_has_output_reload[REGNO (rld[r].in)])
|| (GET_CODE (reload_in_reg[r]) == REG || (GET_CODE (rld[r].in_reg) == REG
&& ! reg_has_output_reload[REGNO (reload_in_reg[r])])) && ! reg_has_output_reload[REGNO (rld[r].in_reg)]))
&& ! reg_set_p (reload_reg_rtx[r], PATTERN (insn))) && ! reg_set_p (rld[r].reg_rtx, PATTERN (insn)))
{ {
register int nregno; register int nregno;
int nnr; int nnr;
if (GET_CODE (reload_in[r]) == REG if (GET_CODE (rld[r].in) == REG
&& REGNO (reload_in[r]) >= FIRST_PSEUDO_REGISTER) && REGNO (rld[r].in) >= FIRST_PSEUDO_REGISTER)
nregno = REGNO (reload_in[r]); nregno = REGNO (rld[r].in);
else if (GET_CODE (reload_in_reg[r]) == REG) else if (GET_CODE (rld[r].in_reg) == REG)
nregno = REGNO (reload_in_reg[r]); nregno = REGNO (rld[r].in_reg);
else else
nregno = REGNO (XEXP (reload_in_reg[r], 0)); nregno = REGNO (XEXP (rld[r].in_reg, 0));
nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1 nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1
: HARD_REGNO_NREGS (nregno, : HARD_REGNO_NREGS (nregno,
GET_MODE (reload_reg_rtx[r]))); GET_MODE (rld[r].reg_rtx)));
reg_last_reload_reg[nregno] = reload_reg_rtx[r]; reg_last_reload_reg[nregno] = rld[r].reg_rtx;
if (nregno < FIRST_PSEUDO_REGISTER) if (nregno < FIRST_PSEUDO_REGISTER)
for (k = 1; k < nnr; k++) for (k = 1; k < nnr; k++)
reg_last_reload_reg[nregno + k] reg_last_reload_reg[nregno + k]
= (nr == nnr = (nr == nnr
? gen_rtx_REG (reg_raw_mode[REGNO (reload_reg_rtx[r]) + k], ? gen_rtx_REG (reg_raw_mode[REGNO (rld[r].reg_rtx) + k],
REGNO (reload_reg_rtx[r]) + k) REGNO (rld[r].reg_rtx) + k)
: 0); : 0);
/* Unless we inherited this reload, show we haven't /* Unless we inherited this reload, show we haven't
...@@ -7588,7 +7586,7 @@ emit_reload_insns (chain) ...@@ -7588,7 +7586,7 @@ emit_reload_insns (chain)
Previous stores of inherited auto_inc expressions Previous stores of inherited auto_inc expressions
also have to be discarded. */ also have to be discarded. */
if (! reload_inherited[r] if (! reload_inherited[r]
|| (reload_out[r] && ! reload_out_reg[r])) || (rld[r].out && ! rld[r].out_reg))
spill_reg_store[i] = 0; spill_reg_store[i] = 0;
for (k = 0; k < nr; k++) for (k = 0; k < nr; k++)
...@@ -7610,8 +7608,8 @@ emit_reload_insns (chain) ...@@ -7610,8 +7608,8 @@ emit_reload_insns (chain)
{ {
for (k = 0; k < nr; k++) for (k = 0; k < nr; k++)
if (reload_reg_reaches_end_p (i + k, if (reload_reg_reaches_end_p (i + k,
reload_opnum[r], rld[r].opnum,
reload_when_needed[r])) rld[r].when_needed))
CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k); CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k);
} }
} }
...@@ -7624,13 +7622,13 @@ emit_reload_insns (chain) ...@@ -7624,13 +7622,13 @@ emit_reload_insns (chain)
that invalidates any previous reloaded copy of it. that invalidates any previous reloaded copy of it.
But forget_old_reloads_1 won't get to see it, because But forget_old_reloads_1 won't get to see it, because
it thinks only about the original insn. So invalidate it here. */ it thinks only about the original insn. So invalidate it here. */
if (i < 0 && reload_out[r] != 0 if (i < 0 && rld[r].out != 0
&& (GET_CODE (reload_out[r]) == REG && (GET_CODE (rld[r].out) == REG
|| (GET_CODE (reload_out[r]) == MEM || (GET_CODE (rld[r].out) == MEM
&& GET_CODE (reload_out_reg[r]) == REG))) && GET_CODE (rld[r].out_reg) == REG)))
{ {
rtx out = (GET_CODE (reload_out[r]) == REG rtx out = (GET_CODE (rld[r].out) == REG
? reload_out[r] : reload_out_reg[r]); ? rld[r].out : rld[r].out_reg);
register int nregno = REGNO (out); register int nregno = REGNO (out);
if (nregno >= FIRST_PSEUDO_REGISTER) if (nregno >= FIRST_PSEUDO_REGISTER)
{ {
...@@ -7641,14 +7639,14 @@ emit_reload_insns (chain) ...@@ -7641,14 +7639,14 @@ emit_reload_insns (chain)
/* If we can find a hard register that is stored, record /* If we can find a hard register that is stored, record
the storing insn so that we may delete this insn with the storing insn so that we may delete this insn with
delete_output_reload. */ delete_output_reload. */
src_reg = reload_reg_rtx[r]; src_reg = rld[r].reg_rtx;
/* If this is an optional reload, try to find the source reg /* If this is an optional reload, try to find the source reg
from an input reload. */ from an input reload. */
if (! src_reg) if (! src_reg)
{ {
rtx set = single_set (insn); rtx set = single_set (insn);
if (set && SET_DEST (set) == reload_out[r]) if (set && SET_DEST (set) == rld[r].out)
{ {
int k; int k;
...@@ -7656,9 +7654,9 @@ emit_reload_insns (chain) ...@@ -7656,9 +7654,9 @@ emit_reload_insns (chain)
store_insn = insn; store_insn = insn;
for (k = 0; k < n_reloads; k++) for (k = 0; k < n_reloads; k++)
{ {
if (reload_in[k] == src_reg) if (rld[k].in == src_reg)
{ {
src_reg = reload_reg_rtx[k]; src_reg = rld[k].reg_rtx;
break; break;
} }
} }
...@@ -7697,7 +7695,7 @@ emit_reload_insns (chain) ...@@ -7697,7 +7695,7 @@ emit_reload_insns (chain)
} }
else else
{ {
int num_regs = HARD_REGNO_NREGS (nregno,GET_MODE (reload_out[r])); int num_regs = HARD_REGNO_NREGS (nregno,GET_MODE (rld[r].out));
while (num_regs-- > 0) while (num_regs-- > 0)
reg_last_reload_reg[nregno + num_regs] = 0; reg_last_reload_reg[nregno + num_regs] = 0;
...@@ -7731,9 +7729,9 @@ gen_reload (out, in, opnum, type) ...@@ -7731,9 +7729,9 @@ gen_reload (out, in, opnum, type)
&& (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (in)), out)) != 0) && (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (in)), out)) != 0)
in = SUBREG_REG (in), out = tem; in = SUBREG_REG (in), out = tem;
else if (GET_CODE (out) == SUBREG else if (GET_CODE (out) == SUBREG
&& (GET_MODE_SIZE (GET_MODE (out)) && (GET_MODE_SIZE (GET_MODE (out))
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (out)))) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))))
&& (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (out)), in)) != 0) && (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (out)), in)) != 0)
out = SUBREG_REG (out), in = tem; out = SUBREG_REG (out), in = tem;
/* How to do this reload can get quite tricky. Normally, we are being /* How to do this reload can get quite tricky. Normally, we are being
...@@ -7960,14 +7958,14 @@ delete_output_reload (insn, j, last_reload_reg) ...@@ -7960,14 +7958,14 @@ delete_output_reload (insn, j, last_reload_reg)
insn than it is inherited. */ insn than it is inherited. */
for (k = n_reloads - 1; k >= 0; k--) for (k = n_reloads - 1; k >= 0; k--)
{ {
rtx reg2 = reload_in[k]; rtx reg2 = rld[k].in;
if (! reg2) if (! reg2)
continue; continue;
if (GET_CODE (reg2) == MEM || reload_override_in[k]) if (GET_CODE (reg2) == MEM || reload_override_in[k])
reg2 = reload_in_reg[k]; reg2 = rld[k].in_reg;
#ifdef AUTO_INC_DEC #ifdef AUTO_INC_DEC
if (reload_out[k] && ! reload_out_reg[k]) if (rld[k].out && ! rld[k].out_reg)
reg2 = XEXP (reload_in_reg[k], 0); reg2 = XEXP (rld[k].in_reg, 0);
#endif #endif
while (GET_CODE (reg2) == SUBREG) while (GET_CODE (reg2) == SUBREG)
reg2 = SUBREG_REG (reg2); reg2 = SUBREG_REG (reg2);
...@@ -7976,7 +7974,7 @@ delete_output_reload (insn, j, last_reload_reg) ...@@ -7976,7 +7974,7 @@ delete_output_reload (insn, j, last_reload_reg)
if (reload_inherited[k] || reload_override_in[k] || k == j) if (reload_inherited[k] || reload_override_in[k] || k == j)
{ {
n_inherited++; n_inherited++;
reg2 = reload_out_reg[k]; reg2 = rld[k].out_reg;
if (! reg2) if (! reg2)
continue; continue;
while (GET_CODE (reg2) == SUBREG) while (GET_CODE (reg2) == SUBREG)
...@@ -8029,7 +8027,7 @@ delete_output_reload (insn, j, last_reload_reg) ...@@ -8029,7 +8027,7 @@ delete_output_reload (insn, j, last_reload_reg)
See if the pseudo reg has been completely replaced See if the pseudo reg has been completely replaced
with reload regs. If so, delete the store insn with reload regs. If so, delete the store insn
and forget we had a stack slot for the pseudo. */ and forget we had a stack slot for the pseudo. */
if (reload_out[j] != reload_in[j] if (rld[j].out != rld[j].in
&& REG_N_DEATHS (REGNO (reg)) == 1 && REG_N_DEATHS (REGNO (reg)) == 1
&& REG_N_SETS (REGNO (reg)) == 1 && REG_N_SETS (REGNO (reg)) == 1
&& REG_BASIC_BLOCK (REGNO (reg)) >= 0 && REG_BASIC_BLOCK (REGNO (reg)) >= 0
...@@ -8087,7 +8085,7 @@ delete_output_reload (insn, j, last_reload_reg) ...@@ -8087,7 +8085,7 @@ delete_output_reload (insn, j, last_reload_reg)
/* For the debugging info, /* For the debugging info,
say the pseudo lives in this reload reg. */ say the pseudo lives in this reload reg. */
reg_renumber[REGNO (reg)] = REGNO (reload_reg_rtx[j]); reg_renumber[REGNO (reg)] = REGNO (rld[j].reg_rtx);
alter_reg (REGNO (reg), -1); alter_reg (REGNO (reg), -1);
} }
delete_address_reloads (output_reload_insn, insn); delete_address_reloads (output_reload_insn, insn);
...@@ -8208,11 +8206,11 @@ delete_address_reloads_1 (dead_insn, x, current_insn) ...@@ -8208,11 +8206,11 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
if (i2 == current_insn) if (i2 == current_insn)
{ {
for (j = n_reloads - 1; j >= 0; j--) for (j = n_reloads - 1; j >= 0; j--)
if ((reload_reg_rtx[j] == dst && reload_inherited[j]) if ((rld[j].reg_rtx == dst && reload_inherited[j])
|| reload_override_in[j] == dst) || reload_override_in[j] == dst)
return; return;
for (j = n_reloads - 1; j >= 0; j--) for (j = n_reloads - 1; j >= 0; j--)
if (reload_in[j] && reload_reg_rtx[j] == dst) if (rld[j].in && rld[j].reg_rtx == dst)
break; break;
if (j >= 0) if (j >= 0)
break; break;
...@@ -8227,7 +8225,7 @@ delete_address_reloads_1 (dead_insn, x, current_insn) ...@@ -8227,7 +8225,7 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
if (i2 == current_insn) if (i2 == current_insn)
{ {
for (j = n_reloads - 1; j >= 0; j--) for (j = n_reloads - 1; j >= 0; j--)
if ((reload_reg_rtx[j] == dst && reload_inherited[j]) if ((rld[j].reg_rtx == dst && reload_inherited[j])
|| reload_override_in[j] == dst) || reload_override_in[j] == dst)
return; return;
/* ??? We can't finish the loop here, because dst might be /* ??? We can't finish the loop here, because dst might be
...@@ -9638,13 +9636,13 @@ reload_combine () ...@@ -9638,13 +9636,13 @@ reload_combine ()
reload_combine_ruid++; reload_combine_ruid++;
/* Look for (set (REGX) (CONST_INT)) /* Look for (set (REGX) (CONST_INT))
(set (REGX) (PLUS (REGX) (REGY))) (set (REGX) (PLUS (REGX) (REGY)))
... ...
... (MEM (REGX)) ... ... (MEM (REGX)) ...
and convert it to and convert it to
(set (REGZ) (CONST_INT)) (set (REGZ) (CONST_INT))
... ...
... (MEM (PLUS (REGZ) (REGY)))... . ... (MEM (PLUS (REGZ) (REGY)))... .
First, check that we have (set (REGX) (PLUS (REGX) (REGY))) First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
and that we know all uses of REGX before it dies. */ and that we know all uses of REGX before it dies. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment