aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2004-10-14 18:32:04 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2004-10-14 18:32:04 +0000
commitd58005c7d647a2c0ae5f842c34792f2582879e10 (patch)
tree0c4c2b3cfe155b28ab774d52e64484b7007ac262 /gcc
parent3020563ae2865bc728ad4f113dfd36e6b0bb764a (diff)
downloadgcc-d58005c7d647a2c0ae5f842c34792f2582879e10.zip
gcc-d58005c7d647a2c0ae5f842c34792f2582879e10.tar.gz
gcc-d58005c7d647a2c0ae5f842c34792f2582879e10.tar.bz2
reload.c (find_reloads): When reloading a PLUS with constant operand...
* reload.c (find_reloads): When reloading a PLUS with constant operand, make sure the constant is pushed to the constant pool if required. * config/s390/s390.c (s390_secondary_input_reload_class): Remove reload bug workaround. (s390_expand_plus_operand): Likewise. From-SVN: r89047
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/s390/s390.c16
-rw-r--r--gcc/reload.c21
3 files changed, 31 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 221ebc4..a685ef6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-14 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * reload.c (find_reloads): When reloading a PLUS with constant
+ operand, make sure the constant is pushed to the constant pool
+ if required.
+ * config/s390/s390.c (s390_secondary_input_reload_class): Remove
+ reload bug workaround.
+ (s390_expand_plus_operand): Likewise.
+
2004-10-14 David Edelsohn <edelsohn@gnu.org>
* opts.c (common_handle_option): Do not enable
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index c67ad19..89e1cb1 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -2274,17 +2274,7 @@ s390_secondary_input_reload_class (enum reg_class class ATTRIBUTE_UNUSED,
enum machine_mode mode, rtx in)
{
if (s390_plus_operand (in, mode))
- {
- /* ??? Reload sometimes pushes a PLUS reload with a too-large constant.
- Until reload is fixed, we need to force_const_mem while emitting the
- secondary reload insn -- thus we need to make sure here that we do
- have a literal pool for the current function. */
- if (CONSTANT_P (XEXP (in, 1))
- && !legitimate_reload_constant_p (XEXP (in, 1)))
- current_function_uses_const_pool = true;
-
- return ADDR_REGS;
- }
+ return ADDR_REGS;
return NO_REGS;
}
@@ -2366,10 +2356,6 @@ s390_expand_plus_operand (register rtx target, register rtx src,
}
if (true_regnum (sum2) < 1 || true_regnum (sum2) > 15)
{
- /* ??? See comment in s390_secondary_input_reload_class. */
- if (CONSTANT_P (sum2) && !legitimate_reload_constant_p (sum2))
- sum2 = force_const_mem (Pmode, sum2);
-
emit_move_insn (scratch, sum2);
sum2 = scratch;
}
diff --git a/gcc/reload.c b/gcc/reload.c
index f6a008d..66894dc 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -3778,6 +3778,27 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
goal_alternative_win[i] = 1;
}
+ /* Likewise any invalid constants appearing as operand of a PLUS
+ that is to be reloaded. */
+ for (i = 0; i < noperands; i++)
+ if (! goal_alternative_win[i]
+ && GET_CODE (recog_data.operand[i]) == PLUS
+ && CONST_POOL_OK_P (XEXP (recog_data.operand[i], 1))
+ && (PREFERRED_RELOAD_CLASS (XEXP (recog_data.operand[i], 1),
+ (enum reg_class) goal_alternative[i])
+ == NO_REGS)
+ && operand_mode[i] != VOIDmode)
+ {
+ rtx tem = force_const_mem (operand_mode[i],
+ XEXP (recog_data.operand[i], 1));
+ tem = gen_rtx_PLUS (operand_mode[i],
+ XEXP (recog_data.operand[i], 0), tem);
+
+ substed_operand[i] = recog_data.operand[i]
+ = find_reloads_toplev (tem, i, address_type[i],
+ ind_levels, 0, insn, NULL);
+ }
+
/* Record the values of the earlyclobber operands for the caller. */
if (goal_earlyclobber)
for (i = 0; i < noperands; i++)