From b0f6b6129a973e1b2f44f2176f7e384376628404 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 31 Jul 2012 02:46:05 +0000 Subject: [PATCH] defaults.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. * defaults.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. * targhooks.c (default_mode_dependent_address_p): Delete code for GO_IF_MODE_DEPENDENT_ADDRESS. * system.h (GO_IF_MODE_DEPENDENT_ADDRESS): Poison. * doc/tm.texi.in (GO_IF_MODE_DEPENDENT_ADDRESS): Delete documention. * doc/tm.texi: Regenerate. * config/alpha.h (GO_IF_MODE_DEPENDENT_ADDRESS): Move code to... * config/alpha.c (alpha_mode_dependent_address_p): ...here. New function. (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. * config/cr16/cr16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. * config/mep/mep.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. * config/vax/vax-protos.h (vax_mode_dependent_address_p): Delete. * config/vax/vax.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. * config/vax/vax.c (vax_mode_dependent_address_p): Make static. Take a const_rtx. (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. From-SVN: r189995 --- gcc/ChangeLog | 21 +++++++++++++++++++++ gcc/config/alpha/alpha.c | 12 ++++++++++++ gcc/config/alpha/alpha.h | 7 ------- gcc/config/cr16/cr16.h | 4 ---- gcc/config/mep/mep.h | 2 -- gcc/config/vax/vax-protos.h | 1 - gcc/config/vax/vax.c | 7 +++++-- gcc/config/vax/vax.h | 5 ----- gcc/defaults.h | 7 ------- gcc/doc/tm.texi | 18 ------------------ gcc/doc/tm.texi.in | 18 ------------------ gcc/system.h | 3 ++- gcc/targhooks.c | 12 ------------ 13 files changed, 40 insertions(+), 77 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 15196d81974..6dd21ec6b55 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2012-07-30 Nathan Froyd + + + * defaults.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. + * targhooks.c (default_mode_dependent_address_p): Delete code + for GO_IF_MODE_DEPENDENT_ADDRESS. + * system.h (GO_IF_MODE_DEPENDENT_ADDRESS): Poison. + * doc/tm.texi.in (GO_IF_MODE_DEPENDENT_ADDRESS): Delete documention. + * doc/tm.texi: Regenerate. + * config/alpha.h (GO_IF_MODE_DEPENDENT_ADDRESS): Move code to... + * config/alpha.c (alpha_mode_dependent_address_p): ...here. New + function. + (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. + * config/cr16/cr16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. + * config/mep/mep.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. + * config/vax/vax-protos.h (vax_mode_dependent_address_p): Delete. + * config/vax/vax.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete. + * config/vax/vax.c (vax_mode_dependent_address_p): Make static. + Take a const_rtx. + (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. + 2012-07-30 Nathan Froyd * expmed.h (NUM_MODE_VECTOR_INT): Define. diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 5617ea313de..6d455eff0a4 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -1038,6 +1038,16 @@ alpha_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, return new_x ? new_x : x; } +/* Return true if ADDR has an effect that depends on the machine mode it + is used for. On the Alpha this is true only for the unaligned modes. + We can simplify the test since we know that the address must be valid. */ + +static bool +alpha_mode_dependent_address_p (const_rtx addr) +{ + return GET_CODE (addr) == AND; +} + /* Primarily this is required for TLS symbols, but given that our move patterns *ought* to be able to handle any symbol at any time, we should never be spilling symbolic operands to the constant pool, ever. */ @@ -9709,6 +9719,8 @@ alpha_conditional_register_usage (void) #undef TARGET_LEGITIMIZE_ADDRESS #define TARGET_LEGITIMIZE_ADDRESS alpha_legitimize_address +#undef TARGET_MODE_DEPENDENT_ADDRESS_P +#define TARGET_MODE_DEPENDENT_ADDRESS_P alpha_mode_dependent_address_p #undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START alpha_file_start diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 8520ea82f45..cdb7c49b007 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -851,13 +851,6 @@ do { \ } \ } while (0) -/* Go to LABEL if ADDR (a legitimate address expression) - has an effect that depends on the machine mode it is used for. - On the Alpha this is true only for the unaligned modes. We can - simplify this test since we know that the address must be valid. */ - -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ -{ if (GET_CODE (ADDR) == AND) goto LABEL; } /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ diff --git a/gcc/config/cr16/cr16.h b/gcc/config/cr16/cr16.h index 54794e1fd27..cf5bdf143ca 100644 --- a/gcc/config/cr16/cr16.h +++ b/gcc/config/cr16/cr16.h @@ -460,10 +460,6 @@ struct cumulative_args #define REG_OK_FOR_INDEX_P(X) 1 #endif /* not REG_OK_STRICT. */ -/* Go to LABEL if ADDR (a legitimate address expression) has - an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) - /* Assume best case (branch predicted). */ #define BRANCH_COST(speed_p, predictable_p) 2 diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h index ad5b36d375d..920120c92b9 100644 --- a/gcc/config/mep/mep.h +++ b/gcc/config/mep/mep.h @@ -561,8 +561,6 @@ typedef struct if (mep_legitimize_reload_address (&(X), (MODE), (OPNUM), (TYPE), (IND_LEVELS))) \ goto WIN -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) - #define SELECT_CC_MODE(OP, X, Y) CCmode diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h index 3f247943314..5363877a36d 100644 --- a/gcc/config/vax/vax-protos.h +++ b/gcc/config/vax/vax-protos.h @@ -19,7 +19,6 @@ along with GCC; see the file COPYING3. If not see . */ extern bool legitimate_constant_address_p (rtx); -extern bool vax_mode_dependent_address_p (rtx); extern void vax_expand_prologue (void); #ifdef RTX_CODE diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index aa929ca1e50..aa848108cf7 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -64,6 +64,7 @@ static rtx vax_builtin_setjmp_frame_value (void); static void vax_asm_trampoline_template (FILE *); static void vax_trampoline_init (rtx, tree, rtx); static int vax_return_pops_args (tree, tree, int); +static bool vax_mode_dependent_address_p (const_rtx); /* Initialize the GCC target structure. */ #undef TARGET_ASM_ALIGNED_HI_OP @@ -103,6 +104,8 @@ static int vax_return_pops_args (tree, tree, int); #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P vax_legitimate_address_p +#undef TARGET_MODE_DEPENDENT_ADDRESS_P +#define TARGET_MODE_DEPENDENT_ADDRESS_P vax_mode_dependent_address_p #undef TARGET_FRAME_POINTER_REQUIRED #define TARGET_FRAME_POINTER_REQUIRED hook_bool_void_true @@ -1833,8 +1836,8 @@ vax_legitimate_address_p (enum machine_mode mode, rtx x, bool strict) increment being the length of the operand) and all indexed address depend thus (because the index scale factor is the length of the operand). */ -bool -vax_mode_dependent_address_p (rtx x) +static bool +vax_mode_dependent_address_p (const_rtx x) { rtx xfoo0, xfoo1; diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h index 9d23fd058f5..35b8f8ea93a 100644 --- a/gcc/config/vax/vax.h +++ b/gcc/config/vax/vax.h @@ -432,11 +432,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) #endif - -/* Go to LABEL if ADDR (a legitimate address expression) - has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - { if (vax_mode_dependent_address_p (ADDR)) goto LABEL; } /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ diff --git a/gcc/defaults.h b/gcc/defaults.h index 316a1c31928..6eead33ba6c 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -1218,13 +1218,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT #endif -/* Many ports have no mode-dependent addresses (except possibly autoincrement - and autodecrement addresses, which are handled by target-independent code - in recog.c). */ -#ifndef GO_IF_MODE_DEPENDENT_ADDRESS -#define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN) -#endif - /* For most ports anything that evaluates to a constant symbolic or integer value is acceptable as a constant address. */ #ifndef CONSTANT_ADDRESS_P diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 0f8d43a9ae0..2a2d500b305 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -5623,24 +5623,6 @@ You may assume that @var{addr} is a valid address for the machine. The default version of this hook returns @code{false}. @end deftypefn -@defmac GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label}) -A C statement or compound statement with a conditional @code{goto -@var{label};} executed if memory address @var{x} (an RTX) can have -different meanings depending on the machine mode of the memory -reference it is used for or if the address is valid for some modes -but not others. - -Autoincrement and autodecrement addresses typically have mode-dependent -effects because the amount of the increment or decrement is the size -of the operand being addressed. Some machines have other mode-dependent -addresses. Many RISC machines have no mode-dependent addresses. - -You may assume that @var{addr} is a valid address for the machine. - -These are obsolete macros, replaced by the -@code{TARGET_MODE_DEPENDENT_ADDRESS_P} target hook. -@end defmac - @deftypefn {Target Hook} bool TARGET_LEGITIMATE_CONSTANT_P (enum machine_mode @var{mode}, rtx @var{x}) This hook returns true if @var{x} is a legitimate constant for a @var{mode}-mode immediate operand on the target machine. You can assume that diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 8deaf69146c..e7d9cecc4a5 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -5547,24 +5547,6 @@ You may assume that @var{addr} is a valid address for the machine. The default version of this hook returns @code{false}. @end deftypefn -@defmac GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label}) -A C statement or compound statement with a conditional @code{goto -@var{label};} executed if memory address @var{x} (an RTX) can have -different meanings depending on the machine mode of the memory -reference it is used for or if the address is valid for some modes -but not others. - -Autoincrement and autodecrement addresses typically have mode-dependent -effects because the amount of the increment or decrement is the size -of the operand being addressed. Some machines have other mode-dependent -addresses. Many RISC machines have no mode-dependent addresses. - -You may assume that @var{addr} is a valid address for the machine. - -These are obsolete macros, replaced by the -@code{TARGET_MODE_DEPENDENT_ADDRESS_P} target hook. -@end defmac - @hook TARGET_LEGITIMATE_CONSTANT_P This hook returns true if @var{x} is a legitimate constant for a @var{mode}-mode immediate operand on the target machine. You can assume that diff --git a/gcc/system.h b/gcc/system.h index e3a72887e06..9e7d5030465 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -888,7 +888,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; IDENT_ASM_OP UNALIGNED_SHORT_ASM_OP UNALIGNED_INT_ASM_OP \ UNALIGNED_LONG_ASM_OP UNALIGNED_DOUBLE_INT_ASM_OP \ USE_COMMON_FOR_ONE_ONLY IFCVT_EXTRA_FIELDS IFCVT_INIT_EXTRA_FIELDS \ - CASE_USE_BIT_TESTS FIXUNS_TRUNC_LIKE_FIX_TRUNC + CASE_USE_BIT_TESTS FIXUNS_TRUNC_LIKE_FIX_TRUNC \ + GO_IF_MODE_DEPENDENT_ADDRESS /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \ diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 1703aad9c96..52a99123c8a 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1204,19 +1204,7 @@ default_hard_regno_scratch_ok (unsigned int regno ATTRIBUTE_UNUSED) bool default_mode_dependent_address_p (const_rtx addr ATTRIBUTE_UNUSED) { -#ifdef GO_IF_MODE_DEPENDENT_ADDRESS - - GO_IF_MODE_DEPENDENT_ADDRESS (CONST_CAST_RTX (addr), win); return false; - /* Label `win' might (not) be used via GO_IF_MODE_DEPENDENT_ADDRESS. */ - win: ATTRIBUTE_UNUSED_LABEL - return true; - -#else - - return false; - -#endif } bool