diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2011-04-21 09:37:44 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-04-21 09:37:44 +0000 |
commit | fbbf66e77a385fc1901fdc33c1d977681cab39bf (patch) | |
tree | eaf6c68a5f7e3822c501346ded206279f68c7bec /gcc/reload.c | |
parent | e85df92e7d3da03b3f893d378c5c64ceee1de7e1 (diff) | |
download | gcc-fbbf66e77a385fc1901fdc33c1d977681cab39bf.zip gcc-fbbf66e77a385fc1901fdc33c1d977681cab39bf.tar.gz gcc-fbbf66e77a385fc1901fdc33c1d977681cab39bf.tar.bz2 |
target.def (cannot_force_const_mem): Add a mode argument.
gcc/
* target.def (cannot_force_const_mem): Add a mode argument.
* doc/tm.texi.in (TARGET_CANNOT_FORCE_CONST_MEM): Update accordingly.
* doc/tm.texi: Regenerate.
* hooks.h (hook_bool_mode_rtx_false): Declare.
* hooks.c (hook_bool_mode_const_rtx_false): Fix commentary.
(hook_bool_mode_const_rtx_true): Likewise.
(hook_bool_mode_rtx_false): New function.
* reload.c (CONST_POOL_OK_P): Take a mode argument and require it
to be non-VOID. Update call to cannot_force_const_mem.
(find_reloads): Update accordingly.
* varasm.c (force_const_mem): Update call to cannot_force_const_mem.
* config/alpha/alpha.c (alpha_cannot_force_const_mem): Add a mode
argument.
* config/arm/arm-protos.h (arm_cannot_force_const_mem): Likewise.
* config/arm/arm.h (LEGITIMATE_CONSTANT_P): Update call.
* config/arm/arm.c (arm_cannot_force_const_mem): Add a mode argument.
* config/bfin/bfin.c (bfin_cannot_force_const_mem): Likewise.
* config/frv/frv.c (frv_cannot_force_const_mem): Likewise.
* config/i386/i386.c (ix86_cannot_force_const_mem): Likewise.
* config/ia64/ia64.c (ia64_cannot_force_const_mem): Likewise.
* config/m68k/m68k.c (TARGET_CANNOT_FORCE_CONST_MEM): Redefine to...
(m68k_cannot_force_const_mem): ...this new function.
* config/mips/mips.c (mips_cannot_force_const_mem): Add a mode
argument.
(mips_const_insns, mips_legitimize_const_move): Update calls.
(mips_secondary_reload_class): Likewise.
* config/pa/pa.c (TARGET_CANNOT_FORCE_CONST_MEM): Redefine to...
(pa_cannot_force_const_mem): ...this new function.
* config/rs6000/rs6000.c (TARGET_CANNOT_FORCE_CONST_MEM): Reefine
to...
(rs6000_cannot_force_const_mem): ...this new function.
* config/s390/s390.c (s390_cannot_force_const_mem): Add a mode
argument.
* config/sparc/sparc.c (sparc_cannot_force_const_mem): Likewise.
* config/xtensa/xtensa.c (TARGET_CANNOT_FORCE_CONST_MEM): Redefine
to...
(xtensa_cannot_force_const_mem): ...this new function.
From-SVN: r172813
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index 582371f..372eccc 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -112,11 +112,13 @@ a register with any other reload. */ #include "target.h" #include "ira.h" -/* True if X is a constant that can be forced into the constant pool. */ -#define CONST_POOL_OK_P(X) \ - (CONSTANT_P (X) \ +/* True if X is a constant that can be forced into the constant pool. + MODE is the mode of the operand, or VOIDmode if not known. */ +#define CONST_POOL_OK_P(MODE, X) \ + ((MODE) != VOIDmode \ + && CONSTANT_P (X) \ && GET_CODE (X) != HIGH \ - && !targetm.cannot_force_const_mem (X)) + && !targetm.cannot_force_const_mem (MODE, X)) /* True if C is a non-empty register class that has too few registers to be safely used as a reload target class. */ @@ -3246,7 +3248,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, && REGNO (operand) >= FIRST_PSEUDO_REGISTER && reg_renumber[REGNO (operand)] < 0)) win = 1; - if (CONST_POOL_OK_P (operand)) + if (CONST_POOL_OK_P (operand_mode[i], operand)) badop = 0; constmemok = 1; break; @@ -3308,7 +3310,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, && offsettable_memref_p (reg_equiv_mem (REGNO (operand)))) || (reg_equiv_address (REGNO (operand)) != 0)))) win = 1; - if (CONST_POOL_OK_P (operand) + if (CONST_POOL_OK_P (operand_mode[i], operand) || MEM_P (operand)) badop = 0; constmemok = 1; @@ -3424,7 +3426,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, /* If we didn't already win, we can reload constants via force_const_mem, and other MEMs by reloading the address like for 'o'. */ - if (CONST_POOL_OK_P (operand) + if (CONST_POOL_OK_P (operand_mode[i], operand) || MEM_P (operand)) badop = 0; constmemok = 1; @@ -3503,12 +3505,11 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, an early reload pass. Note that the test here is precisely the same as in the code below that calls force_const_mem. */ - if (CONST_POOL_OK_P (operand) + if (CONST_POOL_OK_P (operand_mode[i], operand) && ((targetm.preferred_reload_class (operand, this_alternative[i]) == NO_REGS) - || no_input_reloads) - && operand_mode[i] != VOIDmode) + || no_input_reloads)) { const_to_mem = 1; if (this_alternative[i] != NO_REGS) @@ -3911,11 +3912,10 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, op = XEXP (op, 1); } - if (CONST_POOL_OK_P (op) + if (CONST_POOL_OK_P (mode, op) && ((targetm.preferred_reload_class (op, goal_alternative[i]) == NO_REGS) - || no_input_reloads) - && mode != VOIDmode) + || no_input_reloads)) { int this_address_reloaded; rtx tem = force_const_mem (mode, op); |