aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-10-20 15:37:14 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-10-20 15:37:14 -0700
commitc590b62588c84c4f0b7770a9e5c6f3216a87dce7 (patch)
treeabe4a377f5765b9d4daf391afe9b62b6a6f5af4f
parent16f7d029b9501a8dce95d7a4cc00e54f687ddf59 (diff)
downloadgcc-c590b62588c84c4f0b7770a9e5c6f3216a87dce7.zip
gcc-c590b62588c84c4f0b7770a9e5c6f3216a87dce7.tar.gz
gcc-c590b62588c84c4f0b7770a9e5c6f3216a87dce7.tar.bz2
target.h (struct gcc_target): Line wrap.
* target.h (struct gcc_target): Line wrap. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Static. (TARGET_ASM_OUTPUT_MI_THUNK): Define here... * config/alpha/alpha.h: ... not here. * config/alpha/alpha-protos.h: Update. * config/arm/arm.c, config/arm/arm.h, config/arm/arm-protos.h config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/frv/frv-protos.h, config/frv/frv.c, config/frv/frv.h, config/i386/i386-protos.h, config/i386/i386.c, config/i386/openbsd.h, config/i386/unix.h, config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m68k/linux.h, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/m68k/netbsd-elf.h, config/m68k/openbsd.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/pa/pa-protos.h, config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/sparc/openbsd.h, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Similarly. * config/m68k/m68k.c (m68k_output_mi_thunk): Replicate mnemonic selection logic from call patterns. From-SVN: r58340
-rw-r--r--gcc/ChangeLog28
-rw-r--r--gcc/config/alpha/alpha-protos.h1
-rw-r--r--gcc/config/alpha/alpha.c16
-rw-r--r--gcc/config/alpha/alpha.h4
-rw-r--r--gcc/config/arm/arm-protos.h1
-rw-r--r--gcc/config/arm/arm.c10
-rw-r--r--gcc/config/arm/arm.h4
-rw-r--r--gcc/config/cris/cris-protos.h6
-rw-r--r--gcc/config/cris/cris.c9
-rw-r--r--gcc/config/cris/cris.h3
-rw-r--r--gcc/config/d30v/d30v.h31
-rw-r--r--gcc/config/frv/frv-protos.h5
-rw-r--r--gcc/config/frv/frv.c6
-rw-r--r--gcc/config/frv/frv.h32
-rw-r--r--gcc/config/i386/i386-protos.h2
-rw-r--r--gcc/config/i386/i386.c12
-rw-r--r--gcc/config/i386/openbsd.h3
-rw-r--r--gcc/config/i386/unix.h5
-rw-r--r--gcc/config/i960/i960-protos.h1
-rw-r--r--gcc/config/i960/i960.c6
-rw-r--r--gcc/config/i960/i960.h4
-rw-r--r--gcc/config/ia64/ia64-protos.h1
-rw-r--r--gcc/config/ia64/ia64.c7
-rw-r--r--gcc/config/ia64/ia64.h5
-rw-r--r--gcc/config/m68k/linux.h4
-rw-r--r--gcc/config/m68k/m68k-protos.h4
-rw-r--r--gcc/config/m68k/m68k.c77
-rw-r--r--gcc/config/m68k/netbsd-elf.h6
-rw-r--r--gcc/config/m68k/openbsd.h35
-rw-r--r--gcc/config/mmix/mmix-protos.h1
-rw-r--r--gcc/config/mmix/mmix.c7
-rw-r--r--gcc/config/mmix/mmix.h3
-rw-r--r--gcc/config/pa/pa-protos.h5
-rw-r--r--gcc/config/pa/pa.c10
-rw-r--r--gcc/config/pa/pa.h2
-rw-r--r--gcc/config/s390/s390-protos.h1
-rw-r--r--gcc/config/s390/s390.c6
-rw-r--r--gcc/config/s390/s390.h4
-rw-r--r--gcc/config/sparc/openbsd.h2
-rw-r--r--gcc/config/sparc/sparc-protos.h2
-rw-r--r--gcc/config/sparc/sparc.c6
-rw-r--r--gcc/config/sparc/sparc.h4
-rw-r--r--gcc/config/stormy16/stormy16-protos.h1
-rw-r--r--gcc/config/stormy16/stormy16.c7
-rw-r--r--gcc/config/stormy16/stormy16.h33
-rw-r--r--gcc/target.h6
46 files changed, 175 insertions, 253 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d9d062d..33e88b9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,31 @@
+2002-10-20 Richard Henderson <rth@redhat.com>
+
+ * target.h (struct gcc_target): Line wrap.
+
+ * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Static.
+ (TARGET_ASM_OUTPUT_MI_THUNK): Define here...
+ * config/alpha/alpha.h: ... not here.
+ * config/alpha/alpha-protos.h: Update.
+
+ * config/arm/arm.c, config/arm/arm.h, config/arm/arm-protos.h
+ config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h,
+ config/frv/frv-protos.h, config/frv/frv.c, config/frv/frv.h,
+ config/i386/i386-protos.h, config/i386/i386.c, config/i386/openbsd.h,
+ config/i386/unix.h, config/i960/i960-protos.h, config/i960/i960.c,
+ config/i960/i960.h, config/ia64/ia64-protos.h, config/ia64/ia64.c,
+ config/ia64/ia64.h, config/m68k/linux.h, config/m68k/m68k-protos.h,
+ config/m68k/m68k.c, config/m68k/netbsd-elf.h, config/m68k/openbsd.h,
+ config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h,
+ config/pa/pa-protos.h, config/pa/pa.c, config/pa/pa.h,
+ config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h,
+ config/sparc/openbsd.h, config/sparc/sparc-protos.h,
+ config/sparc/sparc.c, config/sparc/sparc.h,
+ config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c,
+ config/stormy16/stormy16.h: Similarly.
+
+ * config/m68k/m68k.c (m68k_output_mi_thunk): Replicate mnemonic
+ selection logic from call patterns.
+
2002-10-20 Mark Mitchell <mark@codesourcery.com>
* config/m68k/m68k.c (m68k_output_mi_thunk): Fix typo.
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index 92b6d55..71079ef 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -141,7 +141,6 @@ extern rtx function_arg PARAMS ((CUMULATIVE_ARGS, enum machine_mode,
tree, int));
extern void alpha_start_function PARAMS ((FILE *, const char *, tree));
extern void alpha_end_function PARAMS ((FILE *, const char *, tree));
-extern void alpha_output_mi_thunk_osf PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#ifdef REAL_VALUE_TYPE
extern int check_float_value PARAMS ((enum machine_mode,
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index b6bcc32..8f900af 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -195,6 +195,11 @@ static void alpha_write_linkage
PARAMS ((FILE *, const char *, tree));
#endif
+#if TARGET_ABI_OSF
+static void alpha_output_mi_thunk_osf
+ PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
+#endif
+
static struct machine_function * alpha_init_machine_status
PARAMS ((void));
@@ -292,6 +297,11 @@ static void unicosmk_unique_section PARAMS ((tree, int));
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN alpha_expand_builtin
+#if TARGET_ABI_OSF
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK alpha_output_mi_thunk_osf
+#endif
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Parse target option strings. */
@@ -7839,7 +7849,8 @@ alpha_end_function (file, fnname, decl)
}
}
-/* Emit a tail call to FUNCTION after adjusting THIS by DELTA.
+#if TARGET_ABI_OSF
+/* Emit a tail call to FUNCTION after adjusting THIS by DELTA.
In order to avoid the hordes of differences between generated code
with and without TARGET_EXPLICIT_RELOCS, and to avoid duplicating
@@ -7848,7 +7859,7 @@ alpha_end_function (file, fnname, decl)
Not sure why this idea hasn't been explored before... */
-void
+static void
alpha_output_mi_thunk_osf (file, thunk_fndecl, delta, function)
FILE *file;
tree thunk_fndecl ATTRIBUTE_UNUSED;
@@ -7908,6 +7919,7 @@ alpha_output_mi_thunk_osf (file, thunk_fndecl, delta, function)
final (insn, file, 1, 0);
final_end_function ();
}
+#endif /* TARGET_ABI_OSF */
/* Debugging support. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 461dc95..3997377 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -2138,7 +2138,3 @@ do { \
/* Generate calls to memcpy, etc., not bcopy, etc. */
#define TARGET_MEM_FUNCTIONS 1
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK alpha_output_mi_thunk_osf
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index d1fd43b..2055d14 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -194,7 +194,6 @@ extern int arm_dllexport_p PARAMS ((tree));
extern int arm_dllimport_p PARAMS ((tree));
extern void arm_mark_dllexport PARAMS ((tree));
extern void arm_mark_dllimport PARAMS ((tree));
-extern void arm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#endif
extern void arm_init_builtins PARAMS ((void));
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index fa046e1..70e0291 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -126,6 +126,8 @@ static void arm_encode_section_info PARAMS ((tree, int));
#ifdef AOF_ASSEMBLER
static void aof_globalize_label PARAMS ((FILE *, const char *));
#endif
+static void arm_output_mi_thunk PARAMS ((FILE *, tree,
+ HOST_WIDE_INT, tree));
#undef Hint
#undef Mmode
@@ -188,6 +190,9 @@ static void aof_globalize_label PARAMS ((FILE *, const char *));
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING arm_strip_name_encoding
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK arm_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Obstack for minipool constant handling. */
@@ -11131,7 +11136,10 @@ arm_encode_section_info (decl, first)
}
#endif /* !ARM_PE */
-void
+/* Output code to add DELTA to the first argument, and then jump
+ to FUNCTION. Used for C++ multiple inheritance. */
+
+static void
arm_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index b4f6e70..2f5ba3b 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -2695,10 +2695,6 @@ extern int making_const_table;
else \
THUMB_PRINT_OPERAND_ADDRESS (STREAM, X)
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK arm_output_mi_thunk
-
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame. */
diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h
index a86ae71..7da668ee 100644
--- a/gcc/config/cris/cris-protos.h
+++ b/gcc/config/cris/cris-protos.h
@@ -52,12 +52,6 @@ extern rtx cris_expand_builtin_va_arg PARAMS ((tree, tree));
# endif
#endif /* RTX_CODE */
-#ifdef STDIO_INCLUDED
-# ifdef TREE_CODE
-extern void cris_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
-# endif
-#endif
-
#ifdef GCC_C_PRAGMA_H
extern void cris_pragma_expand_mul PARAMS ((cpp_reader *));
#endif
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 4128742..3d33a72 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -101,6 +101,10 @@ static void cris_target_asm_function_epilogue
static void cris_encode_section_info PARAMS ((tree, int));
static void cris_operand_lossage PARAMS ((const char *, rtx));
+static void cris_asm_output_mi_thunk
+ PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
+
+
/* The function cris_target_asm_function_epilogue puts the last insn to
output here. It always fits; there won't be a symbol operand. Used in
delay_slots_for_epilogue and function_epilogue. */
@@ -153,6 +157,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO cris_encode_section_info
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK cris_asm_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Predicate functions. */
@@ -2572,7 +2579,7 @@ cris_override_options ()
/* The TARGET_ASM_OUTPUT_MI_THUNK worker. */
-void
+static void
cris_asm_output_mi_thunk (stream, thunkdecl, delta, funcdecl)
FILE *stream;
tree thunkdecl ATTRIBUTE_UNUSED;
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 717f249..4aa8846 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -1013,9 +1013,6 @@ struct cum_args {int regs;};
#define ELIGIBLE_FOR_EPILOGUE_DELAY(INSN, N) \
cris_eligible_for_epilogue_delay (INSN)
-#define TARGET_ASM_OUTPUT_MI_THUNK cris_asm_output_mi_thunk
-
-
/* Node: Profiling */
#define FUNCTION_PROFILER(FILE, LABELNO) \
diff --git a/gcc/config/d30v/d30v.h b/gcc/config/d30v/d30v.h
index 32cff3c..3c9bff6 100644
--- a/gcc/config/d30v/d30v.h
+++ b/gcc/config/d30v/d30v.h
@@ -1879,37 +1879,6 @@ typedef struct d30v_stack {
`DELAY_SLOTS_FOR_EPILOGUE'. */
/* #define ELIGIBLE_FOR_EPILOGUE_DELAY(INSN, N) */
-/* A C compound statement that outputs the assembler code for a thunk function,
- used to implement C++ virtual function calls with multiple inheritance. The
- thunk acts as a wrapper around a virtual function, adjusting the implicit
- object parameter before handing control off to the real function.
-
- First, emit code to add the integer DELTA to the location that contains the
- incoming first argument. Assume that this argument contains a pointer, and
- is the one used to pass the `this' pointer in C++. This is the incoming
- argument *before* the function prologue, e.g. `%o0' on a sparc. The
- addition must preserve the values of all other incoming arguments.
-
- After the addition, emit code to jump to FUNCTION, which is a
- `FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
- the return address. Hence returning from FUNCTION will return to whoever
- called the current `thunk'.
-
- The effect must be as if FUNCTION had been called directly with the
- adjusted first argument. This macro is responsible for emitting
- all of the code for a thunk function; output_function_prologue()
- and output_function_epilogue() are not invoked.
-
- The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
- extracted from it.) It might possibly be useful on some targets, but
- probably not.
-
- If you do not define this macro, the target-independent code in the C++
- frontend will generate a less efficient heavyweight thunk that calls
- FUNCTION instead of jumping to it. The generic approach does not support
- varargs. */
-/* #define TARGET_ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) */
-
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
typedef struct machine_function GTY(())
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h
index 5965c58..4f5a422 100644
--- a/gcc/config/frv/frv-protos.h
+++ b/gcc/config/frv/frv-protos.h
@@ -113,11 +113,6 @@ extern rtx frv_return_addr_rtx PARAMS ((int, rtx));
extern rtx frv_index_memory PARAMS ((rtx,
enum machine_mode,
int));
-
-#ifdef TREE_CODE
-extern void frv_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
-#endif /* TREE_CODE */
-
extern const char *frv_asm_output_opcode
PARAMS ((FILE *, const char *));
extern void frv_final_prescan_insn PARAMS ((rtx, rtx *, int));
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 39a1cd7..7ef2e1a 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -279,6 +279,7 @@ static void frv_encode_section_info PARAMS ((tree, int));
static void frv_init_builtins PARAMS ((void));
static rtx frv_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
static bool frv_in_small_data_p PARAMS ((tree));
+static void frv_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
/* Initialize the GCC target structure. */
#undef TARGET_ASM_FUNCTION_PROLOGUE
@@ -298,6 +299,9 @@ static bool frv_in_small_data_p PARAMS ((tree));
#undef TARGET_IN_SMALL_DATA_P
#define TARGET_IN_SMALL_DATA_P frv_in_small_data_p
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK frv_asm_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Given a SYMBOL_REF, return true if it points to small data. */
@@ -1866,7 +1870,7 @@ frv_expand_epilogue (sibcall_p)
FUNCTION instead of jumping to it. The generic approach does not support
varargs. */
-void
+static void
frv_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
FILE *file;
tree thunk_fndecl ATTRIBUTE_UNUSED;
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index f8c2755..954e86f 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -2068,38 +2068,6 @@ struct machine_function GTY(())
adjustment in a function that has no frame pointer, and the compiler knows
this regardless of `EXIT_IGNORE_STACK'. */
#define EXIT_IGNORE_STACK 1
-
-/* A C compound statement that outputs the assembler code for a thunk function,
- used to implement C++ virtual function calls with multiple inheritance. The
- thunk acts as a wrapper around a virtual function, adjusting the implicit
- object parameter before handing control off to the real function.
-
- First, emit code to add the integer DELTA to the location that contains the
- incoming first argument. Assume that this argument contains a pointer, and
- is the one used to pass the `this' pointer in C++. This is the incoming
- argument *before* the function prologue, e.g. `%o0' on a sparc. The
- addition must preserve the values of all other incoming arguments.
-
- After the addition, emit code to jump to FUNCTION, which is a
- `FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
- the return address. Hence returning from FUNCTION will return to whoever
- called the current `thunk'.
-
- The effect must be as if FUNCTION had been called directly with the adjusted
- first argument. This macro is responsible for emitting all of the code for
- a thunk function; `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' are not
- invoked.
-
- The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
- extracted from it.) It might possibly be useful on some targets, but
- probably not.
-
- If you do not define this macro, the target-independent code in the C++
- frontend will generate a less efficient heavyweight thunk that calls
- FUNCTION instead of jumping to it. The generic approach does not support
- varargs. */
-#define TARGET_ASM_OUTPUT_MI_THUNK frv_asm_output_mi_thunk
-
/* Generating Code for Profiling. */
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index b38a65a..df45f6a 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -211,8 +211,6 @@ extern tree ix86_handle_shared_attribute PARAMS ((tree *, tree, tree, int, bool
extern unsigned int i386_pe_section_type_flags PARAMS ((tree, const char *,
int));
extern void i386_pe_asm_named_section PARAMS ((const char *, unsigned int));
-extern void x86_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
-extern void x86_output_mi_vcall_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
extern int x86_field_alignment PARAMS ((tree, int));
#endif
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 0569fef..50ade5b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -751,6 +751,9 @@ static int ia32_use_dfa_pipeline_interface PARAMS ((void));
static int ia32_multipass_dfa_lookahead PARAMS ((void));
static void ix86_init_mmx_sse_builtins PARAMS ((void));
static rtx ia32_this_parameter PARAMS ((tree));
+static void x86_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
+static void x86_output_mi_vcall_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree));
struct ix86_address
{
@@ -897,6 +900,11 @@ static enum x86_64_reg_class merge_classes PARAMS ((enum x86_64_reg_class,
#define TARGET_HAVE_TLS true
#endif
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK x86_output_mi_thunk
+#undef TARGET_ASM_OUTPUT_MI_VCALL_THUNK
+#define TARGET_ASM_OUTPUT_MI_VCALL_THUNK x86_output_mi_vcall_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Sometimes certain combinations of command options do not make
@@ -13933,7 +13941,7 @@ ia32_this_parameter (function)
}
-void
+static void
x86_output_mi_vcall_thunk (file, thunk, delta, vcall_index, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
@@ -14037,7 +14045,7 @@ x86_output_mi_vcall_thunk (file, thunk, delta, vcall_index, function)
}
}
-void
+static void
x86_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk;
diff --git a/gcc/config/i386/openbsd.h b/gcc/config/i386/openbsd.h
index b792450..60f1657 100644
--- a/gcc/config/i386/openbsd.h
+++ b/gcc/config/i386/openbsd.h
@@ -96,9 +96,6 @@ Boston, MA 02111-1307, USA. */
#undef ASM_PREFERRED_EH_DATA_FORMAT
-
-/* Note that we pick up TARGET_ASM_OUTPUT_MI_THUNK from unix.h. */
-
#undef ASM_COMMENT_START
#define ASM_COMMENT_START ";#"
diff --git a/gcc/config/i386/unix.h b/gcc/config/i386/unix.h
index 09493b0..e69f26d 100644
--- a/gcc/config/i386/unix.h
+++ b/gcc/config/i386/unix.h
@@ -65,8 +65,3 @@ Boston, MA 02111-1307, USA. */
and returns float values in the 387. */
#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK x86_output_mi_thunk
-#define TARGET_ASM_OUTPUT_MI_VCALL_THUNK x86_output_mi_vcall_thunk
diff --git a/gcc/config/i960/i960-protos.h b/gcc/config/i960/i960-protos.h
index 594e07d..7e2685d 100644
--- a/gcc/config/i960/i960-protos.h
+++ b/gcc/config/i960/i960-protos.h
@@ -86,7 +86,6 @@ extern void i960_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, enum machine
extern tree i960_build_va_list PARAMS ((void));
extern int i960_final_reg_parm_stack_space PARAMS ((int, tree));
extern int i960_reg_parm_stack_space PARAMS ((tree));
-extern void i960_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#endif /* TREE_CODE */
extern int process_pragma PARAMS ((int(*)(void), void(*)(int), const char *));
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index 4071778..b15e27d 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -46,6 +46,7 @@ Boston, MA 02111-1307, USA. */
static void i960_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void i960_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void i960_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@@ -98,6 +99,9 @@ static int ret_label = 0;
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE i960_output_function_epilogue
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK i960_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Override conflicting target switch options.
@@ -2825,7 +2829,7 @@ i960_scan_opcode (p)
}
}
-void
+static void
i960_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index ac24ece..9af2964 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -1463,7 +1463,3 @@ extern enum insn_types i960_last_insn_type;
/* Defined in reload.c, and used in insn-recog.c. */
extern int rtx_equal_function_value_matters;
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK i960_output_mi_thunk
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index c4a43cc..36af17a 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -121,7 +121,6 @@ extern int ia64_function_arg_pass_by_reference PARAMS((CUMULATIVE_ARGS *,
tree, int));
extern int ia64_return_in_memory PARAMS((tree));
extern void ia64_asm_output_external PARAMS((FILE *, tree, const char *));
-extern void ia64_output_mi_thunk PARAMS((FILE *, tree, HOST_WIDE_INT, tree));
#endif /* TREE_CODE */
extern int ia64_register_move_cost PARAMS((enum machine_mode, enum reg_class,
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 2b74f43..17c3fc6 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -161,6 +161,8 @@ static int ia64_sched_reorder PARAMS ((FILE *, int, rtx *, int *, int));
static int ia64_sched_reorder2 PARAMS ((FILE *, int, rtx *, int *, int));
static int ia64_variable_issue PARAMS ((FILE *, int, rtx, int));
+static void ia64_output_mi_thunk PARAMS((FILE *, tree, HOST_WIDE_INT, tree));
+
static void ia64_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
static void ia64_aix_select_section PARAMS ((tree, int,
@@ -244,6 +246,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#define TARGET_HAVE_TLS true
#endif
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK ia64_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */
@@ -8159,7 +8164,7 @@ ia64_aix_select_rtx_section (mode, x, align)
flag_pic = save_pic;
}
-void
+static void
ia64_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index e0d5248..ed1bbac 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1428,11 +1428,6 @@ do { \
#define ASM_FILE_START(FILE) \
emit_safe_across_calls (FILE)
-/* A C compound statement that outputs the assembler code for a thunk function,
- used to implement C++ virtual function calls with multiple inheritance. */
-
-#define TARGET_ASM_OUTPUT_MI_THUNK ia64_output_mi_thunk
-
/* Output part N of a function descriptor for DECL. For ia64, both
words are emitted with a single relocation, so ignore N > 0. */
#define ASM_OUTPUT_FDESC(FILE, DECL, PART) \
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index ce2fbb0..bf80cea 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -354,7 +354,3 @@ do { \
: "d" (_beg), "d" (_len) \
: "%d0", "%d2", "%d3"); \
}
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK m68k_output_mi_thunk
diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h
index 3beec98..72120ea 100644
--- a/gcc/config/m68k/m68k-protos.h
+++ b/gcc/config/m68k/m68k-protos.h
@@ -64,10 +64,6 @@ extern int pcrel_address PARAMS ((rtx, enum machine_mode));
extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx));
#endif /* RTX_CODE */
-#ifdef TREE_CODE
-extern void m68k_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
-#endif /* TREE_CODE */
-
extern int flags_in_68881 PARAMS ((void));
extern int use_return_insn PARAMS ((void));
extern void override_options PARAMS ((void));
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 66c640c..9543e98 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -65,6 +65,7 @@ static void m68k_coff_asm_named_section PARAMS ((const char *, unsigned int));
#ifdef CTOR_LIST_BEGIN
static void m68k_svr3_asm_out_constructor PARAMS ((rtx, int));
#endif
+static void m68k_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
/* Alignment to use for loops and jumps */
@@ -122,6 +123,9 @@ int m68k_last_compare_had_fp_operands;
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m68k_output_function_epilogue
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK m68k_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Sometimes certain combinations of command options do not make
@@ -3836,34 +3840,67 @@ m68k_svr3_asm_out_constructor (symbol, priority)
}
#endif
-void
+static void
m68k_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
HOST_WIDE_INT delta;
tree function;
{
- if (delta > 0 && delta <= 8)
+ rtx xops[1];
+ const char *fmt;
+
+ if (delta > 0 && delta <= 8)
asm_fprintf (file, "\taddq.l %I%d,4(%Rsp)\n", (int) delta);
- else if (delta < 0 && delta >= -8)
+ else if (delta < 0 && delta >= -8)
asm_fprintf (file, "\tsubq.l %I%d,4(%Rsp)\n", (int) -delta);
- else
+ else
{
asm_fprintf (file, "\tadd.l %I");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);
- asm_fprintf (file, ",4(%Rsp)\n", delta);
- }
-
- if (flag_pic)
- {
- fprintf (file, "\tbra.l ");
- assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
- fprintf (file, "@PLTPC\n");
- }
- else
- {
- fprintf (file, "\tjmp ");
- assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
- fprintf (file, "\n");
- }
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);
+ asm_fprintf (file, ",4(%Rsp)\n");
+ }
+
+ xops[0] = DECL_RTL (function);
+
+ /* Logic taken from call patterns in m68k.md. */
+ if (flag_pic)
+ {
+ if (TARGET_PCREL)
+ fmt = "bra.l %o0";
+ else
+ {
+#ifdef MOTOROLA
+#ifdef HPUX_ASM
+ fmt = "bra.l %0";
+#else
+#ifdef USE_GAS
+ fmt = "bra.l %0@PLTPC";
+#else
+ fmt = "bra %0@PLTPC";
+#endif
+#endif
+#else
+#ifdef USE_GAS
+ fmt = "bra.l %0";
+#else
+ fmt = "jbra %0,a1";
+#endif
+#endif
+ }
+ }
+ else
+ {
+#if defined (MOTOROLA) && !defined (USE_GAS)
+#ifdef MOTOROLA_BSR
+ fmt = "bra %0";
+#else
+ fmt = "jmp %0";
+#endif
+#else
+ fmt = "jbra %0";
+#endif
+ }
+
+ output_asm_insn (fmt, xops);
}
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index 107bdeb..f9576da 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -421,12 +421,6 @@ while (0)
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-
-#define TARGET_ASM_OUTPUT_MI_THUNK m68k_output_mi_thunk
-
/* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts. */
diff --git a/gcc/config/m68k/openbsd.h b/gcc/config/m68k/openbsd.h
index 8d62bdd..0a5038c 100644
--- a/gcc/config/m68k/openbsd.h
+++ b/gcc/config/m68k/openbsd.h
@@ -84,38 +84,3 @@ Boston, MA 02111-1307, USA. */
dwarf unwind information. egcs doesn't try too hard to check internal
configuration files... */
#define DWARF2_UNWIND_INFO 0
-
-
-/* TODO: TARGET_ASM_OUTPUT_MI_THUNK is busted. I need to figure out
- what bra func@PLTPC means under linux, and find the corresponding
- construction for our gas/pic setup. */
-#if 0
-/* Taken from linux.h. Processor dependent optimized code to handle C++
- multiple inheritance vtable lookup. */
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-do { \
- if (DELTA > 0 && DELTA <= 8) \
- asm_fprintf (FILE, "\taddq.l %I%d,4(%Rsp)\n", DELTA); \
- else if (DELTA < 0 && DELTA >= -8) \
- asm_fprintf (FILE, "\tsubq.l %I%d,4(%Rsp)\n", -DELTA); \
- else \
- asm_fprintf (FILE, "\tadd.l %I%d,4(%Rsp)\n", DELTA); \
- \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tbra.l "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "@PLTPC\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tjmp "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "\n"); \
- } \
-} while (0)
-#endif
-
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index 0328df1..a6a4e3c 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -80,7 +80,6 @@ extern void mmix_asm_output_aligned_local
PARAMS ((FILE *, const char *, int, int));
extern void mmix_asm_declare_register_global
PARAMS ((FILE *, tree, int, const char *));
-extern void mmix_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
/* Need tree.h and rtl.h */
# ifdef RTX_CODE
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index e79e873..141ad2e 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -130,6 +130,8 @@ static void mmix_target_asm_function_prologue
static void mmix_target_asm_function_end_prologue PARAMS ((FILE *));
static void mmix_target_asm_function_epilogue
PARAMS ((FILE *, HOST_WIDE_INT));
+static void mmix_asm_output_mi_thunk
+ PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
/* Target structure macros. Listed by node. See `Using and Porting GCC'
@@ -162,6 +164,9 @@ static void mmix_target_asm_function_epilogue
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING mmix_strip_name_encoding
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK mmix_asm_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Functions that are expansions for target macros.
@@ -772,7 +777,7 @@ mmix_target_asm_function_epilogue (stream, locals_size)
/* TARGET_ASM_OUTPUT_MI_THUNK. */
-void
+static void
mmix_asm_output_mi_thunk (stream, fndecl, delta, func)
FILE * stream;
tree fndecl ATTRIBUTE_UNUSED;
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 8001f0a..05c0531 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -795,9 +795,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
#define EPILOGUE_USES(REGNO) \
((REGNO) == MMIX_INCOMING_RETURN_ADDRESS_REGNUM)
-#define TARGET_ASM_OUTPUT_MI_THUNK mmix_asm_output_mi_thunk
-
-
/* Node: Profiling */
#define FUNCTION_PROFILER(FILE, LABELNO) \
mmix_function_profiler (FILE, LABELNO)
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index bbdd689..ca115fb 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -126,9 +126,6 @@ extern int eq_neq_comparison_operator PARAMS ((rtx, enum machine_mode));
extern int insn_refs_are_delayed PARAMS ((rtx));
#endif /* RTX_CODE */
-/* Prototype function used in macro TARGET_ASM_OUTPUT_MI_THUNK. */
-extern void pa_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-
/* Prototype function used in macro CONST_OK_FOR_LETTER_P. */
extern int zdepi_cint_p PARAMS ((unsigned HOST_WIDE_INT));
@@ -163,6 +160,4 @@ extern rtx function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode,
extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
enum machine_mode,
tree, int));
-
-extern void pa_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#endif /* TREE_CODE */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 1aae00d..48f4a38 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -108,6 +108,7 @@ static void store_reg PARAMS ((int, int, int));
static void store_reg_modify PARAMS ((int, int, int));
static void load_reg PARAMS ((int, int, int));
static void set_reg_plus_d PARAMS ((int, int, int, int));
+static void pa_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void pa_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static int pa_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int pa_adjust_priority PARAMS ((rtx, int));
@@ -118,6 +119,8 @@ static void pa_encode_section_info PARAMS ((tree, int));
static const char *pa_strip_name_encoding PARAMS ((const char *));
static void pa_globalize_label PARAMS ((FILE *, const char *))
ATTRIBUTE_UNUSED;
+static void pa_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
+
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@@ -194,6 +197,9 @@ static size_t n_deferred_plabels = 0;
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING pa_strip_name_encoding
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK pa_asm_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
void
@@ -3148,7 +3154,7 @@ compute_frame_size (size, fregs_live)
to do a "save" insn. The decision about whether or not
to do this is made in regclass.c. */
-void
+static void
pa_output_function_prologue (file, size)
FILE *file;
HOST_WIDE_INT size ATTRIBUTE_UNUSED;
@@ -6549,7 +6555,7 @@ is_function_label_plus_const (op)
/* Output assembly code for a thunk to FUNCTION. */
-void
+static void
pa_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
FILE *file;
tree thunk_fndecl;
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 003838c..924571a 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -897,8 +897,6 @@ extern GTY(()) rtx hppa_compare_op0;
extern GTY(()) rtx hppa_compare_op1;
extern enum cmp_type hppa_branch_type;
-#define TARGET_ASM_OUTPUT_MI_THUNK pa_asm_output_mi_thunk
-
/* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than
as assembly via FUNCTION_PROFILER. Just output a local label.
We can't use the function label because the GAS SOM target can't
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index c85349d..09822bc 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -86,7 +86,6 @@ extern tree s390_build_va_list PARAMS ((void));
extern rtx s390_function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
extern void s390_va_start PARAMS ((tree, rtx));
extern rtx s390_va_arg PARAMS ((tree, tree));
-extern void s390_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#endif /* RTX_CODE */
#endif /* TREE_CODE */
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 4209127..1b046d3 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -54,6 +54,7 @@ static int s390_adjust_priority PARAMS ((rtx, int));
static void s390_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
static void s390_encode_section_info PARAMS ((tree, int));
+static void s390_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
@@ -80,6 +81,9 @@ static void s390_encode_section_info PARAMS ((tree, int));
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK s390_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
extern int reload_completed;
@@ -5583,7 +5587,7 @@ s390_encode_section_info (decl, first)
}
}
-void
+static void
s390_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index e767aeb..37c6ade 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -854,10 +854,6 @@ CUMULATIVE_ARGS;
#define EXIT_IGNORE_STACK 1
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK s390_output_mi_thunk
-
/* Addressing modes, and classification of registers for them. */
/* #define HAVE_POST_INCREMENT */
diff --git a/gcc/config/sparc/openbsd.h b/gcc/config/sparc/openbsd.h
index 1a53cd1..a4333df 100644
--- a/gcc/config/sparc/openbsd.h
+++ b/gcc/config/sparc/openbsd.h
@@ -63,5 +63,3 @@ Boston, MA 02111-1307, USA. */
#define DWARF2_UNWIND_INFO 0
#undef ASM_PREFERRED_EH_DATA_FORMAT
-
-/* Default sparc.h does already define TARGET_ASM_OUTPUT_MI_THUNK */
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index fc814a8..0aa6e58 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -123,6 +123,4 @@ extern int sparc_extra_constraint_check PARAMS ((rtx, int, int));
extern int sparc_rtx_costs PARAMS ((rtx, enum rtx_code, enum rtx_code));
#endif /* RTX_CODE */
-extern void sparc_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
-
#endif /* __SPARC_PROTOS_H__ */
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index e1a14c1..44fedc7 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -176,6 +176,7 @@ static void emit_soft_tfmode_cvt PARAMS ((enum rtx_code, rtx *));
static void emit_hard_tfmode_operation PARAMS ((enum rtx_code, rtx *));
static void sparc_encode_section_info PARAMS ((tree, int));
+static void sparc_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
/* Option handling. */
@@ -239,6 +240,9 @@ enum processor_type sparc_cpu;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO sparc_encode_section_info
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK sparc_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Validate and override various options, and do some machine dependent
@@ -8448,7 +8452,7 @@ sparc_encode_section_info (decl, first)
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
-void
+static void
sparc_output_mi_thunk (file, thunk_fndecl, delta, function)
FILE *file;
tree thunk_fndecl ATTRIBUTE_UNUSED;
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 8c3f70d..53cb875 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2867,10 +2867,6 @@ do { \
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define TARGET_ASM_OUTPUT_MI_THUNK sparc_output_mi_thunk
-
#define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
((CHAR) == '#' || (CHAR) == '*' || (CHAR) == '^' || (CHAR) == '(' || (CHAR) == '_')
diff --git a/gcc/config/stormy16/stormy16-protos.h b/gcc/config/stormy16/stormy16-protos.h
index 9f2ea2c..e957de1 100644
--- a/gcc/config/stormy16/stormy16-protos.h
+++ b/gcc/config/stormy16/stormy16-protos.h
@@ -45,7 +45,6 @@ extern void xstormy16_expand_builtin_va_start PARAMS ((tree, rtx));
extern rtx xstormy16_expand_builtin_va_arg PARAMS ((tree, tree));
extern void xstormy16_initialize_trampoline PARAMS ((rtx, rtx, rtx));
extern rtx xstormy16_function_value PARAMS ((tree, tree));
-extern void xstormy16_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
#endif
#ifdef RTX_CODE
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 58d7ae4..de0cc90 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -50,6 +50,8 @@ static rtx emit_addhi3_postreload PARAMS ((rtx, rtx, rtx));
static void xstormy16_asm_out_constructor PARAMS ((rtx, int));
static void xstormy16_asm_out_destructor PARAMS ((rtx, int));
static void xstormy16_encode_section_info PARAMS ((tree, int));
+static void xstormy16_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
+ tree));
/* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. */
@@ -1380,7 +1382,7 @@ xstormy16_function_value (valtype, func)
extracted from it.) It might possibly be useful on some targets, but
probably not. */
-void
+static void
xstormy16_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
FILE *file;
tree thunk_fndecl ATTRIBUTE_UNUSED;
@@ -2031,4 +2033,7 @@ xstormy16_handle_interrupt_attribute (node, name, args, flags, no_add_attrs)
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO xstormy16_encode_section_info
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK xstormy16_asm_output_mi_thunk
+
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 8034f89..50a784c 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -1593,39 +1593,6 @@ enum reg_class
You need not define this macro if you did not define
`DELAY_SLOTS_FOR_EPILOGUE'. */
/* #define ELIGIBLE_FOR_EPILOGUE_DELAY(INSN, N) */
-
-/* A C compound statement that outputs the assembler code for a thunk function,
- used to implement C++ virtual function calls with multiple inheritance. The
- thunk acts as a wrapper around a virtual function, adjusting the implicit
- object parameter before handing control off to the real function.
-
- First, emit code to add the integer DELTA to the location that contains the
- incoming first argument. Assume that this argument contains a pointer, and
- is the one used to pass the `this' pointer in C++. This is the incoming
- argument *before* the function prologue, e.g. `%o0' on a sparc. The
- addition must preserve the values of all other incoming arguments.
-
- After the addition, emit code to jump to FUNCTION, which is a
- `FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch
- the return address. Hence returning from FUNCTION will return to whoever
- called the current `thunk'.
-
- The effect must be as if @var{function} had been called directly
- with the adjusted first argument. This macro is responsible for
- emitting all of the code for a thunk function;
- TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE are
- not invoked.
-
- The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been
- extracted from it.) It might possibly be useful on some targets, but
- probably not.
-
- If you do not define this macro, the target-independent code in the C++
- frontend will generate a less efficient heavyweight thunk that calls
- FUNCTION instead of jumping to it. The generic approach does not support
- varargs. */
-#define TARGET_ASM_OUTPUT_MI_THUNK xstormy16_asm_output_mi_thunk
-
/* Generating Code for Profiling. */
diff --git a/gcc/target.h b/gcc/target.h
index 857aad7..eb674c9 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -123,9 +123,9 @@ struct gcc_target
/* Output the assembler code for a thunk function. */
void (* output_mi_thunk) PARAMS ((FILE *, tree, HOST_WIDE_INT, tree));
- /* Output the assembler code for a thunk function with a vcall
- offset. */
- void (* output_mi_vcall_thunk) PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
+ /* Output the assembler code for a thunk function with a vcall offset. */
+ void (* output_mi_vcall_thunk) PARAMS ((FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree));
} asm_out;
/* Functions relating to instruction scheduling. */