aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2003-02-04 22:47:23 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2003-02-04 22:47:23 +0000
commit9537511bfa8ba1b5e2b6309ded0583ea247b9d49 (patch)
tree42f6f5502a1bb0672a9f31306e356f8af989735f /gcc
parent2de2cd7851fa02594628e7fb79c077e23a2b4374 (diff)
downloadgcc-9537511bfa8ba1b5e2b6309ded0583ea247b9d49.zip
gcc-9537511bfa8ba1b5e2b6309ded0583ea247b9d49.tar.gz
gcc-9537511bfa8ba1b5e2b6309ded0583ea247b9d49.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/reload.c21
2 files changed, 19 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 411627d..dfafdec 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/reload.c b/gcc/reload.c
index 46d0d64..a2642aa 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -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