This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Provide a default definition for LEGITIMIZE_ADDRESS.


Hi,

Attached is a patch to provide a default definition for
LEGITIMIZE_ADDRESS.

cirs port also has an empty definition but has some target-specific
comment, so I didn't touch cris port.

Built h8300-elf, which has an empty definition.  OK to apply?

Kazu Hirata

2004-03-07  Kazu Hirata  <kazu@cs.umass.edu>

	* defaults.h (LEGITIMIZE_ADDRESS): Provide a default
	definition.
	* config/arc/arc.h, config/fr30/fr30.h, config/frv/frv.h,
	config/h8300/h8300.h, config/ia64/ia64.h,
	config/mcore/mcore.h, config/mmix/mmix.h,
	config/ns32k/ns32k.h, config/pdp11/pdp11.h,
	config/stormy16/stormy16.h, config/v850/v850.h,
	config/vax/vax.h (LEGITIMIZE_ADDRESS): Remove.
	* doc/tm.texi (LEGITIMIZE_ADDRESS): Mention the default
	definition.

Index: defaults.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/defaults.h,v
retrieving revision 1.129
diff -u -r1.129 defaults.h
--- defaults.h	21 Feb 2004 18:41:48 -0000	1.129
+++ defaults.h	7 Mar 2004 17:41:59 -0000
@@ -703,4 +703,8 @@
 #define SHIFT_COUNT_TRUNCATED 0
 #endif
 
+#ifndef LEGITIMIZE_ADDRESS
+#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
+#endif
+
 #endif  /* ! GCC_DEFAULTS_H */
Index: config/arc/arc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arc/arc.h,v
retrieving revision 1.73
diff -u -r1.73 arc.h
--- config/arc/arc.h	19 Feb 2004 10:56:55 -0000	1.73
+++ config/arc/arc.h	7 Mar 2004 17:42:02 -0000
@@ -906,21 +906,6 @@
     goto ADDR;						\
 }
 
-/* Try machine-dependent ways of modifying an illegitimate address
-   to be legitimate.  If we find one, return the new, valid address.
-   This macro is used in only one place: `memory_address' in explow.c.
-
-   OLDX is the address as it was before break_out_memory_refs was called.
-   In some cases it is useful to look at this to decide what needs to be done.
-
-   MODE and WIN are passed so that this macro can use
-   GO_IF_LEGITIMATE_ADDRESS.
-
-   It is always safe for this macro to do nothing.  It exists to recognize
-   opportunities to optimize the output.  */
-
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, 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) \
Index: config/fr30/fr30.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/fr30/fr30.h,v
retrieving revision 1.53
diff -u -r1.53 fr30.h
--- config/fr30/fr30.h	6 Feb 2004 06:18:27 -0000	1.53
+++ config/fr30/fr30.h	7 Mar 2004 17:42:05 -0000
@@ -988,27 +988,6 @@
    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 compound statement that attempts to replace X with a valid memory
-   address for an operand of mode MODE.  WIN will be a C statement label
-   elsewhere in the code; the macro definition may use
-
-        GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
-
-   to avoid further processing if the address has become legitimate.
-
-   X will always be the result of a call to `break_out_memory_refs', and OLDX
-   will be the operand that was given to that function to produce X.
-
-   The code generated by this macro should not alter the substructure of X.  If
-   it transforms X into a more legitimate form, it should assign X (which will
-   always be a C variable) a new value.
-
-   It is not necessary for this macro to come up with a legitimate address.
-   The compiler has standard ways of doing so in all cases.  In fact, it is
-   safe for this macro to do nothing.  But often a machine-dependent strategy
-   can generate better code.  */
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
-
 /* 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
Index: config/frv/frv.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.h,v
retrieving revision 1.41
diff -u -r1.41 frv.h
--- config/frv/frv.h	24 Feb 2004 16:58:38 -0000	1.41
+++ config/frv/frv.h	7 Mar 2004 17:42:15 -0000
@@ -2410,8 +2410,6 @@
    will reload one or both registers only if neither labeling works.  */
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
-
 #define FIND_BASE_TERM frv_find_base_term
 
 /* A C statement or compound statement with a conditional `goto LABEL;'
Index: config/h8300/h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.174
diff -u -r1.174 h8300.h
--- config/h8300/h8300.h	19 Feb 2004 10:56:56 -0000	1.174
+++ config/h8300/h8300.h	7 Mar 2004 17:42:17 -0000
@@ -886,23 +886,6 @@
   while (0)
 #endif
 
-/* Try machine-dependent ways of modifying an illegitimate address
-   to be legitimate.  If we find one, return the new, valid address.
-   This macro is used in only one place: `memory_address' in explow.c.
-
-   OLDX is the address as it was before break_out_memory_refs was called.
-   In some cases it is useful to look at this to decide what needs to be done.
-
-   MODE and WIN are passed so that this macro can use
-   GO_IF_LEGITIMATE_ADDRESS.
-
-   It is always safe for this macro to do nothing.  It exists to recognize
-   opportunities to optimize the output.
-
-   For the H8/300, don't do anything.  */
-
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)  {}
-
 /* Go to LABEL if ADDR (a legitimate address expression)
    has an effect that depends on the machine mode it is used for.
 
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.172
diff -u -r1.172 ia64.h
--- config/ia64/ia64.h	3 Mar 2004 08:34:58 -0000	1.172
+++ config/ia64/ia64.h	7 Mar 2004 17:42:23 -0000
@@ -1630,13 +1630,6 @@
 
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-/* A C compound statement that attempts to replace X with a valid memory
-   address for an operand of mode MODE.
-
-   This must be present, but there is nothing useful to be done here.  */
-
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
-
 /* 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
Index: config/mcore/mcore.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mcore/mcore.h,v
retrieving revision 1.61
diff -u -r1.61 mcore.h
--- config/mcore/mcore.h	19 Feb 2004 11:14:12 -0000	1.61
+++ config/mcore/mcore.h	7 Mar 2004 17:42:25 -0000
@@ -806,7 +806,6 @@
    On the MCore, allow anything but a double.  */
 #define LEGITIMATE_CONSTANT_P(X) (GET_CODE(X) != CONST_DOUBLE)
 
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
 /* 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: config/mmix/mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.61
diff -u -r1.61 mmix.h
--- config/mmix/mmix.h	6 Feb 2004 06:18:32 -0000	1.61
+++ config/mmix/mmix.h	7 Mar 2004 17:42:28 -0000
@@ -835,8 +835,6 @@
 
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
-
 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
 
 #define LEGITIMATE_CONSTANT_P(X) \
Index: config/ns32k/ns32k.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ns32k/ns32k.h,v
retrieving revision 1.65
diff -u -r1.65 ns32k.h
--- config/ns32k/ns32k.h	7 Mar 2004 04:45:05 -0000	1.65
+++ config/ns32k/ns32k.h	7 Mar 2004 17:42:31 -0000
@@ -1057,23 +1057,6 @@
     }									\
 }
 
-/* Try machine-dependent ways of modifying an illegitimate address
-   to be legitimate.  If we find one, return the new, valid address.
-   This macro is used in only one place: `memory_address' in explow.c.
-
-   OLDX is the address as it was before break_out_memory_refs was called.
-   In some cases it is useful to look at this to decide what needs to be done.
-
-   MODE and WIN are passed so that this macro can use
-   GO_IF_LEGITIMATE_ADDRESS.
-
-   It is always safe for this macro to do nothing.  It exists to recognize
-   opportunities to optimize the output.
-
-   For the ns32k, we do nothing */
-
-#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)   {}
-
 /* Nonzero if the constant value X is a legitimate general operand
    when generating PIC code.  It is given that flag_pic is on and
    that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
Index: config/pdp11/pdp11.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pdp11/pdp11.h,v
retrieving revision 1.58
diff -u -r1.58 pdp11.h
--- config/pdp11/pdp11.h	19 Feb 2004 10:57:01 -0000	1.58
+++ config/pdp11/pdp11.h	7 Mar 2004 17:42:33 -0000
@@ -846,22 +846,6 @@
 }
 
 
-/* Try machine-dependent ways of modifying an illegitimate address
-   to be legitimate.  If we find one, return the new, valid address.
-   This macro is used in only one place: `memory_address' in explow.c.
-
-   OLDX is the address as it was before break_out_memory_refs was called.
-   In some cases it is useful to look at this to decide what needs to be done.
-
-   MODE and WIN are passed so that this macro can use
-   GO_IF_LEGITIMATE_ADDRESS.
-
-   It is always safe for this macro to do nothing.  It exists to recognize
-   opportunities to optimize the output.  */
-
-#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)	{}
-
-
 /* 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 */
Index: config/stormy16/stormy16.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.h,v
retrieving revision 1.86
diff -u -r1.86 stormy16.h
--- config/stormy16/stormy16.h	6 Feb 2004 06:18:35 -0000	1.86
+++ config/stormy16/stormy16.h	7 Mar 2004 17:42:35 -0000
@@ -594,8 +594,6 @@
 
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
-
 /* On this chip, this is true if the address is valid with an offset
    of 0 but not of 6, because in that case it cannot be used as an
    address for DImode or DFmode, or if the address is a post-increment
Index: config/v850/v850.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.h,v
retrieving revision 1.94
diff -u -r1.94 v850.h
--- config/v850/v850.h	6 Feb 2004 06:18:35 -0000	1.94
+++ config/v850/v850.h	7 Mar 2004 17:42:38 -0000
@@ -976,21 +976,6 @@
 } while (0)
 
 
-/* Try machine-dependent ways of modifying an illegitimate address
-   to be legitimate.  If we find one, return the new, valid address.
-   This macro is used in only one place: `memory_address' in explow.c.
-
-   OLDX is the address as it was before break_out_memory_refs was called.
-   In some cases it is useful to look at this to decide what needs to be done.
-
-   MODE and WIN are passed so that this macro can use
-   GO_IF_LEGITIMATE_ADDRESS.
-
-   It is always safe for this macro to do nothing.  It exists to recognize
-   opportunities to optimize the output.  */
-
-#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)  {}
-
 /* Go to LABEL if ADDR (a legitimate address expression)
    has an effect that depends on the machine mode it is used for.  */
 
Index: config/vax/vax.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax.h,v
retrieving revision 1.67
diff -u -r1.67 vax.h
--- config/vax/vax.h	6 Mar 2004 21:14:50 -0000	1.67
+++ config/vax/vax.h	7 Mar 2004 17:42:40 -0000
@@ -758,23 +758,6 @@
 	    goto ADDR;							\
 	  GO_IF_REG_PLUS_INDEX (XEXP (X, 0), MODE, ADDR); } } }
 
-/* Try machine-dependent ways of modifying an illegitimate address
-   to be legitimate.  If we find one, return the new, valid address.
-   This macro is used in only one place: `memory_address' in explow.c.
-
-   OLDX is the address as it was before break_out_memory_refs was called.
-   In some cases it is useful to look at this to decide what needs to be done.
-
-   MODE and WIN are passed so that this macro can use
-   GO_IF_LEGITIMATE_ADDRESS.
-
-   It is always safe for this macro to do nothing.  It exists to recognize
-   opportunities to optimize the output.
-
-   For the VAX, nothing needs to be done.  */
-
-#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)  {}
-
 /* Go to LABEL if ADDR (a legitimate address expression)
    has an effect that depends on the machine mode it is used for.
    On the VAX, the predecrement and postincrement address depend thus
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.310
diff -u -r1.310 tm.texi
--- doc/tm.texi	5 Mar 2004 23:51:25 -0000	1.310
+++ doc/tm.texi	7 Mar 2004 17:43:04 -0000
@@ -4914,7 +4914,7 @@
 
 It is not necessary for this macro to come up with a legitimate
 address.  The compiler has standard ways of doing so in all cases.  In
-fact, it is safe for this macro to do nothing.  But often a
+fact, it is safe to omit this macro.  But often a
 machine-dependent strategy can generate better code.
 @end defmac
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]