* config/m68hc11/m68hc11.c (TARGET_TRAMPOLINE_INIT): New.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Sep 2009 15:13:36 +0000 (15:13 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Sep 2009 15:13:36 +0000 (15:13 +0000)
(m68hc11_trampoline_init): Rename from m68hc11_initialize_trampoline;
make static; update for hook parameters.
* config/m68hc11/m68hc11-protos.h: Update.
* config/m68hc11/m68hc11.h (INITIALIZE_TRAMPOLINE): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151998 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68hc11/m68hc11-protos.h
gcc/config/m68hc11/m68hc11.c
gcc/config/m68hc11/m68hc11.h

index a8e0a1d..61bb869 100644 (file)
        * config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Move code to
        m32r_trampoline_init.
 
+       * config/m68hc11/m68hc11.c (TARGET_TRAMPOLINE_INIT): New.
+       (m68hc11_trampoline_init): Rename from m68hc11_initialize_trampoline;
+       make static; update for hook parameters.
+       * config/m68hc11/m68hc11-protos.h: Update.
+       * config/m68hc11/m68hc11.h (INITIALIZE_TRAMPOLINE): Remove.
+
 2009-09-22  Jakub Jelinek  <jakub@redhat.com>
 
        * config/rs6000/rs6000.c (bdesc_2arg): Fix CODE_FOR_vector_gt* codes
index e4f8ba7..59154fa 100644 (file)
@@ -43,8 +43,6 @@ extern void m68hc11_function_arg_advance (CUMULATIVE_ARGS*,
 #ifdef RTX_CODE
 extern int m68hc11_auto_inc_p (rtx);
 
-extern void m68hc11_initialize_trampoline (rtx, rtx, rtx);
-
 extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx);
 extern enum reg_class preferred_reload_class (rtx, enum reg_class);
 
index d30b84c..5f8011c 100644 (file)
@@ -92,6 +92,7 @@ static void m68hc11_init_libfuncs (void);
 static rtx m68hc11_struct_value_rtx (tree, int);
 static bool m68hc11_return_in_memory (const_tree, const_tree);
 static bool m68hc11_can_eliminate (const int, const int);
+static void m68hc11_trampoline_init (rtx, tree, rtx);
 
 /* Must be set to 1 to produce debug messages.  */
 int debug_m6811 = 0;
@@ -282,6 +283,9 @@ static const struct attribute_spec m68hc11_attribute_table[] =
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE m68hc11_can_eliminate
 
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT m68hc11_trampoline_init
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 int
@@ -1072,39 +1076,49 @@ symbolic_memory_operand (rtx op, enum machine_mode mode)
    jmp FNADDR
 
 */
-void
-m68hc11_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+m68hc11_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
 {
   const char *static_chain_reg = reg_names[STATIC_CHAIN_REGNUM];
+  rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+  rtx mem;
 
   /* Skip the '*'.  */
   if (*static_chain_reg == '*')
     static_chain_reg++;
   if (TARGET_M6811)
     {
-      emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x18ce));
-      emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
-      emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
-                      GEN_INT (0x18df));
-      emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
+      mem = adjust_address (m_tramp, HImode, 0);
+      emit_move_insn (mem, GEN_INT (0x18ce));
+      mem = adjust_address (m_tramp, HImode, 2);
+      emit_move_insn (mem, cxt);
+      mem = adjust_address (m_tramp, HImode, 4);
+      emit_move_insn (mem, GEN_INT (0x18df));
+      mem = adjust_address (m_tramp, QImode, 6);
+      emit_move_insn (mem,
                       gen_rtx_CONST (QImode,
                                      gen_rtx_SYMBOL_REF (Pmode,
                                                          static_chain_reg)));
-      emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 7)),
-                      GEN_INT (0x7e));
-      emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 8)), fnaddr);
+      mem = adjust_address (m_tramp, QImode, 7);
+      emit_move_insn (mem, GEN_INT (0x7e));
+      mem = adjust_address (m_tramp, HImode, 8);
+      emit_move_insn (mem, fnaddr);
     }
   else
     {
-      emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x1803));
-      emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
-      emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
+      mem = adjust_address (m_tramp, HImode, 0);
+      emit_move_insn (mem, GEN_INT (0x1803));
+      mem = adjust_address (m_tramp, HImode, 2);
+      emit_move_insn (mem, cxt);
+      mem = adjust_address (m_tramp, HImode, 4);
+      emit_move_insn (mem,
                       gen_rtx_CONST (HImode,
                                      gen_rtx_SYMBOL_REF (Pmode,
                                                          static_chain_reg)));
-      emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
-                      GEN_INT (0x06));
-      emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 7)), fnaddr);
+      mem = adjust_address (m_tramp, QImode, 6);
+      emit_move_insn (mem, GEN_INT (0x06));
+      mem = adjust_address (m_tramp, HImode, 7);
+      emit_move_insn (mem, fnaddr);
     }
 }
 \f
index 9b19c33..ee0f9f6 100644 (file)
@@ -1005,17 +1005,10 @@ typedef struct m68hc11_args
    for profiling a function entry.  */
 #define FUNCTION_PROFILER(FILE, LABELNO)               \
     fprintf (FILE, "\tldy\t.LP%d\n\tjsr mcount\n", (LABELNO))
+
 /* Length in units of the trampoline for entering a nested function.  */
 #define TRAMPOLINE_SIZE                (TARGET_M6811 ? 11 : 9)
 
-/* A C statement to initialize the variable parts of a trampoline.
-   ADDR is an RTX for the address of the trampoline; FNADDR is an
-   RTX for the address of the nested function; STATIC_CHAIN is an
-   RTX for the static chain value that should be passed to the
-   function when it is called.  */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
-  m68hc11_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
-
 \f
 /* Addressing modes, and classification of registers for them.  */