Patchwork [RS6000] Hookize OUTPUT_ADDR_CONST_EXTRA macro

login
register
mail settings
Submitter Anatoly Sokolov
Date Sept. 20, 2010, 5:01 p.m.
Message ID <115053391.20100920210135@post.ru>
Download mbox | patch
Permalink /patch/65226/
State New
Headers show

Comments

Anatoly Sokolov - Sept. 20, 2010, 5:01 p.m.
Hi.

  This patch removes obsolete OUTPUT_ADDR_CONST_EXTRA macro from the RS6000 
back end in the GCC and introduces equivalent TARGET_OUTPUT_ADDR_CONST_EXTRA 
target hook.

  Regression tested on powerpc64-unknown-linux-gnu.

  OK to install?

        * config/rs6000/rs6000.h (OUTPUT_ADDR_CONST_EXTRA): Remove macros.
        * config/rs6000/rs6000-protos.h (rs6000_output_addr_const_extra):
        Remove.
        * config/rs6000/rs6000.c (rs6000_output_addr_const_extra): Make
        static.
        (TTARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define.




Anatoly.
David Edelsohn - Sept. 21, 2010, 5:11 p.m.
2010/9/20 Anatoly Sokolov <aesok@post.ru>:
>  Hi.
>
>  This patch removes obsolete OUTPUT_ADDR_CONST_EXTRA macro from the RS6000
> back end in the GCC and introduces equivalent TARGET_OUTPUT_ADDR_CONST_EXTRA
> target hook.
>
>  Regression tested on powerpc64-unknown-linux-gnu.
>
>  OK to install?
>
>        * config/rs6000/rs6000.h (OUTPUT_ADDR_CONST_EXTRA): Remove macros.
>        * config/rs6000/rs6000-protos.h (rs6000_output_addr_const_extra):
>        Remove.
>        * config/rs6000/rs6000.c (rs6000_output_addr_const_extra): Make
>        static.
>        (TTARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define.

Okay.

Thanks, David

Patch

Index: gcc/config/rs6000/rs6000-protos.h
===================================================================
--- gcc/config/rs6000/rs6000-protos.h   (revision 164410)
+++ gcc/config/rs6000/rs6000-protos.h   (working copy)
@@ -87,7 +87,6 @@ 
 extern void rs6000_output_function_entry (FILE *, const char *);
 extern void print_operand (FILE *, rtx, int);
 extern void print_operand_address (FILE *, rtx);
-extern bool rs6000_output_addr_const_extra (FILE *, rtx);
 extern enum rtx_code rs6000_reverse_condition (enum machine_mode,
                                               enum rtx_code);
 extern void rs6000_emit_sISEL (enum machine_mode, rtx[]);
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c  (revision 164410)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -996,6 +996,7 @@ 
 static tree rs6000_builtin_vectorized_function (tree, tree, tree);
 static int rs6000_savres_strategy (rs6000_stack_t *, bool, int, int);
 static void rs6000_restore_saved_cr (rtx, int);
+static bool rs6000_output_addr_const_extra (FILE *, rtx);
 static void rs6000_output_function_prologue (FILE *, HOST_WIDE_INT);
 static void rs6000_output_function_epilogue (FILE *, HOST_WIDE_INT);
 static void rs6000_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,
@@ -1432,6 +1433,9 @@ 
 #undef TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE rs6000_output_function_epilogue
 
+#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
+#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA rs6000_output_addr_const_extra
+
 #undef TARGET_LEGITIMIZE_ADDRESS
 #define TARGET_LEGITIMIZE_ADDRESS rs6000_legitimize_address
 
@@ -16026,9 +16030,9 @@ 
     gcc_unreachable ();
 }
 
-/* Implement OUTPUT_ADDR_CONST_EXTRA for address X.  */
+/* Implement TARGET_OUTPUT_ADDR_CONST_EXTRA.  */
 
-bool
+static bool
 rs6000_output_addr_const_extra (FILE *file, rtx x)
 {
   if (GET_CODE (x) == UNSPEC)
Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h  (revision 164410)
+++ gcc/config/rs6000/rs6000.h  (working copy)
@@ -2411,12 +2411,6 @@ 
 
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
 
-#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL)               \
-  do                                                           \
-    if (!rs6000_output_addr_const_extra (STREAM, X))           \
-      goto FAIL;                                               \
-  while (0)
-
 /* uncomment for disabling the corresponding default options */
 /* #define  MACHINE_no_sched_interblock */
 /* #define  MACHINE_no_sched_speculative */