[PATCH] Provide default for GO_IF_MODE_DEPENDENT_ADDRESS

Paolo Bonzini bonzini@gnu.org
Tue Apr 21 15:14:00 GMT 2009


This patch deletes GO_IF_MODE_DEPENDENT_ADDRESS for ports that have it
empty or (in the case of ARM) redundant, since autoincrement/autodecrement
modes are handled in recog.c.

Ok?

Paolo

2009-04-21  Paolo Bonzini  <bonzini@gnu.org>

	* defaults.h (GO_IF_MODE_DEPENDENT_ADDRESS): Provide empty default.
	* config/frv/frv.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/s390/s390.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/m32c/m32c.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/spu/spu.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/i386/i386.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/sh/sh.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/pdp11/pdp11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/avr/avr.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/crx/crx.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/fr30/fr30.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/m68hc11/m68hc11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/cris/cris.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/iq2000/iq2000.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/mn10300/mn10300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/ia64/ia64.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/m68k/m68k.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/picochip/picochip.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/arc/arc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/mcore/mcore.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/score/score.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/arm/arm.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/pa/pa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/mips/mips.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/v850/v850.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/mmix/mmix.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
	* config/bfin/bfin.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete.

Index: gcc/config/frv/frv.h
===================================================================
--- gcc/config/frv/frv.h	(branch misc-cleanup)
+++ gcc/config/frv/frv.h	(working copy)
@@ -2132,19 +2132,6 @@ do {							\
 
 #define FIND_BASE_TERM frv_find_base_term
 
-/* A C statement or compound statement with a conditional `goto LABEL;'
-   executed if memory address 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 ADDR is a valid address for the machine.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 /* A C expression that is nonzero if X is a legitimate constant for an
    immediate operand on the target machine.  You can assume that X satisfies
    `CONSTANT_P', so you need not check this.  In fact, `1' is a suitable
Index: gcc/config/s390/s390.h
===================================================================
--- gcc/config/s390/s390.h	(branch misc-cleanup)
+++ gcc/config/s390/s390.h	(working copy)
@@ -744,9 +744,6 @@ legitimate_address_p.  The constraint le
 used in insn definitions or inline assemblies.  */
 #define TARGET_MEM_CONSTRAINT 'e'
 
-/* S/390 has no mode dependent addresses.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 /* 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
Index: gcc/config/m32c/m32c.h
===================================================================
--- gcc/config/m32c/m32c.h	(branch misc-cleanup)
+++ gcc/config/m32c/m32c.h	(working copy)
@@ -592,8 +592,6 @@ typedef struct m32c_cumulative_args
 	if (m32c_legitimize_reload_address(&(X),MODE,OPNUM,TYPE,IND_LEVELS)) \
 	  goto WIN;
 
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
-
 #define LEGITIMATE_CONSTANT_P(X) m32c_legitimate_constant_p (X)
 
 /* Condition Code Status */
Index: gcc/config/spu/spu.h
===================================================================
--- gcc/config/spu/spu.h	(branch misc-cleanup)
+++ gcc/config/spu/spu.h	(working copy)
@@ -436,8 +436,6 @@ targetm.resolve_overloaded_builtin = spu
        }							\
   }
 
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
-
 #define LEGITIMATE_CONSTANT_P(X) spu_legitimate_constant_p(X)
 
 
Index: gcc/config/i386/i386.h
===================================================================
--- gcc/config/i386/i386.h	(branch misc-cleanup)
+++ gcc/config/i386/i386.h	(working copy)
@@ -1862,13 +1862,6 @@ do {									\
   (GET_CODE (X) == SYMBOL_REF						\
    || GET_CODE (X) == LABEL_REF						\
    || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
-
-/* Go to LABEL if ADDR (a legitimate address expression)
-   has an effect that depends on the machine mode it is used for.
-   On the 80386, only postdecrement and postincrement address depend thus
-   (the amount of decrement or increment being the length of the operand).
-   These are now caught in recog.c.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
 
 /* Max number of args passed in registers.  If this is more than 3, we will
    have problems with ebx (register #4), since it is a caller save register and
Index: gcc/config/sh/sh.h
===================================================================
--- gcc/config/sh/sh.h	(branch misc-cleanup)
+++ gcc/config/sh/sh.h	(working copy)
@@ -2592,18 +2592,6 @@ struct sh_args {
       goto WIN;								\
     }									\
 }
-
-/* Go to LABEL if ADDR (a legitimate address expression)
-   has an effect that depends on the machine mode it is used for.
-
-   ??? Strictly speaking, we should also include all indexed addressing,
-   because the index scale factor is the length of the operand.
-   However, the impact of GO_IF_MODE_DEPENDENT_ADDRESS would be to
-   high if we did that.  So we rely on reload to fix things up.
-
-   Auto-increment addressing is now treated in recog.c.  */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
 
 /* Specify the machine mode that this machine uses
    for the index in the tablejump instruction.  */
Index: gcc/config/pdp11/pdp11.h
===================================================================
--- gcc/config/pdp11/pdp11.h	(branch misc-cleanup)
+++ gcc/config/pdp11/pdp11.h	(working copy)
@@ -755,14 +755,6 @@ extern int may_call_alloca;
 }
 
 
-/* Go to LABEL if ADDR (a legitimate address expression)
-   has an effect that depends on the machine mode it is used for.
-   On the pdp this is for predec/postinc, and this is now treated
-   generically in recog.c.  */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
-
-
 /* Specify the machine mode that this machine uses
    for the index in the tablejump instruction.  */
 #define CASE_VECTOR_MODE HImode
Index: gcc/config/avr/avr.h
===================================================================
--- gcc/config/avr/avr.h	(branch misc-cleanup)
+++ gcc/config/avr/avr.h	(working copy)
@@ -494,8 +494,6 @@ do {									    \
     }									    \
 } while(0)
 
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
-
 #define LEGITIMATE_CONSTANT_P(X) 1
 
 #define REGISTER_MOVE_COST(MODE, FROM, TO) ((FROM) == STACK_REG ? 6 \
Index: gcc/config/crx/crx.h
===================================================================
--- gcc/config/crx/crx.h	(branch misc-cleanup)
+++ gcc/config/crx/crx.h	(working copy)
@@ -418,8 +418,6 @@ struct cumulative_args
 }
 #endif /* REG_OK_STRICT */
 
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 #define LEGITIMATE_CONSTANT_P(X)  1
 
 /*****************************************************************************/
Index: gcc/config/fr30/fr30.h
===================================================================
--- gcc/config/fr30/fr30.h	(branch misc-cleanup)
+++ gcc/config/fr30/fr30.h	(working copy)
@@ -909,19 +909,6 @@ do										\
    will reload one or both registers only if neither labeling works.  */
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-/* A C statement or compound statement with a conditional `goto LABEL;'
-   executed if memory address 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 ADDR is a valid address for the machine.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 /* A C expression that is nonzero if X is a legitimate constant for an
    immediate operand on the target machine.  You can assume that X satisfies
    `CONSTANT_P', so you need not check this.  In fact, `1' is a suitable
Index: gcc/config/m68hc11/m68hc11.h
===================================================================
--- gcc/config/m68hc11/m68hc11.h	(branch misc-cleanup)
+++ gcc/config/m68hc11/m68hc11.h	(working copy)
@@ -1233,10 +1233,6 @@ extern unsigned char m68hc11_reg_valid_f
     }                                                           \
 }
 
-/* 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)
-
 /* Nonzero if the constant value X is a legitimate general operand.
    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
Index: gcc/config/cris/cris.h
===================================================================
--- gcc/config/cris/cris.h	(branch misc-cleanup)
+++ gcc/config/cris/cris.h	(working copy)
@@ -1207,11 +1207,6 @@ struct cum_args {int regs;};
     }									\
   while (0)
 
-/* In CRIS, only the postincrement address mode depends thus,
-   since the increment depends on the size of the operand.  This is now
-   treated generically within recog.c.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 #define LEGITIMATE_CONSTANT_P(X) 1
 
 
Index: gcc/config/iq2000/iq2000.h
===================================================================
--- gcc/config/iq2000/iq2000.h	(branch misc-cleanup)
+++ gcc/config/iq2000/iq2000.h	(working copy)
@@ -612,8 +612,6 @@ typedef struct iq2000_args
     GO_PRINTF ("LEGITIMIZE_ADDRESS could not fix.\n");			\
 }
 
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {}
-
 #define LEGITIMATE_CONSTANT_P(X) (1)
 
 
Index: gcc/config/mn10300/mn10300.h
===================================================================
--- gcc/config/mn10300/mn10300.h	(branch misc-cleanup)
+++ gcc/config/mn10300/mn10300.h	(working copy)
@@ -713,11 +713,6 @@ while (0)
   if ((X) != orig_x && memory_address_p (MODE, X)) \
     goto WIN; }
 
-/* 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)
-
 /* Nonzero if the constant value X is a legitimate general operand.
    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
Index: gcc/config/ia64/ia64.h
===================================================================
--- gcc/config/ia64/ia64.h	(branch misc-cleanup)
+++ gcc/config/ia64/ia64.h	(working copy)
@@ -1344,13 +1344,6 @@ do {									\
 
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-/* A C statement or compound statement with a conditional `goto LABEL;'
-   executed if memory address 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.  */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 /* A C expression that is nonzero if X is a legitimate constant for an
    immediate operand on the target machine.  */
 
Index: gcc/config/m68k/m68k.h
===================================================================
--- gcc/config/m68k/m68k.h	(branch misc-cleanup)
+++ gcc/config/m68k/m68k.h	(working copy)
@@ -816,11 +816,6 @@ __transfer_from_trampoline ()					\
 	      && GET_CODE (XEXP (X, 1)) == REG)				\
 	    X = force_operand (X, 0);					\
 	  goto WIN; }}}
-
-/* On the 68000, only predecrement and postincrement address depend thus
-   (the amount of decrement or increment being the length of the operand).
-   These are now treated generically in recog.c.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
 
 #define CASE_VECTOR_MODE HImode
 #define CASE_VECTOR_PC_RELATIVE 1
Index: gcc/config/picochip/picochip.h
===================================================================
--- gcc/config/picochip/picochip.h	(branch misc-cleanup)
+++ gcc/config/picochip/picochip.h	(working copy)
@@ -535,9 +535,6 @@ extern const enum reg_class picochip_reg
 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN)	     \
 if (picochip_symbol_offset(X)) { X = gen_rtx_CONST(MODE, X); }
 
-/* There are no mode dependent addresses.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0)
-
 /* Nonzero if the constant rtx X is a legitimate general operand.  X
    satisfies CONSTANT_P.  */
 
Index: gcc/config/arc/arc.h
===================================================================
--- gcc/config/arc/arc.h	(branch misc-cleanup)
+++ gcc/config/arc/arc.h	(working copy)
@@ -795,10 +795,6 @@ do { \
       && RTX_OK_FOR_BASE_P (XEXP ((X), 0)))		\
     goto ADDR;						\
 }
-
-/* 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)
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  */
Index: gcc/config/mcore/mcore.h
===================================================================
--- gcc/config/mcore/mcore.h	(branch misc-cleanup)
+++ gcc/config/mcore/mcore.h	(working copy)
@@ -786,10 +786,6 @@ extern const enum reg_class reg_class_fr
 	GO_IF_LEGITIMATE_INDEX (MODE, REGNO (xop1), xop0, LABEL); \
     }								  \
 }								   
-								   
-/* 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)
 
 /* Specify the machine mode that this machine uses
    for the index in the tablejump instruction.  */
Index: gcc/config/score/score.h
===================================================================
--- gcc/config/score/score.h	(branch misc-cleanup)
+++ gcc/config/score/score.h	(working copy)
@@ -782,10 +782,6 @@ typedef struct score_args
       goto WIN;                                  \
   } while (0)
 
-/* 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)       {}
-
 #define LEGITIMATE_CONSTANT_P(X)        1
 
 /* Condition Code Status.  */
Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h	(branch misc-cleanup)
+++ gcc/config/arm/arm.h	(working copy)
@@ -2231,19 +2231,6 @@ do {							\
     goto WIN;						\
 } while (0)
 
-/* Go to LABEL if ADDR (a legitimate address expression)
-   has an effect that depends on the machine mode it is used for.  */
-#define ARM_GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)  			\
-{									\
-  if (   GET_CODE (ADDR) == PRE_DEC || GET_CODE (ADDR) == POST_DEC	\
-      || GET_CODE (ADDR) == PRE_INC || GET_CODE (ADDR) == POST_INC)	\
-    goto LABEL;								\
-}
-
-/* Nothing helpful to do for the Thumb */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)	\
-  if (TARGET_32BIT)					\
-    ARM_GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL)
 
 
 /* Specify the machine mode that this machine uses
Index: gcc/config/pa/pa.h
===================================================================
--- gcc/config/pa/pa.h	(branch misc-cleanup)
+++ gcc/config/pa/pa.h	(working copy)
@@ -1441,11 +1441,6 @@ do { 									\
   (X) = hppa_legitimize_address (X, OLDX, MODE);	\
   if ((X) != orig_x && memory_address_p (MODE, X)) \
     goto WIN; }
-
-/* 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)
 
 #define TARGET_ASM_SELECT_SECTION  pa_select_section
 
Index: gcc/config/mips/mips.h
===================================================================
--- gcc/config/mips/mips.h	(branch misc-cleanup)
+++ gcc/config/mips/mips.h	(working copy)
@@ -2506,21 +2506,6 @@ typedef struct mips_args {
   } while (0)
 
 
-/* A C statement or compound statement with a conditional `goto
-   LABEL;' executed if memory address X (an RTX) can have different
-   meanings depending on the machine mode of the memory reference it
-   is used for.
-
-   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 ADDR is a valid address for the machine.  */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {}
-
 /* This handles the magic '..CURRENT_FUNCTION' symbol, which means
    'the start of the function that this code is output in'.  */
 
Index: gcc/config/v850/v850.h
===================================================================
--- gcc/config/v850/v850.h	(branch misc-cleanup)
+++ gcc/config/v850/v850.h	(working copy)
@@ -829,11 +829,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.  */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)  {}
-
 /* Nonzero if the constant value X is a legitimate general operand.
    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
Index: gcc/config/mmix/mmix.h
===================================================================
--- gcc/config/mmix/mmix.h	(branch misc-cleanup)
+++ gcc/config/mmix/mmix.h	(working copy)
@@ -710,8 +710,6 @@ typedef struct { int regs; int lib; } CU
 
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
-
 #define LEGITIMATE_CONSTANT_P(X) \
  mmix_legitimate_constant_p (X)
 
Index: gcc/config/bfin/bfin.h
===================================================================
--- gcc/config/bfin/bfin.h	(branch misc-cleanup)
+++ gcc/config/bfin/bfin.h	(working copy)
@@ -986,23 +986,6 @@ do {					       \
  || GET_CODE (X) == LABEL_REF						\
  || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
 
-/*
-     A C statement or compound statement with a conditional `goto
-     LABEL;' executed if memory address 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 ADDR is a valid address for the machine.
-*/
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)
-
 #define NOTICE_UPDATE_CC(EXPR, INSN) 0
 
 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
Index: gcc/defaults.h
===================================================================
--- gcc/defaults.h	(branch misc-cleanup)
+++ gcc/defaults.h	(working copy)
@@ -954,4 +954,9 @@ along with GCC; see the file COPYING3.  
 #define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT
 #endif
 
+/* Many ports have no mode-dependent addresses.  */
+#ifndef GO_IF_MODE_DEPENDENT_ADDRESS
+#define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN)
+#endif
+
 #endif  /* ! GCC_DEFAULTS_H */



More information about the Gcc-patches mailing list