From d58005c7d647a2c0ae5f842c34792f2582879e10 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 14 Oct 2004 18:32:04 +0000 Subject: 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 --- gcc/reload.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gcc/reload.c') 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++) -- cgit v1.1