Patchwork [RX] Hookize GO_IF_MODE_DEPENDENT_ADDRESS

login
register
mail settings
Submitter Anatoly Sokolov
Date Feb. 12, 2011, 1:09 p.m.
Message ID <1163602248.20110212160910@post.ru>
Download mbox | patch
Permalink /patch/82903/
State New
Headers show

Comments

Anatoly Sokolov - Feb. 12, 2011, 1:09 p.m.
Hi.

  This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macro from the RX
back end in the GCC and introduces equivalent TARGET_MODE_DEPENDENT_ADDRESS_P
target hook.

  Regression tested on rx-unknown-elf.

  OK to install?

        * config/rx/rx.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
        * config/rx/rx-protos.h (rx_is_mode_dependent_addr): Remove.
        * config/xtensa/xtensa.c (rx_is_mode_dependent_addr): Rename to...
        (rx_mode_dependent_address_p): ...this. Make static. Change argument
        type to const_rtx.
        (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.



Anatoly.
Nick Clifton - Feb. 14, 2011, 11:05 a.m.
Hi Anatoly,

>          * config/rx/rx.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
>          * config/rx/rx-protos.h (rx_is_mode_dependent_addr): Remove.
>          * config/xtensa/xtensa.c (rx_is_mode_dependent_addr): Rename to...
>          (rx_mode_dependent_address_p): ...this. Make static. Change argument
>          type to const_rtx.
>          (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.

Approved - please apply.

Cheers
   Nick

Patch

Index: gcc/config/rx/rx.h
===================================================================
--- gcc/config/rx/rx.h  (revision 169933)
+++ gcc/config/rx/rx.h  (working copy)
@@ -288,14 +288,6 @@ 
     ( (REG_P (X)                                               \
        || (GET_CODE (X) == SUBREG                              \
           && REG_P (SUBREG_REG (X))))))
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)      \
-  do                                                   \
-    {                                                  \
-      if (rx_is_mode_dependent_addr (ADDR))            \
-        goto LABEL;                                    \
-    }                                                  \
-  while (0)
 
 
 #define RETURN_ADDR_RTX(COUNT, FRAMEADDR)                              \
Index: gcc/config/rx/rx-protos.h
===================================================================
--- gcc/config/rx/rx-protos.h   (revision 169933)
+++ gcc/config/rx/rx-protos.h   (working copy)
@@ -35,7 +35,6 @@ 
 extern void            rx_expand_epilogue (bool);
 extern char *          rx_gen_move_template (rtx *, bool);
 extern bool            rx_is_legitimate_constant (rtx);
-extern bool            rx_is_mode_dependent_addr (rtx);
 extern bool            rx_is_restricted_memory_address (rtx, Mmode);
 extern void            rx_notice_update_cc (rtx body, rtx insn);
 extern void            rx_split_cbranch (Mmode, Rcode, rtx, rtx, rtx);
Index: gcc/config/rx/rx.c
===================================================================
--- gcc/config/rx/rx.c  (revision 169933)
+++ gcc/config/rx/rx.c  (working copy)
@@ -199,8 +199,10 @@ 
     }
 }
 
-bool
-rx_is_mode_dependent_addr (rtx addr)
+/* Implement TARGET_MODE_DEPENDENT_ADDRESS_P.  */
+
+static bool
+rx_mode_dependent_address_p (const_rtx addr)
 {
   if (GET_CODE (addr) == CONST)
     addr = XEXP (addr, 0);
@@ -2771,6 +2773,9 @@ 
 #undef  TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P            rx_is_legitimate_address
 
+#undef  TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P                rx_mode_dependent_address_p
+
 #undef  TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
 #define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS   rx_allocate_stack_slots_for_args