reload.c (find_reloads): Do not use the mode specified in the insn pattern as reload mode for address...

* reload.c (find_reloads): Do not use the mode specified in the insn
	pattern as reload mode for address operands.  Do not generate optional
	reloads for operands where a mandatory reload was already pushed.

From-SVN: r62410
This commit is contained in:
Ulrich Weigand 2003-02-04 22:47:23 +00:00 committed by Ulrich Weigand
parent 2de2cd7851
commit 9537511bfa
2 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2003-02-04 Ulrich Weigand <uweigand@de.ibm.com>
* reload.c (find_reloads): Do not use the mode specified in the insn
pattern as reload mode for address operands. Do not generate optional
reloads for operands where a mandatory reload was already pushed.
2003-02-04 Richard Henderson <rth@redhat.com>
* longlong.h [alpha] (count_leading_zeros, count_trailing_zeros): Use

View File

@ -2476,6 +2476,8 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
char pref_or_nothing[MAX_RECOG_OPERANDS];
/* Nonzero for a MEM operand whose entire address needs a reload. */
int address_reloaded[MAX_RECOG_OPERANDS];
/* Nonzero for an address operand that needs to be completely reloaded. */
int address_operand_reloaded[MAX_RECOG_OPERANDS];
/* Value of enum reload_type to use for operand. */
enum reload_type operand_type[MAX_RECOG_OPERANDS];
/* Value of enum reload_type to use within address of operand. */
@ -2655,6 +2657,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
RTX_CODE code = GET_CODE (recog_data.operand[i]);
address_reloaded[i] = 0;
address_operand_reloaded[i] = 0;
operand_type[i] = (modified[i] == RELOAD_READ ? RELOAD_FOR_INPUT
: modified[i] == RELOAD_WRITE ? RELOAD_FOR_OUTPUT
: RELOAD_OTHER);
@ -2669,10 +2672,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
else if (constraints[i][0] == 'p'
|| EXTRA_ADDRESS_CONSTRAINT (constraints[i][0], constraints[i]))
{
find_reloads_address (recog_data.operand_mode[i], (rtx*) 0,
recog_data.operand[i],
recog_data.operand_loc[i],
i, operand_type[i], ind_levels, insn);
address_operand_reloaded[i]
= find_reloads_address (recog_data.operand_mode[i], (rtx*) 0,
recog_data.operand[i],
recog_data.operand_loc[i],
i, operand_type[i], ind_levels, insn);
/* If we now have a simple operand where we used to have a
PLUS or MULT, re-recognize and try again. */
@ -2689,6 +2693,10 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
recog_data.operand[i] = *recog_data.operand_loc[i];
substed_operand[i] = recog_data.operand[i];
/* Address operands are reloaded in their existing mode,
no matter what is specified in the machine description. */
operand_mode[i] = GET_MODE (recog_data.operand[i]);
}
else if (code == MEM)
{
@ -3302,10 +3310,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
the address into a base register. */
this_alternative[i] = (int) MODE_BASE_REG_CLASS (VOIDmode);
badop = 0;
/* Address constraints are reloaded in Pmode, no matter
what mode is given in the machine description. */
operand_mode[i] = Pmode;
break;
}
@ -3878,6 +3882,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
}
else if (goal_alternative_matched[i] < 0
&& goal_alternative_matches[i] < 0
&& !address_operand_reloaded[i]
&& optimize)
{
/* For each non-matching operand that's a MEM or a pseudo-register