[RS6000] Hookize GO_IF_MODE_DEPENDENT_ADDRESS
Anatoly Sokolov
aesok@post.ru
Mon May 17 18:45:00 GMT 2010
Hi.
This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macro from the
RS6000 back end in the GCC and introduces equivalent
TARGET_MODE_DEPENDENT_ADDRESS_P target hook.
Regression tested on powerpc64-unknown-linux-gnu. OK to install?
* config/rs6000/rs6000.c (rs6000_mode_dependent_address_p): New.
(TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
(rs6000_mode_dependent_address_ptr): Make static.
* config/rs6000/rs6000.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
* config/rs6000/rs6000-protos.h (rs6000_mode_dependent_address_ptr):
Remove.
Index: gcc/config/rs6000/rs6000-protos.h
===================================================================
--- gcc/config/rs6000/rs6000-protos.h (revision 159505)
+++ gcc/config/rs6000/rs6000-protos.h (working copy)
@@ -119,7 +119,6 @@
extern rtx (*rs6000_legitimize_reload_address_ptr) (rtx, enum machine_mode,
int, int, int, int *);
extern bool rs6000_legitimate_offset_address_p (enum machine_mode, rtx, int);
-extern bool (*rs6000_mode_dependent_address_ptr) (const_rtx);
extern rtx rs6000_find_base_term (rtx);
extern bool rs6000_offsettable_memref_p (rtx);
extern rtx rs6000_return_addr (int, rtx);
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 159505)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -1119,9 +1119,10 @@
int, int *)
= rs6000_legitimize_reload_address;
+static bool rs6000_mode_dependent_address_p (const_rtx);
static bool rs6000_mode_dependent_address (const_rtx);
static bool rs6000_debug_mode_dependent_address (const_rtx);
-bool (*rs6000_mode_dependent_address_ptr) (const_rtx)
+static bool (*rs6000_mode_dependent_address_ptr) (const_rtx)
= rs6000_mode_dependent_address;
static enum reg_class rs6000_secondary_reload_class (enum reg_class,
@@ -1543,6 +1544,9 @@
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P rs6000_legitimate_address_p
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P rs6000_mode_dependent_address_p
+
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE rs6000_can_eliminate
@@ -5885,6 +5889,14 @@
return ret;
}
+/* Implement TARGET_MODE_DEPENDENT_ADDRESS_P. */
+
+static bool
+rs6000_mode_dependent_address_p (const_rtx addr)
+{
+ return rs6000_mode_dependent_address_ptr (addr);
+}
+
/* Go to LABEL if ADDR (a legitimate address expression)
has an effect that depends on the machine mode it is used for.
Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h (revision 159505)
+++ gcc/config/rs6000/rs6000.h (working copy)
@@ -1892,15 +1892,6 @@
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) \
-do { \
- if (rs6000_mode_dependent_address_ptr (ADDR)) \
- goto LABEL; \
-} while (0)
-
#define FIND_BASE_TERM rs6000_find_base_term
/* The register number of the register used to address a table of
Anatoly.
More information about the Gcc-patches
mailing list