]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentati...
authorPaolo Bonzini <bonzini@gnu.org>
Thu, 14 May 2009 13:42:45 +0000 (13:42 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Thu, 14 May 2009 13:42:45 +0000 (13:42 +0000)
2009-05-14  Paolo Bonzini  <bonzini@gnu.org>

* doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this
in the former documentation of...
(GO_IF_LEGITIMATE_ADDRESS): ... this.
* ira-conflicts.c (get_dup_num): Use address_operand.
* targhooks.c (default_legitimate_address_p): New.
* targhooks.h (default_legitimate_address_p): New.
* reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]:
Call hook.
* recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook.
* target.h (struct target): Add legitimate_address_p.
* target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New.
(TARGET_INITIALIZER): Include it.

* config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove.
* config/alpha/alpha.c (alpha_legitimate_address_p): Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
(REG_OK_STRICT_P): Delete.
* config/frv/frv-protos.h (frv_legitimate_address_p): Rename to...
(frv_legitimate_address_p_1): ... this.
* config/frv/frv.c (frv_legitimate_address_p): Forward to...
(frv_legitimate_address_p_1): ... the renamed old
frv_legitimate_address_p.
* config/frv/predicates.md: Adjust calls to frv_legitimate_address_p.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/s390/s390-protos.h (legitimate_address_p): Remove.
* config/s390/s390.c (legitimate_address_p): Rename to...
(s390_legitimate_address_p): ... this, make static.
(legitimize_address): Adjust call.
(TARGET_LEGITIMATE_ADDRESS_P): New.
* config/s390/constraints.md ("e"): Call strict_memory_address_p.

* config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove.
* config/m32c/m32c.c (m32c_legitimate_address_p): Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/spu/spu-protos.h (spu_legitimate_address): Remove.
* config/spu/spu.c (spu_legitimate_address): Rename to...
(spu_legitimate_address_p): ... this, make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/sparc/sparc-protos.h (legitimate_address_p): Remove.
* config/sparc/sparc.c (legitimate_address_p): Rename to...
(sparc_legitimate_address_p): ... this, make static and return bool.
(legitimize_address): Adjust call.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/i386/i386-protos.h (legitimate_address_p): Remove.
* config/i386/i386.c (legitimate_address_p): Rename to...
(ix86_legitimate_address_p): ... this, make static.
(constant_address_p): Move after it, adjust call.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/avr/avr-protos.h (legitimate_address_p): Remove.
* config/avr/avr.c (legitimate_address_p): Rename to...
(avr_legitimate_address_p): ... this, make static.
(legitimize_address): Adjust call.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/crx/crx-protos.h (crx_legitimate_address_p): Remove.
* config/crx/crx.c (crx_legitimate_address_p): Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove.
* config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p):
Remove.
* config/stormy16/stormy16.c (xstormy16_legitimate_address_p):
Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address):
Remove.
* config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address):
Rename to...
(m68hc11_legitimate_address_p): ... this, make static.
(go_if_legitimate_address_internal): Rename to...
(m68hc11_legitimate_address_p_1): ... this.
(legitimize_address): Adjust call.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p):
Remove.
* config/iq2000/iq2000.c (iq2000_legitimate_address_p):
Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/mn10300/mn10300-protos.h (legitimate_address_p): Remove.
* config/mn10300/mn10300.c (legitimate_address_p): Rename to...
(mn10300_legitimate_address_p): ... this, make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove.
* config/m68k/m68k.c (m68k_legitimate_address_p): Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
(REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete.
(INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above.
* config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove.
* config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to...
(rs6000_legitimate_address_p): ... this, make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.
(REG_MODE_OK_FOR_BASE_P): Delete.
(rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P.

* config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/picochip/picochip-protos.h (picochip_legitimate_address_p):
Delete.
* config/picochip/picochip.c (picochip_legitimate_address_p): Make
static, adjust types.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/score/score.c (score_address_p): Rename to...
(score_legitimate_address_p): ... this.
(TARGET_LEGITIMATE_ADDRESS_P): New.
* config/score/score3.c (score3_address_p): Rename to...
(score3_legitimate_address_p): ... this.
* config/score/score7.c (score7_address_p): Rename to...
(score7_legitimate_address_p): ... this.

* config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS,
THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS,
GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/arm/arm-protos.h (thumb1_legitimate_address_p,
thumb2_legitimate_address_p): Delete.
(arm_legitimate_address_p): Rename to...
(arm_legitimate_address_outer_p): ... this.
* config/arm/constraints.md ("Uq"): Adjust call.
* config/arm/predicates.md (arm_extendqisi_mem_op): Likewise.
* config/arm/arm.c (arm_legitimate_address_p): New, rename old one to...
(arm_legitimate_address_outer_p): ... this.
(thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/mips/mips-protos.h (mips_legitimate_address_p): Remove.
* config/mips/mips.c (mips_legitimate_address_p): ... Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/vax/vax-protos.h (legitimate_address_p): Remove.
* config/vax/vax.c (legitimate_address_p): Rename to...
(vax_legitimate_address_p): ... this, make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove.
* config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/mmix/mmix-protos.h (mmix_legitimize_address): Remove.
* config/mmix/mmix.c (mmix_legitimate_address): Rename to...
(mmix_legitimate_address_p): ... this, make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

* config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
* config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove.
* config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static.
(TARGET_LEGITIMATE_ADDRESS_P): New.

From-SVN: r147534

88 files changed:
gcc/ChangeLog
gcc/config/alpha/alpha-protos.h
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/constraints.md
gcc/config/arm/predicates.md
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.c
gcc/config/avr/avr.h
gcc/config/bfin/bfin-protos.h
gcc/config/bfin/bfin.c
gcc/config/bfin/bfin.h
gcc/config/crx/crx-protos.h
gcc/config/crx/crx.c
gcc/config/crx/crx.h
gcc/config/frv/frv-protos.h
gcc/config/frv/frv.c
gcc/config/frv/frv.h
gcc/config/frv/predicates.md
gcc/config/h8300/h8300-protos.h
gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/iq2000/iq2000-protos.h
gcc/config/iq2000/iq2000.c
gcc/config/iq2000/iq2000.h
gcc/config/m32c/m32c-protos.h
gcc/config/m32c/m32c.c
gcc/config/m32c/m32c.h
gcc/config/m68hc11/m68hc11-protos.h
gcc/config/m68hc11/m68hc11.c
gcc/config/m68hc11/m68hc11.h
gcc/config/m68k/m68k-protos.h
gcc/config/m68k/m68k.c
gcc/config/m68k/m68k.h
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mmix/mmix-protos.h
gcc/config/mmix/mmix.c
gcc/config/mmix/mmix.h
gcc/config/mn10300/mn10300-protos.h
gcc/config/mn10300/mn10300.c
gcc/config/mn10300/mn10300.h
gcc/config/picochip/picochip-protos.h
gcc/config/picochip/picochip.c
gcc/config/picochip/picochip.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/s390/constraints.md
gcc/config/s390/s390-protos.h
gcc/config/s390/s390.c
gcc/config/s390/s390.h
gcc/config/score/score.c
gcc/config/score/score.h
gcc/config/score/score3.c
gcc/config/score/score3.h
gcc/config/score/score7.c
gcc/config/score/score7.h
gcc/config/sparc/sparc-protos.h
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h
gcc/config/spu/spu-protos.h
gcc/config/spu/spu.c
gcc/config/spu/spu.h
gcc/config/stormy16/stormy16-protos.h
gcc/config/stormy16/stormy16.c
gcc/config/stormy16/stormy16.h
gcc/config/vax/vax-protos.h
gcc/config/vax/vax.c
gcc/config/vax/vax.h
gcc/config/xtensa/xtensa-protos.h
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h
gcc/doc/tm.texi
gcc/ira-conflicts.c
gcc/recog.c
gcc/reload.c
gcc/target-def.h
gcc/target.h
gcc/targhooks.c
gcc/targhooks.h

index 74a737623dfc78d2a4907f751f628e5f430f9f41..36e48a223ccc46cdcd445c7b633bd1b04b4e2fd7 100644 (file)
@@ -1,3 +1,187 @@
+2009-05-14  Paolo Bonzini  <bonzini@gnu.org>
+
+       * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this
+       in the former documentation of...
+       (GO_IF_LEGITIMATE_ADDRESS): ... this.
+       * ira-conflicts.c (get_dup_num): Use address_operand.
+       * targhooks.c (default_legitimate_address_p): New.
+       * targhooks.h (default_legitimate_address_p): New.
+       * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]:
+       Call hook.
+       * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook.
+       * target.h (struct target): Add legitimate_address_p.
+       * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New.
+       (TARGET_INITIALIZER): Include it.
+
+       * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove.
+       * config/alpha/alpha.c (alpha_legitimate_address_p): Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       (REG_OK_STRICT_P): Delete.
+       * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to...
+       (frv_legitimate_address_p_1): ... this.
+       * config/frv/frv.c (frv_legitimate_address_p): Forward to...
+       (frv_legitimate_address_p_1): ... the renamed old
+       frv_legitimate_address_p.
+       * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/s390/s390-protos.h (legitimate_address_p): Remove.
+       * config/s390/s390.c (legitimate_address_p): Rename to...
+       (s390_legitimate_address_p): ... this, make static.
+       (legitimize_address): Adjust call.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+       * config/s390/constraints.md ("e"): Call strict_memory_address_p.
+
+       * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove.
+       * config/m32c/m32c.c (m32c_legitimate_address_p): Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/spu/spu-protos.h (spu_legitimate_address): Remove.
+       * config/spu/spu.c (spu_legitimate_address): Rename to...
+       (spu_legitimate_address_p): ... this, make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/sparc/sparc-protos.h (legitimate_address_p): Remove.
+       * config/sparc/sparc.c (legitimate_address_p): Rename to...
+       (sparc_legitimate_address_p): ... this, make static and return bool.
+       (legitimize_address): Adjust call.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/i386/i386-protos.h (legitimate_address_p): Remove.
+       * config/i386/i386.c (legitimate_address_p): Rename to...
+       (ix86_legitimate_address_p): ... this, make static.
+       (constant_address_p): Move after it, adjust call.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/avr/avr-protos.h (legitimate_address_p): Remove.
+       * config/avr/avr.c (legitimate_address_p): Rename to...
+       (avr_legitimate_address_p): ... this, make static.
+       (legitimize_address): Adjust call.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/crx/crx-protos.h (crx_legitimate_address_p): Remove.
+       * config/crx/crx.c (crx_legitimate_address_p): Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove.
+       * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p):
+       Remove.
+       * config/stormy16/stormy16.c (xstormy16_legitimate_address_p):
+       Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address):
+       Remove.
+       * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address):
+       Rename to...
+       (m68hc11_legitimate_address_p): ... this, make static.
+       (go_if_legitimate_address_internal): Rename to...
+       (m68hc11_legitimate_address_p_1): ... this.
+       (legitimize_address): Adjust call.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p):
+       Remove.
+       * config/iq2000/iq2000.c (iq2000_legitimate_address_p):
+       Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove.
+       * config/mn10300/mn10300.c (legitimate_address_p): Rename to...
+       (mn10300_legitimate_address_p): ... this, make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove.
+       * config/m68k/m68k.c (m68k_legitimate_address_p): Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete.
+       (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above.
+       * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove.
+       * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to...
+       (rs6000_legitimate_address_p): ... this, make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+       (REG_MODE_OK_FOR_BASE_P): Delete.
+       (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P.
+
+       * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/picochip/picochip-protos.h (picochip_legitimate_address_p):
+       Delete.
+       * config/picochip/picochip.c (picochip_legitimate_address_p): Make
+       static, adjust types.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/score/score.c (score_address_p): Rename to...
+       (score_legitimate_address_p): ... this.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+       * config/score/score3.c (score3_address_p): Rename to...
+       (score3_legitimate_address_p): ... this.
+       * config/score/score7.c (score7_address_p): Rename to...
+       (score7_legitimate_address_p): ... this.
+
+       * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS,
+       THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS,
+       GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/arm/arm-protos.h (thumb1_legitimate_address_p,
+       thumb2_legitimate_address_p): Delete.
+       (arm_legitimate_address_p): Rename to...
+       (arm_legitimate_address_outer_p): ... this.
+       * config/arm/constraints.md ("Uq"): Adjust call.
+       * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise.
+       * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to...
+       (arm_legitimate_address_outer_p): ... this.
+       (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/mips/mips-protos.h (mips_legitimate_address_p): Remove.
+       * config/mips/mips.c (mips_legitimate_address_p): ... Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/vax/vax-protos.h (legitimate_address_p): Remove.
+       * config/vax/vax.c (legitimate_address_p): Rename to...
+       (vax_legitimate_address_p): ... this, make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove.
+       * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove.
+       * config/mmix/mmix.c (mmix_legitimate_address): Rename to...
+       (mmix_legitimate_address_p): ... this, make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
+       * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete.
+       * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove.
+       * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static.
+       (TARGET_LEGITIMATE_ADDRESS_P): New.
+
 2009-05-14  Paolo Bonzini  <bonzini@gnu.org>
 
        * config/arm/arm.h (PROMOTE_FUNCTION_MODE): Remove handling
index 7a12d498246875767ad8f0af7f04e7973eab1356..80c1e4f8f63181ffb409572fb8118958c1fe129e 100644 (file)
@@ -38,7 +38,6 @@ extern rtx alpha_tablejump_addr_vec (rtx);
 extern rtx alpha_tablejump_best_label (rtx);
 
 extern bool alpha_legitimate_constant_p (rtx);
-extern bool alpha_legitimate_address_p (enum machine_mode, rtx, int);
 extern rtx alpha_legitimize_reload_address (rtx, enum machine_mode,
                                            int, int, int);
 
index a9b12a8c36c76f518af463c92e478c5ba5127f90..368ef507995d91f3885414c3066960dc424be3ec 100644 (file)
@@ -801,8 +801,8 @@ alpha_linkage_symbol_p (const char *symname)
    any of those forms can be surrounded with an AND that clear the
    low-order three bits; this is an "unaligned" access.  */
 
-bool
-alpha_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
+static bool
+alpha_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   /* If this is an ldq_u type address, discard the outer AND.  */
   if (mode == DImode
@@ -10839,6 +10839,9 @@ alpha_init_libfuncs (void)
 #define TARGET_MANGLE_TYPE alpha_mangle_type
 #endif
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P alpha_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 \f
index ed9bd747f390b671df5ea823d898182f64e5fbaf..3bfbd50e89e42d2661f0b2ec63524e91382c5941 100644 (file)
@@ -974,23 +974,6 @@ do {                                               \
 #define REG_OK_FOR_BASE_P(X)   NONSTRICT_REG_OK_FOR_BASE_P (X)
 #endif
 \f
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a
-   valid memory address for an instruction.  */
-
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \
-do {                                           \
-  if (alpha_legitimate_address_p (MODE, X, 1)) \
-    goto WIN;                                  \
-} while (0)
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \
-do {                                           \
-  if (alpha_legitimate_address_p (MODE, X, 0)) \
-    goto WIN;                                  \
-} while (0)
-#endif
-
 /* Try a machine-dependent way of reloading an illegitimate address
    operand.  If we find one, push the reload and jump to WIN.  This
    macro is used in only one place: `find_reloads_address' in reload.c.  */
index 34d266b139be339959306e3203c971b7300a867b..3b7ba794fa452c1a4b30656cf365923021fe1cbf 100644 (file)
@@ -54,9 +54,7 @@ extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, enum machine_mode,
 extern int legitimate_pic_operand_p (rtx);
 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
 extern rtx legitimize_tls_address (rtx, rtx);
-extern int arm_legitimate_address_p  (enum machine_mode, rtx, RTX_CODE, int);
-extern int thumb1_legitimate_address_p (enum machine_mode, rtx, int);
-extern int thumb2_legitimate_address_p  (enum machine_mode, rtx, int);
+extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
 extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
 extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int,
                                            int);
index 18e009d136878da376428d3a1b2f88b7d12a6886..464bba577206708e2041b7d17cd625b36838f6ff 100644 (file)
@@ -76,6 +76,7 @@ static int thumb1_base_register_rtx_p (rtx, enum machine_mode, int);
 static rtx arm_legitimize_address (rtx, rtx, enum machine_mode);
 static rtx thumb_legitimize_address (rtx, rtx, enum machine_mode);
 inline static int thumb1_index_register_rtx_p (rtx, int);
+static bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
 static int thumb_far_jump_used_p (void);
 static bool thumb_force_lr_save (void);
 static int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
@@ -403,6 +404,9 @@ static bool arm_allocate_stack_slots_for_args (void);
 #define TARGET_ASM_OUTPUT_DWARF_DTPREL arm_output_dwarf_dtprel
 #endif
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    arm_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Obstack for minipool constant handling.  */
@@ -3914,8 +3918,8 @@ pcrel_constant_p (rtx x)
 
 /* Return nonzero if X is a valid ARM state address operand.  */
 int
-arm_legitimate_address_p (enum machine_mode mode, rtx x, RTX_CODE outer,
-                         int strict_p)
+arm_legitimate_address_outer_p (enum machine_mode mode, rtx x, RTX_CODE outer,
+                               int strict_p)
 {
   bool use_ldrd;
   enum rtx_code code = GET_CODE (x);
@@ -3999,7 +4003,7 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, RTX_CODE outer,
 }
 
 /* Return nonzero if X is a valid Thumb-2 address operand.  */
-int
+static int
 thumb2_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p)
 {
   bool use_ldrd;
@@ -4305,7 +4309,7 @@ thumb1_index_register_rtx_p (rtx x, int strict_p)
    addresses based on the frame pointer or arg pointer until the
    reload pass starts.  This is so that eliminating such addresses
    into stack based ones won't produce impossible code.  */
-int
+static int
 thumb1_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p)
 {
   /* ??? Not clear if this is right.  Experiment.  */
@@ -4419,6 +4423,17 @@ thumb_legitimate_offset_p (enum machine_mode mode, HOST_WIDE_INT val)
     }
 }
 
+bool
+arm_legitimate_address_p (enum machine_mode mode, rtx x, bool strict_p)
+{
+  if (TARGET_ARM)
+    return arm_legitimate_address_outer_p (mode, x, SET, strict_p);
+  else if (TARGET_THUMB2)
+    return thumb2_legitimate_address_p (mode, x, strict_p);
+  else /* if (TARGET_THUMB1) */
+    return thumb1_legitimate_address_p (mode, x, strict_p);
+}
+
 /* Build the SYMBOL_REF for __tls_get_addr.  */
 
 static GTY(()) rtx tls_get_addr_libfunc;
@@ -4654,7 +4669,7 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
     }
 
   /* XXX We don't allow MINUS any more -- see comment in
-     arm_legitimate_address_p ().  */
+     arm_legitimate_address_outer_p ().  */
   else if (GET_CODE (x) == MINUS)
     {
       rtx xop0 = XEXP (x, 0);
index 56d1a3349120a4584d6e99770ca26a6b3f932935..ee0eee694d244f813a72d193d2b8019913ed77e0 100644 (file)
@@ -2161,43 +2161,11 @@ typedef struct
 #define REG_MODE_OK_FOR_REG_BASE_P(X, MODE)    \
   REG_OK_FOR_INDEX_P (X)
 \f
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
-   that is a valid memory address for an instruction.
-   The MODE argument is the machine mode for the MEM expression
-   that wants to use this address.  */
-
 #define ARM_BASE_REGISTER_RTX_P(X)  \
   (GET_CODE (X) == REG && ARM_REG_OK_FOR_BASE_P (X))
 
 #define ARM_INDEX_REGISTER_RTX_P(X)  \
   (GET_CODE (X) == REG && ARM_REG_OK_FOR_INDEX_P (X))
-
-#define ARM_GO_IF_LEGITIMATE_ADDRESS(MODE,X,WIN)               \
-  {                                                            \
-    if (arm_legitimate_address_p (MODE, X, SET, REG_STRICT_P)) \
-      goto WIN;                                                        \
-  }
-
-#define THUMB2_GO_IF_LEGITIMATE_ADDRESS(MODE,X,WIN)            \
-  {                                                            \
-    if (thumb2_legitimate_address_p (MODE, X, REG_STRICT_P))   \
-      goto WIN;                                                        \
-  }
-
-#define THUMB1_GO_IF_LEGITIMATE_ADDRESS(MODE,X,WIN)            \
-  {                                                            \
-    if (thumb1_legitimate_address_p (MODE, X, REG_STRICT_P))   \
-      goto WIN;                                                        \
-  }
-
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN)                         \
-  if (TARGET_ARM)                                                      \
-    ARM_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN)                        \
-  else if (TARGET_THUMB2)                                              \
-    THUMB2_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN)                     \
-  else /* if (TARGET_THUMB1) */                                                \
-    THUMB1_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN)
-
 \f
 /* Define this for compatibility reasons. */
 #define HANDLE_PRAGMA_PACK_PUSH_POP
index 0c8fa733f75e9ae26a852e2038eb33a9d038c4a1..b5ade5ce1f323d7069a882cb9b5d9b69e696c0ec 100644 (file)
   In ARM state an address valid in ldrsb instructions."
  (and (match_code "mem")
       (match_test "TARGET_ARM
-                  && arm_legitimate_address_p (GET_MODE (op), XEXP (op, 0),
-                                               SIGN_EXTEND, 0)")))
+                  && arm_legitimate_address_outer_p (GET_MODE (op), XEXP (op, 0),
+                                                     SIGN_EXTEND, 0)")))
 
 (define_memory_constraint "Q"
  "@internal
index b45faf43cbceb64a1e9e7a74ce96c74b17fe9886..7997cc94cf5ec311ef7560f531ca3e7be42f945a 100644 (file)
 
 (define_special_predicate "arm_extendqisi_mem_op"
   (and (match_operand 0 "memory_operand")
-       (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
-                                             0)")))
+       (match_test "arm_legitimate_address_outer_p (mode, XEXP (op, 0),
+                                                   SIGN_EXTEND, 0)")))
 
 (define_special_predicate "arm_reg_or_extendqisi_mem_op"
   (ior (match_operand 0 "arm_extendqisi_mem_op")
index f4d2119a9983b9ef1c55ebdd751c594063dcdec0..03b84c00049865b0de0e2220a3c906da2cc69f2d 100644 (file)
@@ -61,7 +61,6 @@ extern void function_arg_advance (CUMULATIVE_ARGS *cum,
 
 #ifdef RTX_CODE
 extern void asm_output_external_libcall (FILE *file, rtx symref);
-extern int legitimate_address_p (enum machine_mode mode, rtx x,        int strict);
 extern int compare_diff_p (rtx insn);
 extern const char *output_movqi (rtx insn, rtx operands[], int *l);
 extern const char *output_movhi (rtx insn, rtx operands[], int *l);
index 4811b92637f1db2fc34e0120054375e60e7a843c..ed668b674951c05b472b21d6086273ba579f31dc 100644 (file)
@@ -71,6 +71,7 @@ const struct attribute_spec avr_attribute_table[];
 static bool avr_assemble_integer (rtx, unsigned int, int);
 static void avr_file_start (void);
 static void avr_file_end (void);
+static bool avr_legitimate_address_p (enum machine_mode, rtx, bool);
 static void avr_asm_function_end_prologue (FILE *);
 static void avr_asm_function_begin_epilogue (FILE *);
 static rtx avr_function_value (const_tree, const_tree, bool);
@@ -367,6 +368,9 @@ static const struct mcu_type_s avr_mcu_types[] = {
 #undef TARGET_CASE_VALUES_THRESHOLD
 #define TARGET_CASE_VALUES_THRESHOLD avr_case_values_threshold
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P avr_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 void
@@ -1099,8 +1103,8 @@ avr_asm_function_begin_epilogue (FILE *file)
 /* Return nonzero if X (an RTX) is a legitimate memory address on the target
    machine for a memory operand of mode MODE.  */
 
-int
-legitimate_address_p (enum machine_mode mode, rtx x, int strict)
+bool
+avr_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   enum reg_class r = NO_REGS;
   
index 79d81b94923b03daaa5fd920fdd9ff24c3ae6731..d431790a647fb150b7f86cda788c6bb2bda0500d 100644 (file)
@@ -408,20 +408,6 @@ extern int avr_reg_order[];
 
 #define MAX_REGS_PER_ADDRESS 1
 
-#ifdef REG_OK_STRICT
-#  define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR)        \
-{                                                      \
-  if (legitimate_address_p (mode, operand, 1))         \
-    goto ADDR;                                         \
-}
-#  else
-#  define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR)        \
-{                                                      \
-  if (legitimate_address_p (mode, operand, 0))         \
-    goto ADDR;                                         \
-}
-#endif
-
 #define REG_OK_FOR_BASE_NOSTRICT_P(X) \
   (REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))
 
index 33de846da95e7ba2378e00e96dd0d222eddfdc24..13542411221cea0b5898e2aa080cf252419694a5 100644 (file)
@@ -146,7 +146,6 @@ extern rtx bfin_gen_compare (rtx, Mmode);
 
 extern int bfin_local_alignment (tree, int);
 extern void initialize_trampoline (rtx, rtx, rtx);
-extern bool bfin_legitimate_address_p (Mmode, rtx, int);
 extern rtx bfin_va_arg (tree, tree);
 
 extern void bfin_expand_prologue (void);
index ac237d73bd2e5710528234387d9ede0b0614f054..f4a8c4dc3d45607a73ee2cb5c7a54cd0d1a3a6e5 100644 (file)
@@ -2895,8 +2895,26 @@ bfin_valid_reg_p (unsigned int regno, int strict, enum machine_mode mode,
     return REGNO_OK_FOR_BASE_NONSTRICT_P (regno, mode, outer_code, SCRATCH);
 }
 
-bool
-bfin_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
+/* Recognize an RTL expression that is a valid memory address for an
+   instruction.  The MODE argument is the machine mode for the MEM expression
+   that wants to use this address. 
+
+   Blackfin addressing modes are as follows:
+
+      [preg]
+      [preg + imm16]
+
+      B [ Preg + uimm15 ]
+      W [ Preg + uimm16m2 ]
+      [ Preg + uimm17m4 ] 
+
+      [preg++]
+      [preg--]
+      [--sp]
+*/
+
+static bool
+bfin_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   switch (GET_CODE (x)) {
   case REG:
@@ -6318,4 +6336,7 @@ bfin_expand_builtin (tree exp, rtx target ATTRIBUTE_UNUSED,
 #undef TARGET_RETURN_IN_MEMORY
 #define TARGET_RETURN_IN_MEMORY bfin_return_in_memory
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    bfin_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
index 352f4b4c208820848fd01d1d0954d039f0fa5cbf..7cd6756309bd225c777441be3af7601fc2fc9c61 100644 (file)
@@ -912,42 +912,9 @@ typedef struct {
      would ever accept. */
 #define MAX_REGS_PER_ADDRESS 1
 
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
-   that is a valid memory address for an instruction.
-   The MODE argument is the machine mode for the MEM expression
-   that wants to use this address. 
-
-   Blackfin addressing modes are as follows:
-
-      [preg]
-      [preg + imm16]
-
-      B [ Preg + uimm15 ]
-      W [ Preg + uimm16m2 ]
-      [ Preg + uimm17m4 ] 
-
-      [preg++]
-      [preg--]
-      [--sp]
-*/
-
 #define LEGITIMATE_MODE_FOR_AUTOINC_P(MODE) \
       (GET_MODE_SIZE (MODE) <= 4 || (MODE) == PDImode)
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN)         \
-  do {                                                 \
-    if (bfin_legitimate_address_p (MODE, X, 1))                \
-      goto WIN;                                                \
-  } while (0);
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN)         \
-  do {                                                 \
-    if (bfin_legitimate_address_p (MODE, X, 0))                \
-      goto WIN;                                                \
-  } while (0);
-#endif
-
 #define HAVE_POST_INCREMENT 1
 #define HAVE_POST_DECREMENT 1
 #define HAVE_PRE_DECREMENT  1
index 386fab9fe4374eda7c2919029cbc73b2d9963b36..b35051d99f5dfb047183203f04e0f8fc888f5e8e 100644 (file)
@@ -53,7 +53,6 @@ enum crx_addrtype
 };
 
 extern enum crx_addrtype crx_decompose_address (rtx addr, struct crx_address *out);
-extern int crx_legitimate_address_p (enum machine_mode, rtx, int);
 
 extern int crx_const_double_ok (rtx op);
 
index cc3248fb5eee1ccb3c5fd26e29bf7e58ad9a91cb..c45189eb0d36ad2ef03bc1eacc74d239b24edcb2 100644 (file)
@@ -133,6 +133,14 @@ static rtx crx_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
                                 int incoming ATTRIBUTE_UNUSED);
 static bool crx_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED);
 static int crx_address_cost (rtx, bool);
+static bool crx_legitimate_address_p (enum machine_mode, rtx, bool);
+
+/*****************************************************************************/
+/* RTL VALIDITY                                                                     */
+/*****************************************************************************/
+
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    crx_legitimate_address_p
 
 /*****************************************************************************/
 /* STACK LAYOUT AND CALLING CONVENTIONS                                             */
@@ -722,9 +730,9 @@ crx_decompose_address (rtx addr, struct crx_address *out)
   return retval;
 }
 
-int
+bool
 crx_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
-                         rtx addr, int strict)
+                         rtx addr, bool strict)
 {
   enum crx_addrtype addrtype;
   struct crx_address address;
index cac465701bfc2972beaf56740aac8e6d293c56a9..d22db7da9038818d042875f66eb14ac46df2c8ba 100644 (file)
@@ -404,20 +404,6 @@ struct cumulative_args
 #define REG_OK_FOR_INDEX_P(X)  1
 #endif /* REG_OK_STRICT */
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                       \
-{                                                                      \
-  if (crx_legitimate_address_p (MODE, X, 1))                           \
-      goto LABEL;                                                      \
-}
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                       \
-{                                                                      \
-  if (crx_legitimate_address_p (MODE, X, 0))                           \
-      goto LABEL;                                                      \
-}
-#endif /* REG_OK_STRICT */
-
 #define LEGITIMATE_CONSTANT_P(X)  1
 
 /*****************************************************************************/
index 98ada2286a52242a0631b39226610e7ae6f46827..56f424396402799d263e7df5621815d7cb13d5eb 100644 (file)
@@ -47,7 +47,7 @@ extern int frv_frame_pointer_required         (void);
 extern int frv_initial_elimination_offset      (int, int);
 
 #ifdef RTX_CODE
-extern int frv_legitimate_address_p            (enum machine_mode, rtx,
+extern int frv_legitimate_address_p_1          (enum machine_mode, rtx,
                                                 int, int, int);
 extern rtx frv_find_base_term                  (rtx);
 
index e5476523f13a831001664a3f65427e5d2939bd2a..1db3496b5be70396d5f832c0d8c56166f05c9b63 100644 (file)
@@ -264,6 +264,7 @@ frv_cpu_t frv_cpu_type = CPU_TYPE;  /* value of -mcpu= */
 /* Forward references */
 
 static bool frv_handle_option                  (size_t, const char *, int);
+static bool frv_legitimate_address_p           (enum machine_mode, rtx, bool);
 static int frv_default_flags_for_cpu           (void);
 static int frv_string_begins_with              (const_tree, const char *);
 static FRV_INLINE bool frv_small_data_reloc_p  (rtx, int);
@@ -467,6 +468,9 @@ static bool frv_secondary_reload                (bool, rtx, enum reg_class,
 #undef  TARGET_SECONDARY_RELOAD
 #define TARGET_SECONDARY_RELOAD frv_secondary_reload
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P frv_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #define FRV_SYMBOL_REF_TLS_P(RTX) \
@@ -2532,7 +2536,7 @@ frv_return_addr_rtx (int count, rtx frame)
    MEMREF has already happened.
 
    MEMREF must be a legitimate operand for modes larger than SImode.
-   GO_IF_LEGITIMATE_ADDRESS forbids register+register addresses, which
+   frv_legitimate_address_p forbids register+register addresses, which
    this function cannot handle.  */
 rtx
 frv_index_memory (rtx memref, enum machine_mode mode, int index)
@@ -3358,11 +3362,11 @@ frv_regno_ok_for_base_p (int regno, int strict_p)
    `PRINT_OPERAND_ADDRESS'.  */
 
 int
-frv_legitimate_address_p (enum machine_mode mode,
-                          rtx x,
-                          int strict_p,
-                          int condexec_p,
-                         int allow_double_reg_p)
+frv_legitimate_address_p_1 (enum machine_mode mode,
+                            rtx x,
+                            int strict_p,
+                            int condexec_p,
+                           int allow_double_reg_p)
 {
   rtx x0, x1;
   int ret = 0;
@@ -3489,6 +3493,12 @@ frv_legitimate_address_p (enum machine_mode mode,
   return ret;
 }
 
+bool
+frv_legitimate_address_p (enum machine_mode mode, rtx x, bool strict_p)
+{
+  return frv_legitimate_address_p_1 (mode, x, strict_p, FALSE, FALSE);
+}
+
 /* Given an ADDR, generate code to inline the PLT.  */
 static rtx
 gen_inlined_tls_plt (rtx addr)
@@ -3783,8 +3793,8 @@ frv_legitimate_memory_operand (rtx op, enum machine_mode mode, int condexec_p)
 {
   return ((GET_MODE (op) == mode || mode == VOIDmode)
          && GET_CODE (op) == MEM
-         && frv_legitimate_address_p (mode, XEXP (op, 0),
-                                      reload_completed, condexec_p, FALSE));
+         && frv_legitimate_address_p_1 (mode, XEXP (op, 0),
+                                        reload_completed, condexec_p, FALSE));
 }
 
 void
@@ -3944,7 +3954,7 @@ condexec_memory_operand (rtx op, enum machine_mode mode)
     return FALSE;
 
   addr = XEXP (op, 0);
-  return frv_legitimate_address_p (mode, addr, reload_completed, TRUE, FALSE);
+  return frv_legitimate_address_p_1 (mode, addr, reload_completed, TRUE, FALSE);
 }
 \f
 /* Return true if the bare return instruction can be used outside of the
@@ -5846,7 +5856,7 @@ frv_ifcvt_rewrite_mem (rtx mem, enum machine_mode mode, rtx insn)
 {
   rtx addr = XEXP (mem, 0);
 
-  if (!frv_legitimate_address_p (mode, addr, reload_completed, TRUE, FALSE))
+  if (!frv_legitimate_address_p_1 (mode, addr, reload_completed, TRUE, FALSE))
     {
       if (GET_CODE (addr) == PLUS)
        {
index e510de08901169d4e72e656a4a886a1b873d863d..e605bb21a8e8a7e70b04e07633c6946126b8fc04 100644 (file)
@@ -2025,77 +2025,6 @@ __asm__("\n"                                                             \
    number that `GO_IF_LEGITIMATE_ADDRESS' would ever accept.  */
 #define MAX_REGS_PER_ADDRESS 2
 
-/* A C compound statement with a conditional `goto LABEL;' executed if X (an
-   RTX) is a legitimate memory address on the target machine for a memory
-   operand of mode MODE.
-
-   It usually pays to define several simpler macros to serve as subroutines for
-   this one.  Otherwise it may be too complicated to understand.
-
-   This macro must exist in two variants: a strict variant and a non-strict
-   one.  The strict variant is used in the reload pass.  It must be defined so
-   that any pseudo-register that has not been allocated a hard register is
-   considered a memory reference.  In contexts where some kind of register is
-   required, a pseudo-register with no hard register must be rejected.
-
-   The non-strict variant is used in other passes.  It must be defined to
-   accept all pseudo-registers in every context where some kind of register is
-   required.
-
-   Compiler source files that want to use the strict variant of this macro
-   define the macro `REG_OK_STRICT'.  You should use an `#ifdef REG_OK_STRICT'
-   conditional to define the strict variant in that case and the non-strict
-   variant otherwise.
-
-   Subroutines to check for acceptable registers for various purposes (one for
-   base registers, one for index registers, and so on) are typically among the
-   subroutines used to define `GO_IF_LEGITIMATE_ADDRESS'.  Then only these
-   subroutine macros need have two variants; the higher levels of macros may be
-   the same whether strict or not.
-
-   Normally, constant addresses which are the sum of a `symbol_ref' and an
-   integer are stored inside a `const' RTX to mark them as constant.
-   Therefore, there is no need to recognize such sums specifically as
-   legitimate addresses.  Normally you would simply recognize any `const' as
-   legitimate.
-
-   Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant sums that
-   are not marked with `const'.  It assumes that a naked `plus' indicates
-   indexing.  If so, then you *must* reject such naked constant sums as
-   illegitimate addresses, so that none of them will be given to
-   `PRINT_OPERAND_ADDRESS'.
-
-   On some machines, whether a symbolic address is legitimate depends on the
-   section that the address refers to.  On these machines, define the macro
-   `ENCODE_SECTION_INFO' to store the information into the `symbol_ref', and
-   then check for it here.  When you see a `const', you will have to look
-   inside it to find the `symbol_ref' in order to determine the section.
-
-   The best way to modify the name string is by adding text to the beginning,
-   with suitable punctuation to prevent any ambiguity.  Allocate the new name
-   in `saveable_obstack'.  You will have to modify `ASM_OUTPUT_LABELREF' to
-   remove and decode the added text and output the name accordingly, and define
-   `(* targetm.strip_name_encoding)' to access the original name string.
-
-   You can check the information stored here into the `symbol_ref' in the
-   definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
-   `PRINT_OPERAND_ADDRESS'.  */
-
-#ifdef REG_OK_STRICT
-#define REG_OK_STRICT_P 1
-#else
-#define REG_OK_STRICT_P 0
-#endif
-
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                       \
-  do                                                                   \
-    {                                                                  \
-      if (frv_legitimate_address_p (MODE, X, REG_OK_STRICT_P,          \
-                                   FALSE, FALSE))                      \
-       goto LABEL;                                                     \
-    }                                                                  \
-  while (0)
-
 /* A C expression that is nonzero if X (assumed to be a `reg' RTX) is valid for
    use as a base register.  For hard registers, it should always accept those
    which the hardware permits and reject the others.  Whether the macro accepts
index 5f7ef4edac99a382663050deb4a18164ce8a1c7b..4ecfa9aed45947bc21bfb944c4e55d669d51a846 100644 (file)
       subreg = SUBREG_REG (op);
       code = GET_CODE (subreg);
       if (code == MEM)
-       return frv_legitimate_address_p (mode, XEXP (subreg, 0),
-                                        reload_completed, FALSE, FALSE);
+       return frv_legitimate_address_p_1 (mode, XEXP (subreg, 0),
+                                          reload_completed, FALSE, FALSE);
 
       return (code == REG);
 
       subreg = SUBREG_REG (op);
       code = GET_CODE (subreg);
       if (code == MEM)
-       return frv_legitimate_address_p (mode, XEXP (subreg, 0),
-                                        reload_completed, FALSE, FALSE);
+       return frv_legitimate_address_p_1 (mode, XEXP (subreg, 0),
+                                          reload_completed, FALSE, FALSE);
 
       return (code == REG);
 
       subreg = SUBREG_REG (op);
       code = GET_CODE (subreg);
       if (code == MEM)
-       return frv_legitimate_address_p (mode, XEXP (subreg, 0),
-                                        reload_completed, TRUE, FALSE);
+       return frv_legitimate_address_p_1 (mode, XEXP (subreg, 0),
+                                          reload_completed, TRUE, FALSE);
 
       return (code == REG);
 
       subreg = SUBREG_REG (op);
       code = GET_CODE (subreg);
       if (code == MEM)
-       return frv_legitimate_address_p (mode, XEXP (subreg, 0),
-                                        reload_completed, TRUE, FALSE);
+       return frv_legitimate_address_p_1 (mode, XEXP (subreg, 0),
+                                          reload_completed, TRUE, FALSE);
 
       return (code == REG);
 
   if (GET_MODE (op) != mode && GET_MODE (op) != VOIDmode)
     return FALSE;
 
-  return frv_legitimate_address_p (DImode, op, reload_completed, FALSE, TRUE);
+  return frv_legitimate_address_p_1 (DImode, op, reload_completed, FALSE, TRUE);
 })
 
 ;; TODO: Add a comment here.
index 4a0b64790a772d76cf8c75150ca695e53d168754..35023c6236de53a43b5ed3f2e0ec68e475ce3739 100644 (file)
@@ -60,7 +60,6 @@ extern int same_cmp_preceding_p (rtx);
 extern int same_cmp_following_p (rtx);
 
 extern int h8300_legitimate_constant_p (rtx);
-extern int h8300_legitimate_address_p (enum machine_mode, rtx, int);
 
 /* Used in builtins.c */
 extern rtx h8300_return_addr_rtx (int, rtx);
index 9946d28078f9c8649e59cf1e777d58d02911bc86..8630823ca85b092b7118f1e2dee80bb17f7a0bf7 100644 (file)
@@ -5686,8 +5686,8 @@ h8300_rtx_ok_for_base_p (rtx x, int strict)
    legitimate address has the form REG, REG+CONSTANT_ADDRESS or
    CONSTANT_ADDRESS.  */
 
-int
-h8300_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
+static bool
+h8300_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   /* The register indirect addresses like @er0 is always valid.  */
   if (h8300_rtx_ok_for_base_p (x, strict))
@@ -5795,6 +5795,9 @@ h8300_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
 #undef TARGET_HARD_REGNO_SCRATCH_OK
 #define TARGET_HARD_REGNO_SCRATCH_OK h8300_hard_regno_scratch_ok
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    h8300_legitimate_address_p
+
 #undef TARGET_DEFAULT_TARGET_FLAGS
 #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
 
index 7e3711323aa0392b7fbac312abfb4a5542812675..dd95ed7253d8eb57d6843eb6d149b98249fe7b78 100644 (file)
@@ -920,24 +920,6 @@ struct cum_arg
 #define EXTRA_MEMORY_CONSTRAINT(C, STR) \
   ((C) == 'W')
 
-\f
-#ifndef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
-  do                                           \
-    {                                          \
-      if (h8300_legitimate_address_p ((MODE), (X), 0)) \
-       goto ADDR;                              \
-    }                                          \
-  while (0)
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
-  do                                           \
-    {                                          \
-      if (h8300_legitimate_address_p ((MODE), (X), 1)) \
-       goto ADDR;                              \
-    }                                          \
-  while (0)
-#endif
 \f
 /* Go to LABEL if ADDR (a legitimate address expression)
    has an effect that depends on the machine mode it is used for.
index 9452d2a60ec32b240e7d89645242fa62575d52c3..8ae5bd66b2697e7453ee1a2147c1b430cc797082 100644 (file)
@@ -56,7 +56,6 @@ extern bool legitimate_constant_p (rtx);
 extern bool constant_address_p (rtx);
 extern bool legitimate_pic_operand_p (rtx);
 extern int legitimate_pic_address_disp_p (rtx);
-extern int legitimate_address_p (enum machine_mode, rtx, int);
 
 extern void print_reg (rtx, int, FILE*);
 extern void print_operand (FILE*, rtx, int);
index bb013a144f612e30928e6bda344ab58679293c49..593ea84ffa65d507ce0e83c29371bab414d8d2ed 100644 (file)
@@ -9090,13 +9090,6 @@ ix86_cannot_force_const_mem (rtx x)
   return !legitimate_constant_p (x);
 }
 
-/* Determine if a given RTX is a valid constant address.  */
-
-bool
-constant_address_p (rtx x)
-{
-  return CONSTANT_P (x) && legitimate_address_p (Pmode, x, 1);
-}
 
 /* Nonzero if the constant value X is a legitimate general operand
    when generating PIC code.  It is given that flag_pic is on and
@@ -9273,9 +9266,9 @@ legitimate_pic_address_disp_p (rtx disp)
    convert common non-canonical forms to canonical form so that they will
    be recognized.  */
 
-int
-legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
-                     rtx addr, int strict)
+static bool
+ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+                          rtx addr, bool strict)
 {
   struct ix86_address parts;
   rtx base, index, disp;
@@ -9499,6 +9492,14 @@ legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
  report_error:
   return FALSE;
 }
+
+/* Determine if a given RTX is a valid constant address.  */
+
+bool
+constant_address_p (rtx x)
+{
+  return CONSTANT_P (x) && ix86_legitimate_address_p (Pmode, x, 1);
+}
 \f
 /* Return a unique alias set for the GOT.  */
 
@@ -10154,7 +10155,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
            }
        }
 
-      if (changed && legitimate_address_p (mode, x, FALSE))
+      if (changed && ix86_legitimate_address_p (mode, x, FALSE))
        return x;
 
       if (GET_CODE (XEXP (x, 0)) == MULT)
@@ -10180,7 +10181,7 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
          x = legitimize_pic_address (x, 0);
        }
 
-      if (changed && legitimate_address_p (mode, x, FALSE))
+      if (changed && ix86_legitimate_address_p (mode, x, FALSE))
        return x;
 
       if (REG_P (XEXP (x, 0)))
@@ -30267,6 +30268,9 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
 #undef TARGET_EXPAND_TO_RTL_HOOK
 #define TARGET_EXPAND_TO_RTL_HOOK ix86_maybe_switch_abi
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 #include "gt-i386.h"
index 4aafd9c92fe4c5e9a4b4391676b6f89828f4d047..0a9e8a667329ba85a1b61a3ee4b36efa7dd5fb42 100644 (file)
@@ -1823,22 +1823,6 @@ typedef struct ix86_args {
 
 #define LEGITIMATE_CONSTANT_P(X)  legitimate_constant_p (X)
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                                \
-do {                                                                   \
-  if (legitimate_address_p ((MODE), (X), 1))                           \
-    goto ADDR;                                                         \
-} while (0)
-
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                                \
-do {                                                                   \
-  if (legitimate_address_p ((MODE), (X), 0))                           \
-    goto ADDR;                                                         \
-} while (0)
-
-#endif
-
 /* If defined, a C expression to determine the base term of address X.
    This macro is used in only one place: `find_base_term' in alias.c.
 
index a927452d83c9fab456ee4a5b767836a3d947f514..0e4dba77eb4c8e4b3fd15ff76e8007bee4862c87 100644 (file)
@@ -22,7 +22,6 @@
 
 extern int              iq2000_check_split (rtx, enum machine_mode);
 extern int              iq2000_reg_mode_ok_for_base_p (rtx, enum machine_mode, int);
-extern int              iq2000_legitimate_address_p (enum machine_mode, rtx, int);
 extern const char *     iq2000_fill_delay_slot (const char *, enum delay_type, rtx *, rtx);
 extern const char *     iq2000_move_1word (rtx *, rtx, int);
 extern void             override_options (void);
index 28bb7a831fe6e2a97e57c812068ff6cd3b6e8b63..d61ec3f7192fdb2051f847a86a7ab9b60e11e628 100644 (file)
@@ -164,6 +164,7 @@ static bool iq2000_pass_by_reference  (CUMULATIVE_ARGS *, enum machine_mode,
 static int  iq2000_arg_partial_bytes  (CUMULATIVE_ARGS *, enum machine_mode,
                                       tree, bool);
 static void iq2000_va_start          (tree, rtx);
+static bool iq2000_legitimate_address_p (enum machine_mode, rtx, bool);
 
 #undef  TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS           iq2000_init_builtins
@@ -212,6 +213,9 @@ static void iq2000_va_start       (tree, rtx);
 #undef TARGET_EXPAND_BUILTIN_VA_START
 #define        TARGET_EXPAND_BUILTIN_VA_START  iq2000_va_start
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    iq2000_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Return nonzero if we split the address into high and low parts.  */
@@ -249,8 +253,8 @@ iq2000_reg_mode_ok_for_base_p (rtx reg,
    memory operand of the indicated MODE.  STRICT is nonzero if this
    function is called during reload.  */
 
-int
-iq2000_legitimate_address_p (enum machine_mode mode, rtx xinsn, int strict)
+bool
+iq2000_legitimate_address_p (enum machine_mode mode, rtx xinsn, bool strict)
 {
   if (TARGET_DEBUG_A_MODE)
     {
@@ -311,7 +315,7 @@ iq2000_legitimate_address_p (enum machine_mode mode, rtx xinsn, int strict)
     }
 
   if (TARGET_DEBUG_A_MODE)
-    GO_PRINTF ("Not a legitimate address\n");
+    GO_PRINTF ("Not a enum machine_mode mode, legitimate address\n");
 
   /* The address was not legitimate.  */
   return 0;
index 0664f511bd387f1307b4c19aed816e9179fc6fb3..c1506a4a1f127dce760be66325d6dfc9a61cb043 100644 (file)
@@ -528,20 +528,6 @@ typedef struct iq2000_args
 
 #define MAX_REGS_PER_ADDRESS 1
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
-  {                                                    \
-    if (iq2000_legitimate_address_p (MODE, X, 1))      \
-      goto ADDR;                                       \
-  }
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
-  {                                                    \
-    if (iq2000_legitimate_address_p (MODE, X, 0))      \
-      goto ADDR;                                       \
-  }
-#endif
-
 #define REG_OK_FOR_INDEX_P(X) 0
 
 #define LEGITIMATE_CONSTANT_P(X) (1)
index ef857275c9dd13af6a191fa8a4fcec21514e4cac..d332475784fab6e0a76d0baf0d183c45bef1d113 100644 (file)
@@ -74,7 +74,6 @@ bool m32c_illegal_subreg_p (rtx);
 bool m32c_immd_dbl_mov (rtx *, MM);
 rtx  m32c_incoming_return_addr_rtx (void);
 void m32c_initialize_trampoline (rtx, rtx, rtx);
-int  m32c_legitimate_address_p (MM, rtx, int);
 int  m32c_legitimate_constant_p (rtx);
 int  m32c_legitimize_reload_address (rtx *, MM, int, int, int);
 rtx  m32c_libcall_value (MM);
index 17d5dd32ebc07f215e70f9d81f952b7da0ebc961..989f823df92192a2f67d58316358167e1e457b5f 100644 (file)
@@ -68,6 +68,7 @@ static int m32c_comp_type_attributes (const_tree, const_tree);
 static bool m32c_fixed_condition_code_regs (unsigned int *, unsigned int *);
 static struct machine_function *m32c_init_machine_status (void);
 static void m32c_insert_attributes (tree, tree *);
+static bool m32c_legitimate_address_p (enum machine_mode, rtx, bool);
 static bool m32c_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
                                    const_tree, bool);
 static bool m32c_promote_prototypes (const_tree);
@@ -1760,13 +1761,14 @@ m32c_init_libfuncs (void)
 
 /* Addressing Modes */
 
-/* Used by GO_IF_LEGITIMATE_ADDRESS.  The r8c/m32c family supports a
-   wide range of non-orthogonal addressing modes, including the
-   ability to double-indirect on *some* of them.  Not all insns
-   support all modes, either, but we rely on predicates and
-   constraints to deal with that.  */
-int
-m32c_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
+/* The r8c/m32c family supports a wide range of non-orthogonal
+   addressing modes, including the ability to double-indirect on *some*
+   of them.  Not all insns support all modes, either, but we rely on
+   predicates and constraints to deal with that.  */
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P m32c_legitimate_address_p
+bool
+m32c_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   int mode_adjust;
   if (CONSTANT_P (x))
index cb2b8bea1f0e67766f9b8d57ea4042bb5ad1b86a..5c3130534a496c0a85755152a803ab0c118a61e1 100644 (file)
@@ -578,10 +578,6 @@ typedef struct m32c_cumulative_args
 #define REG_OK_STRICT_V 0
 #endif
 
-#define GO_IF_LEGITIMATE_ADDRESS(MODE,X,LABEL) \
-       if (m32c_legitimate_address_p (MODE, X, REG_OK_STRICT_V)) \
-         goto LABEL;
-
 #define REG_OK_FOR_BASE_P(X) m32c_reg_ok_for_base_p (X, REG_OK_STRICT_V)
 #define REG_OK_FOR_INDEX_P(X) 0
 
index 5412e1d3eea825747b9a990c1f40c3469205a2f3..2f138c724ead940bc90a87c6ca09de1680c63dff 100644 (file)
@@ -48,8 +48,6 @@ extern void m68hc11_initialize_trampoline (rtx, rtx, rtx);
 extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx);
 extern enum reg_class preferred_reload_class (rtx, enum reg_class);
 
-extern int m68hc11_go_if_legitimate_address (rtx, enum machine_mode, int);
-
 extern void m68hc11_notice_update_cc (rtx, rtx);
 extern void m68hc11_notice_keep_cc (rtx);
 
index 024e55de476368a7353342624dd170f87e43bfeb..ae4f7057c76b6eef8b3a1fea9ff74f7a6953b45d 100644 (file)
@@ -64,7 +64,8 @@ static void emit_move_after_reload (rtx, rtx, rtx);
 static rtx simplify_logical (enum machine_mode, int, rtx, rtx *);
 static void m68hc11_emit_logical (enum machine_mode, int, rtx *);
 static void m68hc11_reorg (void);
-static int go_if_legitimate_address_internal (rtx, enum machine_mode, int);
+static bool m68hc11_legitimate_address_p_1 (enum machine_mode, rtx, bool);
+static bool m68hc11_legitimate_address_p (enum machine_mode, rtx, bool);
 static rtx m68hc11_expand_compare (enum rtx_code, rtx, rtx);
 static int must_parenthesize (rtx);
 static int m68hc11_address_cost (rtx, bool);
@@ -260,6 +261,9 @@ static const struct processor_costs m6812_cost = {
 #undef TARGET_STRIP_NAME_ENCODING
 #define TARGET_STRIP_NAME_ENCODING m68hc11_strip_name_encoding
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    m68hc11_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 int
@@ -721,9 +725,9 @@ m68hc11_register_indirect_p (rtx operand, enum machine_mode mode)
   return m68hc11_valid_addressing_p (operand, mode, addr_mode);
 }
 
-static int
-go_if_legitimate_address_internal (rtx operand, enum machine_mode mode,
-                                   int strict)
+static bool
+m68hc11_legitimate_address_p_1  (enum machine_mode mode, rtx operand,
+                                 bool strict)
 {
   int addr_mode;
 
@@ -752,9 +756,9 @@ go_if_legitimate_address_internal (rtx operand, enum machine_mode mode,
   return 0;
 }
 
-int
-m68hc11_go_if_legitimate_address (rtx operand, enum machine_mode mode,
-                                  int strict)
+bool
+m68hc11_legitimate_address_p (enum machine_mode mode, rtx operand,
+                              bool strict)
 {
   int result;
 
@@ -765,7 +769,7 @@ m68hc11_go_if_legitimate_address (rtx operand, enum machine_mode mode,
       debug_rtx (operand);
     }
 
-  result = go_if_legitimate_address_internal (operand, mode, strict);
+  result = m68hc11_legitimate_address_p_1 (mode, operand, strict);
 
   if (debug_m6811)
     {
index 29d998dbf89e152177784926431e4630cc7cac07..a394403752a8cd117c56f2d1a17f86b9cb6d333a 100644 (file)
@@ -1169,19 +1169,6 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
   (((GET_CODE (X) == PRE_DEC) || (GET_CODE (X) == POST_INC)) \
        && SP_REG_P (XEXP (X, 0)))
 
-/* Go to ADDR if X is a valid address.  */
-#ifndef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-{ \
-  if (m68hc11_go_if_legitimate_address ((X), (MODE), 0)) goto ADDR; \
-}
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                 \
-{                                                       \
-  if (m68hc11_go_if_legitimate_address ((X), (MODE), 1)) goto ADDR; \
-}
-#endif
-
 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its
    validity for a certain class.  We have two alternate definitions for each
    of them.  The usual definition accepts all pseudo regs; the other rejects
index 43a457fe1d8a44accc9499137fdbf62c53ffcdf5..1b91709e45d7ade84fbfc4be5f3a845e3969e49c 100644 (file)
@@ -56,7 +56,6 @@ extern void notice_update_cc (rtx, rtx);
 extern bool m68k_legitimate_base_reg_p (rtx, bool);
 extern bool m68k_legitimate_index_reg_p (rtx, bool);
 extern bool m68k_illegitimate_symbolic_constant_p (rtx);
-extern bool m68k_legitimate_address_p (enum machine_mode, rtx, bool);
 extern bool m68k_matches_q_p (rtx);
 extern bool m68k_matches_u_p (rtx);
 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
index 1b5c83bb414eb0b61a92e4b383c21d6dd4d30018..ce028a02a6608ef0fb638d434a86e4a158a7fa81 100644 (file)
@@ -131,6 +131,7 @@ static void m68k_sched_dfa_pre_advance_cycle (void);
 static void m68k_sched_dfa_post_advance_cycle (void);
 static int m68k_sched_first_cycle_multipass_dfa_lookahead (void);
 
+static bool m68k_legitimate_address_p (enum machine_mode, rtx, bool);
 static bool m68k_handle_option (size_t, const char *, int);
 static rtx find_addr_reg (rtx);
 static const char *singlemove_string (rtx *);
@@ -248,6 +249,9 @@ const char *m68k_library_id_string = "_current_shared_library_a5_offset_";
 #define TARGET_RETURN_IN_MEMORY m68k_return_in_memory
 #endif
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    m68k_legitimate_address_p
+
 static const struct attribute_spec m68k_attribute_table[] =
 {
   /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
index a30cd47360c49599c8ec62d273b65fbd7cef1959..e91ab00fcc9b20fc39de2946299f15366bb98f84 100644 (file)
@@ -758,14 +758,6 @@ __transfer_from_trampoline ()                                      \
 #define REG_OK_FOR_INDEX_P(X) \
   m68k_legitimate_index_reg_p (X, REG_STRICT_P)
 
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                                \
-  do                                                                   \
-    {                                                                  \
-      if (m68k_legitimate_address_p (MODE, X, REG_STRICT_P))           \
-        goto ADDR;                                                     \
-    }                                                                  \
-  while (0)
-
 \f
 /* This address is OK as it stands.  */
 #define PIC_CASE_VECTOR_ADDRESS(index) index
index f2c67b84908b9b68d65ab7a21078082c76823027..bbae18a13a538c89b6cba7bad1a2f977ce3a852f 100644 (file)
@@ -184,7 +184,6 @@ enum mips_call_type {
 extern bool mips_symbolic_constant_p (rtx, enum mips_symbol_context,
                                      enum mips_symbol_type *);
 extern int mips_regno_mode_ok_for_base_p (int, enum machine_mode, bool);
-extern bool mips_legitimate_address_p (enum machine_mode, rtx, bool);
 extern bool mips_stack_address_p (rtx, enum machine_mode);
 extern int mips_address_insns (rtx, enum machine_mode, bool);
 extern int mips_const_insns (rtx);
index d8686ddd6f80f8e16afdf6ffc5b916ec102649f1..36521ca8ceba9695e576ec1ec56d8049daeb7163 100644 (file)
@@ -2116,10 +2116,9 @@ mips_classify_address (struct mips_address_info *info, rtx x,
     }
 }
 
-/* Return true if X is a legitimate address for a memory operand of mode
-   MODE.  STRICT_P is true if REG_OK_STRICT is in effect.  */
+/* Implement TARGET_LEGITIMATE_ADDRESS_P.  */
 
-bool
+static bool
 mips_legitimate_address_p (enum machine_mode mode, rtx x, bool strict_p)
 {
   struct mips_address_info addr;
@@ -14915,6 +14914,9 @@ mips_final_postscan_insn (FILE *file, rtx insn, rtx *opvec, int noperands)
 #undef TARGET_ASM_FINAL_POSTSCAN_INSN
 #define TARGET_ASM_FINAL_POSTSCAN_INSN mips_final_postscan_insn
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    mips_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 #include "gt-mips.h"
index 301a26ec1ad914870658074c52c379a7e2e81b90..5b64346fef6f2e0730d7a667926541a2903cd03b 100644 (file)
@@ -2504,25 +2504,11 @@ typedef struct mips_args {
 
 #define MAX_REGS_PER_ADDRESS 1
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
-{                                              \
-  if (mips_legitimate_address_p (MODE, X, 1))  \
-    goto ADDR;                                 \
-}
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
-{                                              \
-  if (mips_legitimate_address_p (MODE, X, 0))  \
-    goto ADDR;                                 \
-}
-#endif
-
 /* Check for constness inline but use mips_legitimate_address_p
    to check whether a constant really is an address.  */
 
 #define CONSTANT_ADDRESS_P(X) \
-  (CONSTANT_P (X) && mips_legitimate_address_p (SImode, X, 0))
+  (CONSTANT_P (X) && memory_address_p (SImode, X))
 
 #define LEGITIMATE_CONSTANT_P(X) (mips_const_insns (X) > 0)
 
index d294d8ff0edbd737b7a25bf65cd2780832005559..e839d864697a12022aa35f497aa2d274fa2d5c0f 100644 (file)
@@ -82,7 +82,6 @@ extern rtx mmix_eh_return_stackadj_rtx (void);
 extern rtx mmix_eh_return_handler_rtx (void);
 extern void mmix_initialize_trampoline (rtx, rtx, rtx);
 extern int mmix_constant_address_p (rtx);
-extern int mmix_legitimate_address (enum machine_mode, rtx, int);
 extern int mmix_legitimate_constant_p (rtx);
 extern void mmix_print_operand (FILE *, rtx, int);
 extern void mmix_print_operand_address (FILE *, rtx);
index 6ced05c04dcca2cbc4ce256f2cbeef7d93c26fad..d2115a5d70311345ef0c00cc5daef7c1a223772d 100644 (file)
@@ -125,6 +125,7 @@ static void mmix_emit_sp_add (HOST_WIDE_INT offset);
 static void mmix_target_asm_function_prologue (FILE *, HOST_WIDE_INT);
 static void mmix_target_asm_function_end_prologue (FILE *);
 static void mmix_target_asm_function_epilogue (FILE *, HOST_WIDE_INT);
+static bool mmix_legitimate_address_p (enum machine_mode, rtx, bool);
 static void mmix_reorg (void);
 static void mmix_asm_output_mi_thunk
   (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
@@ -206,6 +207,9 @@ static bool mmix_pass_by_reference (CUMULATIVE_ARGS *,
 #undef TARGET_DEFAULT_TARGET_FLAGS
 #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    mmix_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Functions that are expansions for target macros.
@@ -985,13 +989,12 @@ mmix_constant_address_p (rtx x)
   return constant_ok || (addend & 3) == 0;
 }
 
-/* Return 1 if the address is OK, otherwise 0.
-   Used by GO_IF_LEGITIMATE_ADDRESS.  */
+/* Return 1 if the address is OK, otherwise 0.  */
 
-int
-mmix_legitimate_address (enum machine_mode mode ATTRIBUTE_UNUSED,
-                        rtx x,
-                        int strict_checking)
+bool
+mmix_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+                          rtx x,
+                          bool strict_checking)
 {
 #define MMIX_REG_OK(X)                                                 \
   ((strict_checking                                                    \
index 5a0582df26bc34df4c1a847475bcef4b5acde219..fb3d3019b29e986454632e82977f8a519504dee3 100644 (file)
@@ -690,10 +690,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
 
 #define MAX_REGS_PER_ADDRESS 2
 
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)               \
- if (mmix_legitimate_address (MODE, X, MMIX_REG_OK_STRICT))    \
-   goto LABEL
-
 #ifndef REG_OK_STRICT
 # define REG_OK_FOR_BASE_P(X)                  \
   (REGNO (X) <= MMIX_LAST_GENERAL_REGISTER     \
index 935cb8f81f6a57d8d107cf97949643aa999dd7c9..ae4728ae0cba0b6b39e03ced6b958d57967b52f6 100644 (file)
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 extern void mn10300_override_options (void);
 extern rtx legitimize_pic_address (rtx, rtx);
 extern int legitimate_pic_operand_p (rtx);
-extern bool legitimate_address_p (enum machine_mode, rtx, int);
 extern void print_operand (FILE *, rtx, int);
 extern void print_operand_address (FILE *, rtx);
 extern void mn10300_print_reg_list (FILE *, int);
index 47fd5cbf93307894e895ef92dac0703c0a5d5cd5..e32f3766d646f6e0e24ef7b7769884b9bfc7f4df 100644 (file)
@@ -69,6 +69,7 @@ enum processor_type mn10300_processor = PROCESSOR_DEFAULT;
 
 
 static bool mn10300_handle_option (size_t, const char *, int);
+static bool mn10300_legitimate_address_p (enum machine_mode, rtx, bool);
 static int mn10300_address_cost_1 (rtx, int *);
 static int mn10300_address_cost (rtx, bool);
 static bool mn10300_rtx_costs (rtx, int, int, int *, bool);
@@ -127,6 +128,9 @@ static unsigned int mn10300_case_values_threshold (void);
 #undef TARGET_CASE_VALUES_THRESHOLD
 #define TARGET_CASE_VALUES_THRESHOLD mn10300_case_values_threshold
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    mn10300_legitimate_address_p
+
 static void mn10300_encode_section_info (tree, rtx, int);
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
@@ -1900,9 +1904,21 @@ legitimate_pic_operand_p (rtx x)
 }
 
 /* Return TRUE if the address X, taken from a (MEM:MODE X) rtx, is
-   legitimate, and FALSE otherwise.  */
+   legitimate, and FALSE otherwise.
+
+   On the mn10300, the value in the address register must be
+   in the same memory space/segment as the effective address.
+
+   This is problematical for reload since it does not understand
+   that base+index != index+base in a memory reference.
+
+   Note it is still possible to use reg+reg addressing modes,
+   it's just much more difficult.  For a discussion of a possible
+   workaround and solution, see the comments in pa.c before the
+   function record_unscaled_index_insn_codes.  */
+
 bool
-legitimate_address_p (enum machine_mode mode, rtx x, int strict)
+mn10300_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   if (CONSTANT_ADDRESS_P (x)
       && (! flag_pic || legitimate_pic_operand_p (x)))
index b35894435a20e23748aca83c420c1c392e1966cc..77be9962907c00837b36673b9b9921c1d0cb5e26 100644 (file)
@@ -655,26 +655,6 @@ struct cum_arg {int nbytes; };
 \f
 #define HAVE_POST_INCREMENT (TARGET_AM33)
 
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
-   that is a valid memory address for an instruction.
-   The MODE argument is the machine mode for the MEM expression
-   that wants to use this address.
-
-   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
-   except for CONSTANT_ADDRESS_P which is actually
-   machine-independent.
-
-   On the mn10300, the value in the address register must be
-   in the same memory space/segment as the effective address.
-
-   This is problematical for reload since it does not understand
-   that base+index != index+base in a memory reference.
-
-   Note it is still possible to use reg+reg addressing modes,
-   it's just much more difficult.  For a discussion of a possible
-   workaround and solution, see the comments in pa.c before the
-   function record_unscaled_index_insn_codes.  */
-
 /* Accept either REG or SUBREG where a register is valid.  */
 
 #define RTX_OK_FOR_BASE_P(X, strict)                           \
@@ -684,14 +664,6 @@ struct cum_arg {int nbytes; };
        && REGNO_STRICT_OK_FOR_BASE_P (REGNO (SUBREG_REG (X)),  \
                                      (strict))))
 
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)        \
-do                                                     \
-  {                                                    \
-    if (legitimate_address_p ((MODE), (X), REG_STRICT))        \
-      goto ADDR;                                       \
-  }                                                    \
-while (0)
-
 \f
 
 /* Nonzero if the constant value X is a legitimate general operand.
index 9b2c824ee26d10a28bb09d7bfde8cba3459ab554..7a2a07b98fa63a2f6726728b5a2847dbe7fce3b4 100644 (file)
@@ -26,7 +26,6 @@ extern void picochip_function_prologue (FILE *, HOST_WIDE_INT);
 extern void picochip_function_epilogue (FILE *, HOST_WIDE_INT);
 
 extern enum reg_class picochip_reg_class_from_letter (unsigned);
-extern int picochip_legitimate_address_p (int, struct rtx_def *, unsigned);
 extern int picochip_const_ok_for_letter_p (unsigned HOST_WIDE_INT value, unsigned c);
 
 #ifdef RTX_CODE                        /* inside TREE_CODE */
index e9b6156315303259ec09a37d325680e752f979c4..56c58a83056a4601de8d2496b20600aee4096621 100644 (file)
@@ -95,6 +95,7 @@ rtx picochip_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
 bool picochip_rtx_costs (rtx x, int code, int outer_code, int* total);
 bool picochip_return_in_memory(const_tree type,
                               const_tree fntype ATTRIBUTE_UNUSED);
+bool picochip_legitimate_address_p (enum machine_mode, rtx, bool);
 
 rtx picochip_struct_value_rtx(tree fntype ATTRIBUTE_UNUSED, int incoming ATTRIBUTE_UNUSED);
 rtx picochip_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
@@ -275,6 +276,9 @@ static char picochip_get_vliw_alu_id (void);
 #define TARGET_LIBGCC_CMP_RETURN_MODE picochip_libgcc_cmp_return_mode
 */
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P picochip_legitimate_address_p
+
 /* Loading and storing QImode values to and from memory
    usually requires a scratch register. */
 #undef TARGET_SECONDARY_RELOAD
@@ -1249,8 +1253,8 @@ picochip_const_ok_for_base (enum machine_mode mode, int regno, int offset)
 /* Determine whether a given rtx is a legitimate address for machine_mode
    MODE.  STRICT is non-zero if we're being strict - any pseudo that
    is not a hard register must be a memory reference.  */
-int
-picochip_legitimate_address_p (int mode, rtx x, unsigned strict)
+bool
+picochip_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   int valid = 0;
 
index a3263d02e02fae7da309a71a57e2fdfff2a3c1fd..04400016da2c1ff15e06d41ebdcac091b0ec3e25 100644 (file)
@@ -492,18 +492,6 @@ extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
 
 #define MAX_REGS_PER_ADDRESS 1
 
-#ifdef REG_OK_STRICT
-
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                       \
- if (picochip_legitimate_address_p (MODE, X, 1)) goto LABEL;
-
-#else /* REG_OK_STRICT */
-
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)                       \
-  if (picochip_legitimate_address_p (MODE, X, 0)) goto LABEL;
-
-#endif /* !REG_OK_STRICT */
-
 /* Legitimize reload address tries machine dependent means of
    reloading addresses.  There seems to be a strange error in gcc,
    which necessitates this macro.  Consider:
index f40adabd00a94b7c463aab880f835fed7cf67a4d..c080e60c84597a61c94225a197d560dc4e7cd7af 100644 (file)
@@ -109,7 +109,6 @@ extern void rs6000_emit_move (rtx, rtx, enum machine_mode);
 extern rtx rs6000_secondary_memory_needed_rtx (enum machine_mode);
 extern rtx rs6000_legitimize_reload_address (rtx, enum machine_mode,
                                             int, int, int, int *);
-extern int rs6000_legitimate_address (enum machine_mode, rtx, int);
 extern bool rs6000_legitimate_offset_address_p (enum machine_mode, rtx, int);
 extern bool rs6000_mode_dependent_address (rtx);
 extern rtx rs6000_find_base_term (rtx);
index b14eecce7d43ff69a52dcd0ecebe19174ff8f709..a308731b291c5112ca2977e0e30371696997d4eb 100644 (file)
@@ -747,6 +747,7 @@ struct processor_costs power6_cost = {
 \f
 static bool rs6000_function_ok_for_sibcall (tree, tree);
 static const char *rs6000_invalid_within_doloop (const_rtx);
+static bool rs6000_legitimate_address_p (enum machine_mode, rtx, bool);
 static rtx rs6000_generate_compare (rtx, enum machine_mode);
 static void rs6000_emit_stack_tie (void);
 static void rs6000_frame_related (rtx, rtx, HOST_WIDE_INT, rtx, rtx);
@@ -1291,6 +1292,9 @@ static const char alt_reg_names[][8] =
 #undef TARGET_INSTANTIATE_DECLS
 #define TARGET_INSTANTIATE_DECLS rs6000_instantiate_decls
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P rs6000_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 
@@ -3556,7 +3560,7 @@ gpr_or_gpr_p (rtx op0, rtx op1)
 }
 
 \f
-/* Subroutines of rs6000_legitimize_address and rs6000_legitimate_address.  */
+/* Subroutines of rs6000_legitimize_address and rs6000_legitimate_address_p.  */
 
 static bool
 constant_pool_expr_p (rtx op)
@@ -4208,13 +4212,6 @@ rs6000_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
   return RS6000_SYMBOL_REF_TLS_P (*x);
 }
 
-/* The convention appears to be to define this wherever it is used.
-   With legitimize_reload_address now defined here, REG_MODE_OK_FOR_BASE_P
-   is now used here.  */
-#ifndef REG_MODE_OK_FOR_BASE_P
-#define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO)
-#endif
-
 /* Our implementation of LEGITIMIZE_RELOAD_ADDRESS.  Returns a value to
    replace the input X, or the original X if no replacement is called for.
    The output parameter *WIN is 1 if the calling macro should goto WIN,
@@ -4271,7 +4268,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
   if (GET_CODE (x) == PLUS
       && GET_CODE (XEXP (x, 0)) == REG
       && REGNO (XEXP (x, 0)) < 32
-      && REG_MODE_OK_FOR_BASE_P (XEXP (x, 0), mode)
+      && INT_REG_OK_FOR_BASE_P (XEXP (x, 0), 1)
       && GET_CODE (XEXP (x, 1)) == CONST_INT
       && (INTVAL (XEXP (x, 1)) & 3) != 0
       && !ALTIVEC_VECTOR_MODE (mode)
@@ -4289,7 +4286,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
   if (GET_CODE (x) == PLUS
       && GET_CODE (XEXP (x, 0)) == REG
       && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
-      && REG_MODE_OK_FOR_BASE_P (XEXP (x, 0), mode)
+      && INT_REG_OK_FOR_BASE_P (XEXP (x, 0), 1)
       && GET_CODE (XEXP (x, 1)) == CONST_INT
       && !SPE_VECTOR_MODE (mode)
       && !(TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode
@@ -4410,8 +4407,8 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
    32-bit DImode, TImode, TFmode, TDmode), indexed addressing cannot be used
    because adjacent memory cells are accessed by adding word-sized offsets
    during assembly output.  */
-int
-rs6000_legitimate_address (enum machine_mode mode, rtx x, int reg_ok_strict)
+bool
+rs6000_legitimate_address_p (enum machine_mode mode, rtx x, bool reg_ok_strict)
 {
   /* If this is an unaligned stvx/ldvx type address, discard the outer AND.  */
   if (TARGET_ALTIVEC
index e65bf5d95dfa04bb27170f1ad9d3a7c7dc9d492f..c50060026c5b7b6f5f8cc4534b4c638f85eb4422 100644 (file)
@@ -1722,6 +1722,19 @@ typedef struct rs6000_args
  : (reg_renumber[REGNO] > 0                                    \
     && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67 \
        || reg_renumber[REGNO] == FRAME_POINTER_REGNUM)))
+
+/* Nonzero if X is a hard reg that can be used as an index
+   or if it is a pseudo reg in the non-strict case.  */
+#define INT_REG_OK_FOR_INDEX_P(X, STRICT)                      \
+  ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER)           \
+   || REGNO_OK_FOR_INDEX_P (REGNO (X)))
+
+/* Nonzero if X is a hard reg that can be used as a base reg
+   or if it is a pseudo reg in the non-strict case.  */
+#define INT_REG_OK_FOR_BASE_P(X, STRICT)                       \
+  ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER)           \
+   || REGNO_OK_FOR_BASE_P (REGNO (X)))
+
 \f
 /* Maximum number of registers that can appear in a valid memory address.  */
 
@@ -1755,62 +1768,6 @@ typedef struct rs6000_args
                                    && EASY_VECTOR_15((n) >> 1) \
                                    && ((n) & 1) == 0)
 
-/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
-   and check its validity for a certain class.
-   We have two alternate definitions for each of them.
-   The usual definition accepts all pseudo regs; the other rejects
-   them unless they have been allocated suitable hard regs.
-   The symbol REG_OK_STRICT causes the latter definition to be used.
-
-   Most source files want to accept pseudo regs in the hope that
-   they will get allocated to the class that the insn wants them to be in.
-   Source files for reload pass need to be strict.
-   After reload, it makes no difference, since pseudo regs have
-   been eliminated by then.  */
-
-#ifdef REG_OK_STRICT
-# define REG_OK_STRICT_FLAG 1
-#else
-# define REG_OK_STRICT_FLAG 0
-#endif
-
-/* Nonzero if X is a hard reg that can be used as an index
-   or if it is a pseudo reg in the non-strict case.  */
-#define INT_REG_OK_FOR_INDEX_P(X, STRICT)                      \
-  ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER)           \
-   || REGNO_OK_FOR_INDEX_P (REGNO (X)))
-
-/* Nonzero if X is a hard reg that can be used as a base reg
-   or if it is a pseudo reg in the non-strict case.  */
-#define INT_REG_OK_FOR_BASE_P(X, STRICT)                       \
-  ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER)           \
-   || REGNO_OK_FOR_BASE_P (REGNO (X)))
-
-#define REG_OK_FOR_INDEX_P(X) INT_REG_OK_FOR_INDEX_P (X, REG_OK_STRICT_FLAG)
-#define REG_OK_FOR_BASE_P(X)  INT_REG_OK_FOR_BASE_P (X, REG_OK_STRICT_FLAG)
-\f
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
-   that is a valid memory address for an instruction.
-   The MODE argument is the machine mode for the MEM expression
-   that wants to use this address.
-
-   On the RS/6000, there are four valid addresses: a SYMBOL_REF that
-   refers to a constant pool entry of an address (or the sum of it
-   plus a constant), a short (16-bit signed) constant plus a register,
-   the sum of two registers, or a register indirect, possibly with an
-   auto-increment.  For DFmode, DDmode and DImode with a constant plus
-   register, we must ensure that both words are addressable or PowerPC64
-   with offset word aligned.
-
-   For modes spanning multiple registers (DFmode and DDmode in 32-bit GPRs,
-   32-bit DImode, TImode), indexed addressing cannot be used because
-   adjacent memory cells are accessed by adding word-sized offsets
-   during assembly output.  */
-
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                        \
-{ if (rs6000_legitimate_address (MODE, X, REG_OK_STRICT_FLAG)) \
-    goto ADDR;                                                 \
-}
 \f
 /* Try a machine-dependent way of reloading an illegitimate address
    operand.  If we find one, push the reload and jump to WIN.  This
index 4d37094e2cf86b5738cf716e987e4596b3a27a12..6cc33d1cf8a71bc133d53ae884c6c26b428f6886 100644 (file)
@@ -398,7 +398,7 @@ level.  This constraint will never be used and using it in an inline
 assembly is *always* a bug since there is no instruction accepting all
 those addresses.  It just serves as a placeholder for a generic memory
 constraint."
-  (match_test "legitimate_address_p (GET_MODE (op), op, 1)"))
+  (match_test "strict_memory_address_p (GET_MODE (op), op)"))
 
 ; This defines 'm' as normal memory constraint.  This is only possible
 ; since the standard memory constraint is re-defined in s390.h using
index 3bde1c14b48f4ef03dde68591e8427a0e2790289..b410de538d0760b1d2e1df2554400049f1e88ec9 100644 (file)
@@ -72,7 +72,6 @@ extern bool preferred_la_operand_p (rtx, rtx);
 extern int legitimate_pic_operand_p (rtx);
 extern int legitimate_constant_p (rtx);
 extern bool legitimate_reload_constant_p (rtx);
-extern bool legitimate_address_p (enum machine_mode, rtx, int);
 extern rtx legitimize_pic_address (rtx, rtx);
 extern rtx legitimize_reload_address (rtx, enum machine_mode, int, int);
 extern enum reg_class s390_preferred_reload_class (rtx, enum reg_class);
index 17891c6492ff5f20f139159c96b686f7a12ddc2e..7f9dd132fe236fb2b7e9b619afcca5ee218b1288 100644 (file)
@@ -3080,8 +3080,8 @@ s390_expand_plus_operand (rtx target, rtx src,
 /* Return true if ADDR is a valid memory address.
    STRICT specifies whether strict register checking applies.  */
 
-bool
-legitimate_address_p (enum machine_mode mode, rtx addr, int strict)
+static bool
+s390_legitimate_address_p (enum machine_mode mode, rtx addr, bool strict)
 {
   struct s390_address ad;
 
@@ -3739,7 +3739,7 @@ s390_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
     {
       x = legitimize_tls_address (x, 0);
 
-      if (legitimate_address_p (mode, x, FALSE))
+      if (s390_legitimate_address_p (mode, x, FALSE))
        return x;
     }
   else if (GET_CODE (x) == PLUS
@@ -3756,7 +3756,7 @@ s390_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
                   || SYMBOLIC_CONST (XEXP (x, 1)))))
          x = legitimize_pic_address (x, 0);
 
-      if (legitimate_address_p (mode, x, FALSE))
+      if (s390_legitimate_address_p (mode, x, FALSE))
        return x;
     }
 
@@ -9984,6 +9984,9 @@ s390_reorg (void)
 #undef TARGET_LIBGCC_SHIFT_COUNT_MODE
 #define TARGET_LIBGCC_SHIFT_COUNT_MODE s390_libgcc_shift_count_mode
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P s390_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #include "gt-s390.h"
index b25418571702c661a10dba36f551289b86338621..26bdd9e7493a657f37c9356088f6e400e84c6e75 100644 (file)
@@ -740,30 +740,12 @@ CUMULATIVE_ARGS;
 #define MAX_REGS_PER_ADDRESS 2
 
 /* This definition replaces the formerly used 'm' constraint with a
-different constraint letter in order to avoid changing semantics of
-the 'm' constraint when accepting new address formats in
-legitimate_address_p.  The constraint letter defined here must not be
-used in insn definitions or inline assemblies.  */
+   different constraint letter in order to avoid changing semantics of
+   the 'm' constraint when accepting new address formats in
+   TARGET_LEGITIMATE_ADDRESS_P.  The constraint letter defined here
+   must not be used in insn definitions or inline assemblies.  */
 #define TARGET_MEM_CONSTRAINT 'e'
 
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a
-   valid memory address for an instruction.
-   The MODE argument is the machine mode for the MEM expression
-   that wants to use this address.  */
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                         \
-{                                                                       \
-  if (legitimate_address_p (MODE, X, 1))                                \
-    goto ADDR;                                                          \
-}
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                         \
-{                                                                       \
-  if (legitimate_address_p (MODE, X, 0))                                \
-    goto ADDR;                                                          \
-}
-#endif
-
 /* Try a machine-dependent way of reloading an illegitimate address
    operand.  If we find one, push the reload and jump to WIN.  This
    macro is used in only one place: `find_reloads_address' in reload.c.  */
index e517eeb6608b7dcb5ac6fa2ef27490f264357a15..0b737459765a36876ed5741a04910f232d2cf3ad 100644 (file)
 #undef TARGET_ADDRESS_COST
 #define TARGET_ADDRESS_COST             score_address_cost
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    score_legitimate_address_p
+
 struct extern_list *extern_head = 0;
 
 /* default 0 = NO_REGS  */
@@ -531,13 +534,13 @@ score_regno_mode_ok_for_base_p (int regno, int strict)
 }
 
 /* Implement GO_IF_LEGITIMATE_ADDRESS macro.  */
-int
-score_address_p (enum machine_mode mode, rtx x, int strict)
+bool
+score_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_address_p (mode, x, strict);
+    return score7_legitimate_address_p (mode, x, strict);
   else if (TARGET_SCORE3)
-    return score3_address_p (mode, x, strict);
+    return score3_legitimate_address_p (mode, x, strict);
 
   gcc_unreachable ();
 }
index d9fe8e656252d089fed678033181acfcdf3ec6d8..e6c8b7504ba49b5c48aa57c8a262bae4d583f4f1 100644 (file)
@@ -748,16 +748,6 @@ typedef struct score_args
 /* Maximum number of registers that can appear in a valid memory address.  */
 #define MAX_REGS_PER_ADDRESS            1
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)   \
-  if (score_address_p (MODE, X, 1))                \
-    goto LABEL;
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)   \
-  if (score_address_p (MODE, X, 0))                \
-    goto LABEL;
-#endif
-
 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
    and check its validity for a certain class.
    We have two alternate definitions for each of them.
index 3ddc3b8c7985855141ec0999218f1b8d1419e64f..4ac7e60d88cb3120009405faa96d5206bb557c42 100644 (file)
@@ -911,8 +911,8 @@ score3_regno_mode_ok_for_base_p (int regno, int strict)
 }
 
 /* Implement GO_IF_LEGITIMATE_ADDRESS macro.  */
-int
-score3_address_p (enum machine_mode mode, rtx x, int strict)
+bool
+score3_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   struct score3_address_info addr;
 
index d718d12e8d95a60d0b8cae8342d2515313310483..001b2f0c2ee2a57033b901838a19c9df32994c17 100644 (file)
@@ -122,7 +122,8 @@ extern rtx score3_function_value (tree valtype,
                                   enum machine_mode mode);
 extern void score3_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN);
 extern int score3_regno_mode_ok_for_base_p (int regno, int strict);
-extern int score3_address_p (enum machine_mode mode, rtx x, int strict);
+extern bool score3_legitimate_address_p (enum machine_mode mode, rtx x,
+                                        bool strict);
 extern int score3_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
                                       enum reg_class from,
                                       enum reg_class to);
index 661cae73bd395e2dcc58229ac08864e2694538da..c18d03b2675056e473c523d85a6eff310181d55c 100644 (file)
@@ -902,8 +902,8 @@ score7_regno_mode_ok_for_base_p (int regno, int strict)
 }
 
 /* Implement GO_IF_LEGITIMATE_ADDRESS macro.  */
-int
-score7_address_p (enum machine_mode mode, rtx x, int strict)
+bool
+score7_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   struct score7_address_info addr;
 
index 0c0a3b20f8efa18d98b645e22b25137db63f7c05..ae3f4e837cb21072aec678bb4870fd76a03c1432 100644 (file)
@@ -122,7 +122,8 @@ extern rtx score7_function_value (tree valtype,
                                   enum machine_mode mode);
 extern void score7_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN);
 extern int score7_regno_mode_ok_for_base_p (int regno, int strict);
-extern int score7_address_p (enum machine_mode mode, rtx x, int strict);
+extern bool score7_legitimate_address_p (enum machine_mode mode, rtx x,
+                                        bool strict);
 extern int score7_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
                                       enum reg_class from,
                                       enum reg_class to);
index fd388dd8139231112ec942b1cd8c15d417053f8f..8b3547ad9074ee604ff8a9ae1487aae7a5b7fc93 100644 (file)
@@ -67,7 +67,6 @@ extern void sparc64_initialize_trampoline (rtx, rtx, rtx);
 extern bool legitimate_constant_p (rtx);
 extern bool constant_address_p (rtx);
 extern bool legitimate_pic_operand_p (rtx);
-extern int legitimate_address_p (enum machine_mode, rtx, int);
 extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
 extern rtx legitimize_tls_address (rtx);
 extern void sparc_emit_call_insn (rtx, rtx);
index 330c2c0698173f8c6582674fec5eb4f90e545da5..d6467bdc2dd7281561422d46aef11e179dcd667a 100644 (file)
@@ -357,6 +357,7 @@ static int hypersparc_adjust_cost (rtx, rtx, rtx, int);
 static void sparc_output_addr_vec (rtx);
 static void sparc_output_addr_diff_vec (rtx);
 static void sparc_output_deferred_case_vectors (void);
+static bool sparc_legitimate_address_p (enum machine_mode, rtx, bool);
 static rtx sparc_builtin_saveregs (void);
 static int epilogue_renumber (rtx *, int);
 static bool sparc_assemble_integer (rtx, unsigned int, int);
@@ -588,6 +589,9 @@ static bool fpu_option_set = false;
 #define TARGET_MANGLE_TYPE sparc_mangle_type
 #endif
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P sparc_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Implement TARGET_HANDLE_OPTION.  */
@@ -3067,8 +3071,8 @@ legitimate_pic_operand_p (rtx x)
 /* Return nonzero if ADDR is a valid memory address.
    STRICT specifies whether strict register checking applies.  */
    
-int
-legitimate_address_p (enum machine_mode mode, rtx addr, int strict)
+static bool
+sparc_legitimate_address_p (enum machine_mode mode, rtx addr, bool strict)
 {
   rtx rs1 = NULL, rs2 = NULL, imm1 = NULL;
 
@@ -3503,7 +3507,7 @@ sparc_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
     x = gen_rtx_PLUS (Pmode, XEXP (x, 0),
                      force_operand (XEXP (x, 1), NULL_RTX));
 
-  if (x != orig_x && legitimate_address_p (mode, x, FALSE))
+  if (x != orig_x && sparc_legitimate_address_p (mode, x, FALSE))
     return x;
 
   if (SPARC_SYMBOL_REF_TLS_P (x))
index 280036224bee722dc439f6af72c6c27ec1472441..1aef109b113ffb5e4626632c3032a0b69ed7a8c1 100644 (file)
@@ -1875,20 +1875,6 @@ do {                                                                     \
 #define RTX_OK_FOR_OLO10_P(X)                                          \
   (GET_CODE (X) == CONST_INT && INTVAL (X) >= -0x1000 && INTVAL (X) < 0xc00 - 8)
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
-{                                                      \
-  if (legitimate_address_p (MODE, X, 1))               \
-    goto ADDR;                                         \
-}
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
-{                                                      \
-  if (legitimate_address_p (MODE, X, 0))               \
-    goto ADDR;                                         \
-}
-#endif
-
 /* Go to LABEL if ADDR (a legitimate address expression)
    has an effect that depends on the machine mode it is used for.
 
index 3e2600b996b1d31b23310ef4780b7e941178d57f..33951d77ea9870b3de7c1cb2cc48fb4e58a46c74 100644 (file)
@@ -54,8 +54,6 @@ extern bool exp2_immediate_p (rtx op, enum machine_mode mode, int low,
                              int high);
 extern int spu_constant_address_p (rtx x);
 extern int spu_legitimate_constant_p (rtx x);
-extern int spu_legitimate_address (enum machine_mode mode, rtx x,
-                                  int reg_ok_strict);
 extern int spu_initial_elimination_offset (int from, int to);
 extern rtx spu_function_value (const_tree type, const_tree func);
 extern rtx spu_function_arg (int cum, enum machine_mode mode, tree type,
index f73bb217605f9c8b6019bb814755ca6b3ec7b476..b8e08c83ea651a7e916e2465c4395ab6f8c8d985 100644 (file)
@@ -152,6 +152,7 @@ char regs_ever_allocated[FIRST_PSEUDO_REGISTER];
 static void spu_init_builtins (void);
 static unsigned char spu_scalar_mode_supported_p (enum machine_mode mode);
 static unsigned char spu_vector_mode_supported_p (enum machine_mode mode);
+static bool spu_legitimate_address_p (enum machine_mode, rtx, bool);
 static rtx adjust_operand (rtx op, HOST_WIDE_INT * start);
 static rtx get_pic_reg (void);
 static int need_to_save_reg (int regno, int saving);
@@ -399,6 +400,9 @@ const struct attribute_spec spu_attribute_table[];
 #undef TARGET_SECTION_TYPE_FLAGS
 #define TARGET_SECTION_TYPE_FLAGS spu_section_type_flags
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P spu_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 void
@@ -3612,9 +3616,9 @@ spu_legitimate_constant_p (rtx x)
   The alignment matters in the reg+const case because lqd and stqd
   ignore the 4 least significant bits of the const.  (TODO: It might be
   preferable to allow any alignment and fix it up when splitting.) */
-int
-spu_legitimate_address (enum machine_mode mode ATTRIBUTE_UNUSED,
-                       rtx x, int reg_ok_strict)
+bool
+spu_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+                         rtx x, bool reg_ok_strict)
 {
   if (mode == TImode && GET_CODE (x) == AND
       && GET_CODE (XEXP (x, 1)) == CONST_INT
index ddd464ac579bb123a8594e5a361ee784c18b44b7..f994f3709c1b264735c72b2ce0a474575f24307f 100644 (file)
@@ -416,17 +416,6 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin;       \
 
 #define MAX_REGS_PER_ADDRESS 2
 
-#ifdef REG_OK_STRICT
-# define REG_OK_STRICT_FLAG 1
-#else
-# define REG_OK_STRICT_FLAG 0
-#endif
-
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                        \
-    { if (spu_legitimate_address (MODE, X, REG_OK_STRICT_FLAG))        \
-       goto ADDR;                                              \
-    }
-
 #define LEGITIMATE_CONSTANT_P(X) spu_legitimate_constant_p(X)
 
 \f
index bde411b4e3af5e1cfd23c933569f6822de271bc1..e6fe4c0c96986c23af9009e03bdf6da1df5fa9fd 100644 (file)
@@ -71,7 +71,6 @@ extern int  nonimmediate_nonstack_operand (rtx, enum machine_mode);
 extern enum reg_class xstormy16_secondary_reload_class 
  (enum reg_class, enum machine_mode, rtx);
 extern enum reg_class xstormy16_preferred_reload_class (rtx, enum reg_class);
-extern int xstormy16_legitimate_address_p (enum machine_mode, rtx, int);
 extern void xstormy16_split_move (enum machine_mode, rtx, rtx);
 extern void xstormy16_expand_move (enum machine_mode, rtx, rtx);
 extern void xstormy16_expand_arith (enum machine_mode, enum rtx_code, 
index 4d04cae95d9bc387a134ca027d81aa22b8df2c82..16814ab4e7d462dee53fbdd37b69e6b37015bad6 100644 (file)
@@ -613,9 +613,9 @@ xstormy16_expand_andqi3 (rtx *operands)
   && INTVAL (X) + (OFFSET) < 0x8000                                     \
   && (INTVAL (X) + (OFFSET) < 0x100 || INTVAL (X) + (OFFSET) >= 0x7F00))
 
-int
+static bool
 xstormy16_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
-                               rtx x, int strict)
+                               rtx x, bool strict)
 {
   if (LEGITIMATE_ADDRESS_CONST_INT_P (x, 0))
     return 1;
@@ -2650,6 +2650,9 @@ xstormy16_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
 #undef  TARGET_MACHINE_DEPENDENT_REORG
 #define TARGET_MACHINE_DEPENDENT_REORG xstormy16_reorg
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    xstormy16_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #include "gt-stormy16.h"
index d626edf6e5091c558165d1df7bc7c0568eb47cdd..cb35a13ab6a969e17431ab90cab646324838070f 100644 (file)
@@ -536,20 +536,6 @@ enum reg_class
 
 #define MAX_REGS_PER_ADDRESS 1
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)       \
-do {                                                   \
-  if (xstormy16_legitimate_address_p (MODE, X, 1))     \
-    goto LABEL;                                                \
-} while (0)
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)       \
-do {                                                   \
-  if (xstormy16_legitimate_address_p (MODE, X, 0))     \
-    goto LABEL;                                                \
-} while (0)
-#endif
-
 #ifdef REG_OK_STRICT
 #define REG_OK_FOR_BASE_P(X)                                              \
   (REGNO_OK_FOR_BASE_P (REGNO (X)) && (REGNO (X) < FIRST_PSEUDO_REGISTER))
index c038b300d91a04e8452ec5652cad7933098a449b..86feccda73268f2b4b673cdb4cd222440daee758 100644 (file)
@@ -19,11 +19,9 @@ along with GCC; see the file COPYING3.  If not see
 
 extern void override_options (void);
 
-extern bool legitimate_constant_address_p (rtx);
-extern bool legitimate_constant_p (rtx);
-extern bool legitimate_pic_operand_p (rtx);
-extern bool legitimate_address_p (enum machine_mode, rtx, bool);
-extern bool vax_mode_dependent_address_p (rtx);
+extern int legitimate_constant_address_p (rtx);
+extern int legitimate_constant_p (rtx);
+extern int vax_mode_dependent_address_p (rtx);
 
 #ifdef RTX_CODE
 extern const char *cond_name (rtx);
index cd66bb4e2d7ed9f343cdcda48c26f7d6bb5399f1..f0f6a936407c0a2e2e9378d4b2ea790a53de1c84 100644 (file)
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "target-def.h"
 
+static bool vax_legitimate_address_p (enum machine_mode, rtx, bool);
 static void vax_output_function_prologue (FILE *, HOST_WIDE_INT);
 static void vax_file_start (void);
 static void vax_init_libfuncs (void);
@@ -94,6 +95,9 @@ static rtx vax_builtin_setjmp_frame_value (void);
 #undef TARGET_BUILTIN_SETJMP_FRAME_VALUE
 #define TARGET_BUILTIN_SETJMP_FRAME_VALUE vax_builtin_setjmp_frame_value
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P vax_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Set global variables as needed for the options enabled.  */
@@ -1731,7 +1735,7 @@ indexable_address_p (rtx xfoo0, rtx xfoo1, enum machine_mode mode, bool strict)
    The MODE argument is the machine mode for the MEM expression
    that wants to use this address.  */
 bool
-legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
+vax_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   rtx xfoo0, xfoo1;
 
index 7fa2fbb870e0e3177c7747870e9481bef84cb174..e22fbd74386ec6163dbcbf1ed3c5057eb1f4a7c5 100644 (file)
@@ -540,11 +540,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
    or if it is a pseudo reg.  */
 #define REG_OK_FOR_BASE_P(X) 1
 
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
-   that is a valid memory address for an instruction.  */
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-  { if (legitimate_address_p ((MODE), (X), 0)) goto ADDR; }
-
 #else
 
 /* Nonzero if X is a hard reg that can be used as an index.  */
@@ -553,11 +548,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
 /* Nonzero if X is a hard reg that can be used as a base reg.  */
 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
 
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
-   that is a valid memory address for an instruction.  */
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-  { if (legitimate_address_p ((MODE), (X), 1)) goto ADDR; }
-
 #endif
 
 /* Go to LABEL if ADDR (a legitimate address expression)
index 76f10179c75d87b8b239c816b2918f759328b649..c60917f07ed6e5f12d4d76e5a721d441cd35f3fc 100644 (file)
@@ -54,7 +54,6 @@ extern char *xtensa_emit_branch (bool, bool, rtx *);
 extern char *xtensa_emit_bit_branch (bool, bool, rtx *);
 extern char *xtensa_emit_movcc (bool, bool, bool, rtx *);
 extern char *xtensa_emit_call (int, rtx *);
-extern bool xtensa_legitimate_address_p (enum machine_mode, rtx, bool);
 extern bool xtensa_tls_referenced_p (rtx);
 
 #ifdef TREE_CODE
index 35e399f54b40222a92fa49bdb7f0170e83b7e891..9bdedc1814d4d152a6622ac8848d5c8b2a043e77 100644 (file)
@@ -130,6 +130,7 @@ static bool xtensa_return_in_msb (const_tree);
 static void printx (FILE *, signed int);
 static void xtensa_function_epilogue (FILE *, HOST_WIDE_INT);
 static rtx xtensa_builtin_saveregs (void);
+static bool xtensa_legitimate_address_p (enum machine_mode, rtx, bool);
 static unsigned int xtensa_multibss_section_type_flags (tree, const char *,
                                                        int) ATTRIBUTE_UNUSED;
 static section *xtensa_select_rtx_section (enum machine_mode, rtx,
@@ -223,6 +224,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
 #undef TARGET_CANNOT_FORCE_CONST_MEM
 #define TARGET_CANNOT_FORCE_CONST_MEM xtensa_tls_referenced_p
 
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P    xtensa_legitimate_address_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 \f
index c01a778bf2b5a22b66a767f2792c9bcd765e7ca2..ec5dde1726cedd79c94182cd6cf556196ae7254a 100644 (file)
@@ -771,13 +771,6 @@ typedef struct xtensa_args
 /* Maximum number of registers that can appear in a valid memory address.  */
 #define MAX_REGS_PER_ADDRESS 1
 
-/* Identify valid Xtensa addresses.  */
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, ADDR, LABEL)                    \
-  do {                                                                 \
-    if (xtensa_legitimate_address_p (MODE, ADDR, REG_OK_STRICT_FLAG))  \
-      goto LABEL;                                                      \
-  } while (0)
-
 /* A C expression that is 1 if the RTX X is a constant which is a
    valid address.  This is defined to be the same as 'CONSTANT_P (X)',
    but rejecting CONST_DOUBLE.  */
index 05e04761bc4d4b845cde2bdcb2fea3505a50c727..7f8a5d6b4c635b565826d830b7bc57e8f21c247e 100644 (file)
@@ -2504,8 +2504,8 @@ added to another register (as well as added to a displacement).
 @defmac REGNO_OK_FOR_BASE_P (@var{num})
 A C expression which is nonzero if register number @var{num} is
 suitable for use as a base register in operand addresses.
-Like @code{GO_IF_LEGITIMATE_ADDRESS}, this macro should also
-exist in strict or non-strict variants.  Both variants behave
+Like @code{TARGET_LEGITIMATE_ADDRESS_P}, this macro should also
+define a strict and a non-strict variant.  Both variants behave
 the same for hard register; for pseudos, the strict variant will
 pass only those that have been allocated to a valid hard registers,
 while the non-strict variant will pass all pseudos.
@@ -5361,42 +5361,31 @@ expressions and @code{const} arithmetic expressions, in addition to
 @defmac MAX_REGS_PER_ADDRESS
 A number, the maximum number of registers that can appear in a valid
 memory address.  Note that it is up to you to specify a value equal to
-the maximum number that @code{GO_IF_LEGITIMATE_ADDRESS} would ever
+the maximum number that @code{TARGET_LEGITIMATE_ADDRESS_P} would ever
 accept.
 @end defmac
 
-@defmac GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
-A C compound statement with a conditional @code{goto @var{label};}
-executed if @var{x} (an RTX) is a legitimate memory address on the
-target machine for a memory operand of mode @var{mode}.
+@deftypefn {Target Hook} TARGET_LEGITIMATE_ADDRESS_P (enum machine_mode @var{mode}, rtx @var{x}, bool @var{strict})
+A function that returns whether @var{x} (an RTX) is a legitimate memory
+address on the target machine for a memory operand of mode @var{mode}.
 
-It usually pays to define several simpler macros to serve as
-subroutines for this one.  Otherwise it may be too complicated to
-understand.
+Legitimate addresses are defined in two variants: a strict variant and a
+non-strict one.  The @code{strict} parameter chooses which variant is
+desired by the caller.
 
-This macro must exist in two variants: a strict variant and a
-non-strict one.  The strict variant is used in the reload pass.  It
-must be defined so that any pseudo-register that has not been
-allocated a hard register is considered a memory reference.  In
-contexts where some kind of register is required, a pseudo-register
-with no hard register must be rejected.
+The strict variant is used in the reload pass.  It must be defined so
+that any pseudo-register that has not been allocated a hard register is
+considered a memory reference.  This is because in contexts where some
+kind of register is required, a pseudo-register with no hard register
+must be rejected.  For non-hard registers, the strict variant should look
+up the @code{reg_renumber} array; it should then proceed using the hard
+register number in the array, or treat the pseudo as a memory reference
+if the array holds @code{-1}.
 
 The non-strict variant is used in other passes.  It must be defined to
 accept all pseudo-registers in every context where some kind of
 register is required.
 
-@findex REG_OK_STRICT
-Compiler source files that want to use the strict variant of this
-macro define the macro @code{REG_OK_STRICT}.  You should use an
-@code{#ifdef REG_OK_STRICT} conditional to define the strict variant
-in that case and the non-strict variant otherwise.
-
-Subroutines to check for acceptable registers for various purposes (one
-for base registers, one for index registers, and so on) are typically
-among the subroutines used to define @code{GO_IF_LEGITIMATE_ADDRESS}.
-Then only these subroutine macros need have two variants; the higher
-levels of macros may be the same whether strict or not.
-
 Normally, constant addresses which are the sum of a @code{symbol_ref}
 and an integer are stored inside a @code{const} RTX to mark them as
 constant.  Therefore, there is no need to recognize such sums
@@ -5417,13 +5406,30 @@ into the @code{symbol_ref}, and then check for it here.  When you see a
 @code{const}, you will have to look inside it to find the
 @code{symbol_ref} in order to determine the section.  @xref{Assembler
 Format}.
-@end defmac
+
+@cindex @code{GO_IF_LEGITIMATE_ADDRESS}
+Some ports are still using a deprecated legacy substitute for
+this hook, the @code{GO_IF_LEGITIMATE_ADDRESS} macro.  This macro
+has this syntax:
+
+@example
+#define GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
+@end example
+
+@noindent
+and should @code{goto @var{label}} if the address @var{x} is a valid
+address on the target machine for a memory operand of mode @var{mode}.
+Whether the strict or non-strict variants are desired is defined by
+the @code{REG_OK_STRICT} macro introduced earlier in this section.
+Using the hook is usually simpler because it limits the number of
+files that are recompiled when changes are made.
+@end deftypefn
 
 @defmac TARGET_MEM_CONSTRAINT
 A single character to be used instead of the default @code{'m'}
 character for general memory addresses.  This defines the constraint
 letter which matches the memory addresses accepted by
-@code{GO_IF_LEGITIMATE_ADDRESS_P}.  Define this macro if you want to
+@code{TARGET_LEGITIMATE_ADDRESS_P}.  Define this macro if you want to
 support new address formats in your back end without changing the
 semantics of the @code{'m'} constraint.  This is necessary in order to
 preserve functionality of inline assembly constructs using the
@@ -6957,13 +6963,14 @@ The default value is false.
 
 This section describes macros that help implement generation of position
 independent code.  Simply defining these macros is not enough to
-generate valid PIC; you must also add support to the macros
-@code{GO_IF_LEGITIMATE_ADDRESS} and @code{PRINT_OPERAND_ADDRESS}, as
-well as @code{LEGITIMIZE_ADDRESS}.  You must modify the definition of
-@samp{movsi} to do something appropriate when the source operand
-contains a symbolic address.  You may also need to alter the handling of
-switch statements so that they use relative addresses.
-@c i rearranged the order of the macros above to try to force one of
+generate valid PIC; you must also add support to the hook
+@code{TARGET_LEGITIMATE_ADDRESS_P} and to the macro
+@code{PRINT_OPERAND_ADDRESS}, as well as @code{LEGITIMIZE_ADDRESS}.  You
+must modify the definition of @samp{movsi} to do something appropriate
+when the source operand contains a symbolic address.  You may also
+need to alter the handling of switch statements so that they use
+relative addresses.
+@c i rearranged the order of the macros above to try to force one of 
 @c them to the next line, to eliminate an overfull hbox. --mew 10feb93
 
 @defmac PIC_OFFSET_TABLE_REGNUM
index 29c77c9be9f14ffabe64498d9911c139ac5fdea5..56be23b21f3aa7f8a2d6f6e3f160d1796f632de2 100644 (file)
@@ -248,12 +248,10 @@ get_dup_num (int op_num, bool use_commut_op_p)
            break;
 
          case 'p':
-           GO_IF_LEGITIMATE_ADDRESS (VOIDmode, op, win_p);
+           if (address_operand (op, VOIDmode))
+             return -1;
            break;
-           
-         win_p:
-           return -1;
-         
+
          case 'g':
            return -1;
            
index baad154c448e2e014910f2614499181c7cfa963c..70b0967f709e14338b9741db5f1e2ca8dca733d0 100644 (file)
@@ -1253,11 +1253,15 @@ pop_operand (rtx op, enum machine_mode mode)
 int
 memory_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx addr)
 {
+#ifdef GO_IF_LEGITIMATE_ADDRESS
   GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
   return 0;
 
  win:
   return 1;
+#else
+  return targetm.legitimate_address_p (mode, addr, 0);
+#endif
 }
 
 /* Return 1 if OP is a valid memory reference with mode MODE,
index fb87a1580a168c75f33cebf23255bb507d18eb44..55d00948cd1da14769318e29938b71d9da211220 100644 (file)
@@ -2135,11 +2135,15 @@ hard_reg_set_here_p (unsigned int beg_regno, unsigned int end_regno, rtx x)
 int
 strict_memory_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx addr)
 {
+#ifdef GO_IF_LEGITIMATE_ADDRESS
   GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
   return 0;
 
  win:
   return 1;
+#else
+  return targetm.legitimate_address_p (mode, addr, 1);
+#endif
 }
 \f
 /* Like rtx_equal_p except that it allows a REG and a SUBREG to match
index 0039f9a438f60a7292404b9ac4d55d46a6a49bfd..99c74e406f839f0b276efa79b599d739d236ee78 100644 (file)
 #define TARGET_COMMUTATIVE_P hook_bool_const_rtx_commutative_p
 #define TARGET_LEGITIMIZE_ADDRESS default_legitimize_address
 #define TARGET_DELEGITIMIZE_ADDRESS hook_rtx_rtx_identity
+#define TARGET_LEGITIMATE_ADDRESS_P default_legitimate_address_p
 #define TARGET_USE_BLOCKS_FOR_CONSTANT_P hook_bool_mode_const_rtx_false
 #define TARGET_MIN_ANCHOR_OFFSET 0
 #define TARGET_MAX_ANCHOR_OFFSET 0
   TARGET_COMMUTATIVE_P,                                \
   TARGET_LEGITIMIZE_ADDRESS,                   \
   TARGET_DELEGITIMIZE_ADDRESS,                 \
+  TARGET_LEGITIMATE_ADDRESS_P,                 \
   TARGET_USE_BLOCKS_FOR_CONSTANT_P,            \
   TARGET_MIN_ANCHOR_OFFSET,                    \
   TARGET_MAX_ANCHOR_OFFSET,                    \
index b6935264e910f4fe08bd834fc71239feef75fc4a..43bdfc41ada1934e0212463fb3a1ba2fd4492995 100644 (file)
@@ -616,6 +616,9 @@ struct gcc_target
   /* Given an address RTX, undo the effects of LEGITIMIZE_ADDRESS.  */
   rtx (* delegitimize_address) (rtx);
 
+  /* Given an address RTX, say whether it is valid.  */
+  bool (* legitimate_address_p) (enum machine_mode, rtx, bool);
+
   /* True if the given constant can be put into an object_block.  */
   bool (* use_blocks_for_constant_p) (enum machine_mode, const_rtx);
 
index 1dd6c7c6de8aaf4324a4da325381ddbc89e0e194..d5c80c29aad3af415dc714d44d669e5f7ec7c6f4 100644 (file)
@@ -68,6 +68,22 @@ along with GCC; see the file COPYING3.  If not see
 #include "recog.h"
 
 
+bool
+default_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+                             rtx addr ATTRIBUTE_UNUSED,
+                             bool strict ATTRIBUTE_UNUSED)
+{
+#ifdef GO_IF_LEGITIMATE_ADDRESS
+  /* Defer to the old implementation using a goto.  */
+  if (strict)
+    return strict_memory_address_p (mode, addr);
+  else
+    return memory_address_p (mode, addr);
+#else
+  gcc_unreachable ();
+#endif
+}
+
 void
 default_external_libcall (rtx fun ATTRIBUTE_UNUSED)
 {
index 19b78cbca336e4829d2a402d1338ebff359e6e13..42764f36828ef709152425bed8189e653a0af299 100644 (file)
@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+extern bool default_legitimate_address_p (enum machine_mode, rtx, bool);
+
 extern void default_external_libcall (rtx);
 extern rtx default_legitimize_address (rtx, rtx, enum machine_mode);