diff options
author | Richard Henderson <rth@redhat.com> | 2009-09-22 08:13:36 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2009-09-22 08:13:36 -0700 |
commit | 0d7e5af167ecba1bee5a74f163e42754de5af980 (patch) | |
tree | 83f22f3a6f4d6f8701d6effbd999b39ec4562b37 | |
parent | 1548bf05145ddec6edf90ae59aecae1c39274bc7 (diff) | |
download | gcc-0d7e5af167ecba1bee5a74f163e42754de5af980.zip gcc-0d7e5af167ecba1bee5a74f163e42754de5af980.tar.gz gcc-0d7e5af167ecba1bee5a74f163e42754de5af980.tar.bz2 |
m68hc11.c (TARGET_TRAMPOLINE_INIT): New.
* 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.
From-SVN: r151998
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/m68hc11/m68hc11-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/m68hc11/m68hc11.c | 46 | ||||
-rw-r--r-- | gcc/config/m68hc11/m68hc11.h | 9 |
4 files changed, 37 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8e0a1d..61bb869 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -135,6 +135,12 @@ * 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 diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h index e4f8ba7..59154fa 100644 --- a/gcc/config/m68hc11/m68hc11-protos.h +++ b/gcc/config/m68hc11/m68hc11-protos.h @@ -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); diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index d30b84c..5f8011c 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -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; 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); } } diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h index 9b19c33..ee0f9f6 100644 --- a/gcc/config/m68hc11/m68hc11.h +++ b/gcc/config/m68hc11/m68hc11.h @@ -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)) - /* Addressing modes, and classification of registers for them. */ |