aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2009-09-22 08:15:50 -0700
committerRichard Henderson <rth@gcc.gnu.org>2009-09-22 08:15:50 -0700
commit994322ef6e022b027d31796f6ed702a24dbe8167 (patch)
treebda26e7671eccb9b885733483c8f3cf14749b75e
parent2f5bb28c29df500fae2b5897ca3521a27295b27d (diff)
downloadgcc-994322ef6e022b027d31796f6ed702a24dbe8167.zip
gcc-994322ef6e022b027d31796f6ed702a24dbe8167.tar.gz
gcc-994322ef6e022b027d31796f6ed702a24dbe8167.tar.bz2
sh-protos.h (sh_initialize_trampoline): Remove.
* config/sh/sh-protos.h (sh_initialize_trampoline): Remove. * config/sh/sh.c (TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. (sh_trampoline_init): Rename from sh_initialize_trampoline; make static; adjust for target hook parameters. (sh_trampoline_adjust_address): New. * config/sh/sh.h (INITIALIZE_TRAMPOLINE): New. (TRAMPOLINE_ADJUST_ADDRESS): Move code to sh_trampoline_adjust_address. From-SVN: r152011
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/sh/sh-protos.h1
-rw-r--r--gcc/config/sh/sh.c26
-rw-r--r--gcc/config/sh/sh.h17
4 files changed, 31 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7fe7d9e..3954cf8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -244,6 +244,15 @@
adjust for target hook.
* config/score/score3.h, config/score/score7.h: Update.
+ * config/sh/sh-protos.h (sh_initialize_trampoline): Remove.
+ * config/sh/sh.c (TARGET_TRAMPOLINE_INIT): New.
+ (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New.
+ (sh_trampoline_init): Rename from sh_initialize_trampoline;
+ make static; adjust for target hook parameters.
+ (sh_trampoline_adjust_address): New.
+ * config/sh/sh.h (INITIALIZE_TRAMPOLINE): New.
+ (TRAMPOLINE_ADJUST_ADDRESS): Move code to sh_trampoline_adjust_address.
+
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/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 35cd730..f61c5d5 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -142,7 +142,6 @@ extern int sh_cfun_interrupt_handler_p (void);
extern int sh_cfun_resbank_handler_p (void);
extern int sh_attr_renesas_p (const_tree);
extern int sh_cfun_attr_renesas_p (void);
-extern void sh_initialize_trampoline (rtx, rtx, rtx);
extern bool sh_cannot_change_mode_class
(enum machine_mode, enum machine_mode, enum reg_class);
extern void sh_mark_label (rtx, int);
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index d0f9932..df03c14 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -272,6 +272,8 @@ static bool sh_scalar_mode_supported_p (enum machine_mode);
static int sh_dwarf_calling_convention (const_tree);
static void sh_encode_section_info (tree, rtx, int);
static int sh2a_function_vector_p (tree);
+static void sh_trampoline_init (rtx, tree, rtx);
+static rtx sh_trampoline_adjust_address (rtx);
static const struct attribute_spec sh_attribute_table[] =
{
@@ -511,6 +513,11 @@ static const struct attribute_spec sh_attribute_table[] =
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P sh_legitimate_address_p
+#undef TARGET_TRAMPOLINE_INIT
+#define TARGET_TRAMPOLINE_INIT sh_trampoline_init
+#undef TARGET_TRAMPOLINE_ADJUST_ADDRESS
+#define TARGET_TRAMPOLINE_ADJUST_ADDRESS sh_trampoline_adjust_address
+
/* Machine-specific symbol_ref flags. */
#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
@@ -10327,10 +10334,11 @@ sh_ms_bitfield_layout_p (const_tree record_type ATTRIBUTE_UNUSED)
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
-void
-sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
+static void
+sh_trampoline_init (rtx tramp_mem, tree fndecl, rtx cxt)
{
- rtx tramp_mem = gen_frame_mem (BLKmode, tramp);
+ rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
+ rtx tramp = force_reg (Pmode, XEXP (tramp_mem, 0));
if (TARGET_SHMEDIA64)
{
@@ -10421,7 +10429,6 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
rtx ptabs = force_reg (DImode, GEN_INT (0x6bf10600));
rtx blink = force_reg (DImode, GEN_INT (0x4401fff0));
- tramp = force_reg (Pmode, tramp);
fnaddr = force_reg (SImode, fnaddr);
cxt = force_reg (SImode, cxt);
emit_insn (gen_mshflo_w_x (gen_rtx_SUBREG (V4HImode, quad0, 0),
@@ -10477,6 +10484,17 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
}
}
+/* On SH5, trampolines are SHmedia code, so add 1 to the address. */
+
+static rtx
+sh_trampoline_adjust_address (rtx tramp)
+{
+ if (TARGET_SHMEDIA)
+ tramp = expand_simple_binop (Pmode, PLUS, tramp, const1_rtx,
+ gen_reg_rtx (Pmode), 0, OPTAB_LIB_WIDEN);
+ return tramp;
+}
+
/* FIXME: This is overly conservative. A SHcompact function that
receives arguments ``by reference'' will have them stored in its
own stack frame, so it must not pass pointers or references to
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 9b3d99f..c24555f 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1829,23 +1829,6 @@ struct sh_args {
((CACHE_LOG < 3 || (TARGET_SMALLCODE && ! TARGET_HARVARD)) ? 32 \
: TARGET_SHMEDIA ? 256 : 64)
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
- sh_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
-
-/* On SH5, trampolines are SHmedia code, so add 1 to the address. */
-
-#define TRAMPOLINE_ADJUST_ADDRESS(TRAMP) do \
-{ \
- if (TARGET_SHMEDIA) \
- (TRAMP) = expand_simple_binop (Pmode, PLUS, (TRAMP), const1_rtx, \
- gen_reg_rtx (Pmode), 0, \
- OPTAB_LIB_WIDEN); \
-} while (0)
-
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame.
FRAMEADDR is already the frame pointer of the COUNT frame, so we