This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mi_thunk canonicalization


The bulk of this patch is canonicalizing where TARGET_ASM_OUTPUT_MI_THUNK
gets defined, and the declaration of the implmenting function.

For m68k, the note wrt @PLTPC points to how this canonicalization would
be incorrect for openbsd.  Fixed by copying the mnemonic selection logic
from the call patterns.

For powerpc, I've done nothing.  This review pointed to the fact that
the current logic wrt whether or not an MI thunk can be emitted is wrong.
At present, we assume that if the target hook is defined, then we can
emit the thunk.  For powerpc, we can change the ABI via command-line
switches to an ABI that doesn't support thunks.  To be fixed with a 
subsequent patch.

Tested via cc1 build of at least one of each affected cpu, and looking
for warning regressions in cpu.o.


r~


	* 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.

Index: gcc/target.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target.h,v
retrieving revision 1.39
diff -u -p -b -r1.39 target.h
--- gcc/target.h	20 Oct 2002 18:51:51 -0000	1.39
+++ gcc/target.h	20 Oct 2002 21:21:23 -0000
@@ -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.  */
Index: gcc/config/alpha/alpha-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha-protos.h,v
retrieving revision 1.40
diff -u -p -b -r1.40 alpha-protos.h
--- gcc/config/alpha/alpha-protos.h	20 Oct 2002 18:51:55 -0000	1.40
+++ gcc/config/alpha/alpha-protos.h	20 Oct 2002 21:21:23 -0000
@@ -141,7 +141,6 @@ extern rtx function_arg PARAMS ((CUMULAT
 				 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,
Index: gcc/config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.279
diff -u -p -b -r1.279 alpha.c
--- gcc/config/alpha/alpha.c	20 Oct 2002 18:51:56 -0000	1.279
+++ gcc/config/alpha/alpha.c	20 Oct 2002 21:21:23 -0000
@@ -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 PARA
 #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,6 +7849,7 @@ alpha_end_function (file, fnname, decl)
     }
 }
 
+#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
@@ -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_f
   final (insn, file, 1, 0);
   final_end_function ();
 }
+#endif /* TARGET_ABI_OSF */
 
 /* Debugging support.  */
 
Index: gcc/config/alpha/alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.183
diff -u -p -b -r1.183 alpha.h
--- gcc/config/alpha/alpha.h	18 Oct 2002 23:35:25 -0000	1.183
+++ gcc/config/alpha/alpha.h	20 Oct 2002 21:21:23 -0000
@@ -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
Index: gcc/config/arm/arm-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm-protos.h,v
retrieving revision 1.34
diff -u -p -b -r1.34 arm-protos.h
--- gcc/config/arm/arm-protos.h	20 Oct 2002 18:51:56 -0000	1.34
+++ gcc/config/arm/arm-protos.h	20 Oct 2002 21:21:23 -0000
@@ -194,7 +194,6 @@ extern int  arm_dllexport_p 		PARAMS ((t
 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));
Index: gcc/config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.236
diff -u -p -b -r1.236 arm.c
--- gcc/config/arm/arm.c	20 Oct 2002 18:51:56 -0000	1.236
+++ gcc/config/arm/arm.c	20 Oct 2002 21:21:24 -0000
@@ -126,6 +126,8 @@ static void	 arm_encode_section_info	PAR
 #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
 #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;
Index: gcc/config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.165
diff -u -p -b -r1.165 arm.h
--- gcc/config/arm/arm.h	18 Oct 2002 23:35:26 -0000	1.165
+++ gcc/config/arm/arm.h	20 Oct 2002 21:21:24 -0000
@@ -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.  */
 
Index: gcc/config/cris/cris-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris-protos.h,v
retrieving revision 1.4
diff -u -p -b -r1.4 cris-protos.h
--- gcc/config/cris/cris-protos.h	20 Oct 2002 18:51:56 -0000	1.4
+++ gcc/config/cris/cris-protos.h	20 Oct 2002 21:21:24 -0000
@@ -52,12 +52,6 @@ extern rtx cris_expand_builtin_va_arg PA
 # 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
Index: gcc/config/cris/cris.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.c,v
retrieving revision 1.30
diff -u -p -b -r1.30 cris.c
--- gcc/config/cris/cris.c	20 Oct 2002 18:51:56 -0000	1.30
+++ gcc/config/cris/cris.c	20 Oct 2002 21:21:25 -0000
@@ -101,6 +101,10 @@ static void cris_target_asm_function_epi
 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_
 #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;
Index: gcc/config/cris/cris.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.h,v
retrieving revision 1.41
diff -u -p -b -r1.41 cris.h
--- gcc/config/cris/cris.h	18 Oct 2002 23:35:28 -0000	1.41
+++ gcc/config/cris/cris.h	20 Oct 2002 21:21:25 -0000
@@ -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)  \
Index: gcc/config/d30v/d30v.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/d30v/d30v.h,v
retrieving revision 1.72
diff -u -p -b -r1.72 d30v.h
--- gcc/config/d30v/d30v.h	20 Oct 2002 18:51:56 -0000	1.72
+++ gcc/config/d30v/d30v.h	20 Oct 2002 21:21:25 -0000
@@ -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(())
Index: gcc/config/frv/frv-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv-protos.h,v
retrieving revision 1.3
diff -u -p -b -r1.3 frv-protos.h
--- gcc/config/frv/frv-protos.h	20 Oct 2002 18:51:57 -0000	1.3
+++ gcc/config/frv/frv-protos.h	20 Oct 2002 21:21:25 -0000
@@ -113,11 +113,6 @@ extern rtx frv_return_addr_rtx			PARAMS 
 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));
Index: gcc/config/frv/frv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.c,v
retrieving revision 1.12
diff -u -p -b -r1.12 frv.c
--- gcc/config/frv/frv.c	20 Oct 2002 18:51:57 -0000	1.12
+++ gcc/config/frv/frv.c	20 Oct 2002 21:21:25 -0000
@@ -279,6 +279,7 @@ static void frv_encode_section_info		PAR
 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
 #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;
Index: gcc/config/frv/frv.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.h,v
retrieving revision 1.12
diff -u -p -b -r1.12 frv.h
--- gcc/config/frv/frv.h	20 Oct 2002 18:51:57 -0000	1.12
+++ gcc/config/frv/frv.h	20 Oct 2002 21:21:25 -0000
@@ -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.  */
 
Index: gcc/config/i386/i386-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386-protos.h,v
retrieving revision 1.82
diff -u -p -b -r1.82 i386-protos.h
--- gcc/config/i386/i386-protos.h	20 Oct 2002 18:51:57 -0000	1.82
+++ gcc/config/i386/i386-protos.h	20 Oct 2002 21:21:25 -0000
@@ -211,8 +211,6 @@ extern tree ix86_handle_shared_attribute
 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
 
Index: gcc/config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.477
diff -u -p -b -r1.477 i386.c
--- gcc/config/i386/i386.c	20 Oct 2002 20:38:41 -0000	1.477
+++ gcc/config/i386/i386.c	20 Oct 2002 21:21:26 -0000
@@ -751,6 +751,9 @@ static int ia32_use_dfa_pipeline_interfa
 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_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, 
     }
 }
 
-void
+static void
 x86_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk;
Index: gcc/config/i386/openbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/openbsd.h,v
retrieving revision 1.17
diff -u -p -b -r1.17 openbsd.h
--- gcc/config/i386/openbsd.h	20 Oct 2002 18:51:58 -0000	1.17
+++ gcc/config/i386/openbsd.h	20 Oct 2002 21:21:26 -0000
@@ -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 ";#"
 
Index: gcc/config/i386/unix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/unix.h,v
retrieving revision 1.23
diff -u -p -b -r1.23 unix.h
--- gcc/config/i386/unix.h	18 Oct 2002 23:35:29 -0000	1.23
+++ gcc/config/i386/unix.h	20 Oct 2002 21:21:26 -0000
@@ -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
Index: gcc/config/i960/i960-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i960/i960-protos.h,v
retrieving revision 1.9
diff -u -p -b -r1.9 i960-protos.h
--- gcc/config/i960/i960-protos.h	20 Oct 2002 18:51:58 -0000	1.9
+++ gcc/config/i960/i960-protos.h	20 Oct 2002 21:21:26 -0000
@@ -86,7 +86,6 @@ extern void i960_setup_incoming_varargs 
 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 *));
Index: gcc/config/i960/i960.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i960/i960.c,v
retrieving revision 1.47
diff -u -p -b -r1.47 i960.c
--- gcc/config/i960/i960.c	20 Oct 2002 18:51:58 -0000	1.47
+++ gcc/config/i960/i960.c	20 Oct 2002 21:21:26 -0000
@@ -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;
Index: gcc/config/i960/i960.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i960/i960.h,v
retrieving revision 1.68
diff -u -p -b -r1.68 i960.h
--- gcc/config/i960/i960.h	20 Oct 2002 18:51:58 -0000	1.68
+++ gcc/config/i960/i960.h	20 Oct 2002 21:21:26 -0000
@@ -1463,7 +1463,3 @@ extern enum insn_types i960_last_insn_ty
 /* 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
Index: gcc/config/ia64/ia64-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64-protos.h,v
retrieving revision 1.48
diff -u -p -b -r1.48 ia64-protos.h
--- gcc/config/ia64/ia64-protos.h	20 Oct 2002 18:51:58 -0000	1.48
+++ gcc/config/ia64/ia64-protos.h	20 Oct 2002 21:21:26 -0000
@@ -121,7 +121,6 @@ extern int ia64_function_arg_pass_by_ref
 						       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,
Index: gcc/config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.190
diff -u -p -b -r1.190 ia64.c
--- gcc/config/ia64/ia64.c	20 Oct 2002 18:51:58 -0000	1.190
+++ gcc/config/ia64/ia64.c	20 Oct 2002 21:21:27 -0000
@@ -161,6 +161,8 @@ static int ia64_sched_reorder PARAMS ((F
 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_
 #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, al
   flag_pic = save_pic;
 }
 
-void
+static void
 ia64_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
Index: gcc/config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.131
diff -u -p -b -r1.131 ia64.h
--- gcc/config/ia64/ia64.h	18 Oct 2002 23:35:30 -0000	1.131
+++ gcc/config/ia64/ia64.h	20 Oct 2002 21:21:27 -0000
@@ -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)				\
Index: gcc/config/m68k/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/linux.h,v
retrieving revision 1.24
diff -u -p -b -r1.24 linux.h
--- gcc/config/m68k/linux.h	18 Oct 2002 23:35:31 -0000	1.24
+++ gcc/config/m68k/linux.h	20 Oct 2002 21:21:27 -0000
@@ -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
Index: gcc/config/m68k/m68k-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k-protos.h,v
retrieving revision 1.6
diff -u -p -b -r1.6 m68k-protos.h
--- gcc/config/m68k/m68k-protos.h	20 Oct 2002 18:51:58 -0000	1.6
+++ gcc/config/m68k/m68k-protos.h	20 Oct 2002 21:21:27 -0000
@@ -64,10 +64,6 @@ extern int pcrel_address PARAMS ((rtx, e
 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));
Index: gcc/config/m68k/m68k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.c,v
retrieving revision 1.72
diff -u -p -b -r1.72 m68k.c
--- gcc/config/m68k/m68k.c	20 Oct 2002 21:19:51 -0000	1.72
+++ gcc/config/m68k/m68k.c	20 Oct 2002 21:21:27 -0000
@@ -65,6 +65,7 @@ static void m68k_coff_asm_named_section 
 #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,13 +3840,16 @@ m68k_svr3_asm_out_constructor (symbol, p
 }
 #endif
 
-void
+static void
 m68k_output_mi_thunk (file, thunk, delta, function)
      FILE *file;
      tree thunk ATTRIBUTE_UNUSED;
      HOST_WIDE_INT delta;
      tree function;
 {
+  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)					
@@ -3851,19 +3858,49 @@ m68k_output_mi_thunk (file, thunk, delta
     {
       asm_fprintf (file, "\tadd.l %I");
       fprintf (file, HOST_WIDE_INT_PRINT_DEC, delta);		
-      asm_fprintf (file, ",4(%Rsp)\n", delta);		
+      asm_fprintf (file, ",4(%Rsp)\n");
     }
 									
+  xops[0] = DECL_RTL (function);
+
+  /* Logic taken from call patterns in m68k.md.  */
   if (flag_pic)								
     {									
-      fprintf (file, "\tbra.l ");					
-      assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));	
-      fprintf (file, "@PLTPC\n");					
+      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									
     {									
-      fprintf (file, "\tjmp ");						
-      assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));	
-      fprintf (file, "\n");						
+#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);
 }
Index: gcc/config/m68k/netbsd-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/netbsd-elf.h,v
retrieving revision 1.8
diff -u -p -b -r1.8 netbsd-elf.h
--- gcc/config/m68k/netbsd-elf.h	18 Oct 2002 23:35:31 -0000	1.8
+++ gcc/config/m68k/netbsd-elf.h	20 Oct 2002 21:21:27 -0000
@@ -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.  */
 
Index: gcc/config/m68k/openbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/openbsd.h,v
retrieving revision 1.6
diff -u -p -b -r1.6 openbsd.h
--- gcc/config/m68k/openbsd.h	20 Oct 2002 18:51:58 -0000	1.6
+++ gcc/config/m68k/openbsd.h	20 Oct 2002 21:21:27 -0000
@@ -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
-
Index: gcc/config/mmix/mmix-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix-protos.h,v
retrieving revision 1.18
diff -u -p -b -r1.18 mmix-protos.h
--- gcc/config/mmix/mmix-protos.h	20 Oct 2002 18:51:59 -0000	1.18
+++ gcc/config/mmix/mmix-protos.h	20 Oct 2002 21:21:27 -0000
@@ -80,7 +80,6 @@ extern void mmix_asm_output_aligned_loca
   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
Index: gcc/config/mmix/mmix.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.c,v
retrieving revision 1.43
diff -u -p -b -r1.43 mmix.c
--- gcc/config/mmix/mmix.c	20 Oct 2002 18:51:59 -0000	1.43
+++ gcc/config/mmix/mmix.c	20 Oct 2002 21:21:27 -0000
@@ -130,6 +130,8 @@ static void mmix_target_asm_function_pro
 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_epi
 #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 (strea
 
 /* TARGET_ASM_OUTPUT_MI_THUNK.  */
 
-void
+static void
 mmix_asm_output_mi_thunk (stream, fndecl, delta, func)
      FILE * stream;
      tree fndecl ATTRIBUTE_UNUSED;
Index: gcc/config/mmix/mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.43
diff -u -p -b -r1.43 mmix.h
--- gcc/config/mmix/mmix.h	18 Oct 2002 23:35:31 -0000	1.43
+++ gcc/config/mmix/mmix.h	20 Oct 2002 21:21:27 -0000
@@ -795,9 +795,6 @@ typedef struct { int regs; int lib; } CU
 #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)
Index: gcc/config/pa/pa-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-protos.h,v
retrieving revision 1.17
diff -u -p -b -r1.17 pa-protos.h
--- gcc/config/pa/pa-protos.h	20 Oct 2002 18:51:59 -0000	1.17
+++ gcc/config/pa/pa-protos.h	20 Oct 2002 21:21:27 -0000
@@ -126,9 +126,6 @@ extern int eq_neq_comparison_operator PA
 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 ((CUMULAT
 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 */
Index: gcc/config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.182
diff -u -p -b -r1.182 pa.c
--- gcc/config/pa/pa.c	30 Sep 2002 19:52:45 -0000	1.182
+++ gcc/config/pa/pa.c	20 Oct 2002 21:21:27 -0000
@@ -108,6 +108,7 @@ static void store_reg PARAMS ((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 PARAM
 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;
Index: gcc/config/pa/pa.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.172
diff -u -p -b -r1.172 pa.h
--- gcc/config/pa/pa.h	18 Oct 2002 23:35:32 -0000	1.172
+++ gcc/config/pa/pa.h	20 Oct 2002 21:21:27 -0000
@@ -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
Index: gcc/config/s390/s390-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390-protos.h,v
retrieving revision 1.17
diff -u -p -b -r1.17 s390-protos.h
--- gcc/config/s390/s390-protos.h	20 Oct 2002 18:52:00 -0000	1.17
+++ gcc/config/s390/s390-protos.h	20 Oct 2002 21:21:27 -0000
@@ -86,7 +86,6 @@ extern tree s390_build_va_list PARAMS ((
 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 */
 
Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.60
diff -u -p -b -r1.60 s390.c
--- gcc/config/s390/s390.c	20 Oct 2002 18:52:00 -0000	1.60
+++ gcc/config/s390/s390.c	20 Oct 2002 21:21:27 -0000
@@ -54,6 +54,7 @@ static int s390_adjust_priority PARAMS (
 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 PAR
 #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;
Index: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.46
diff -u -p -b -r1.46 s390.h
--- gcc/config/s390/s390.h	18 Oct 2002 23:35:35 -0000	1.46
+++ gcc/config/s390/s390.h	20 Oct 2002 21:21:28 -0000
@@ -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 */
Index: gcc/config/sparc/openbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/openbsd.h,v
retrieving revision 1.7
diff -u -p -b -r1.7 openbsd.h
--- gcc/config/sparc/openbsd.h	20 Oct 2002 18:52:00 -0000	1.7
+++ gcc/config/sparc/openbsd.h	20 Oct 2002 21:21:28 -0000
@@ -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 */
Index: gcc/config/sparc/sparc-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc-protos.h,v
retrieving revision 1.31
diff -u -p -b -r1.31 sparc-protos.h
--- gcc/config/sparc/sparc-protos.h	16 Jul 2002 20:59:06 -0000	1.31
+++ gcc/config/sparc/sparc-protos.h	20 Oct 2002 21:21:28 -0000
@@ -123,6 +123,4 @@ extern int sparc_extra_constraint_check 
 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__ */
Index: gcc/config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.231
diff -u -p -b -r1.231 sparc.c
--- gcc/config/sparc/sparc.c	26 Sep 2002 10:18:05 -0000	1.231
+++ gcc/config/sparc/sparc.c	20 Oct 2002 21:21:28 -0000
@@ -176,6 +176,7 @@ static void emit_soft_tfmode_cvt PARAMS 
 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;
Index: gcc/config/sparc/sparc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.213
diff -u -p -b -r1.213 sparc.h
--- gcc/config/sparc/sparc.h	18 Oct 2002 23:35:36 -0000	1.213
+++ gcc/config/sparc/sparc.h	20 Oct 2002 21:21:28 -0000
@@ -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) == '_')
 
Index: gcc/config/stormy16/stormy16-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16-protos.h,v
retrieving revision 1.8
diff -u -p -b -r1.8 stormy16-protos.h
--- gcc/config/stormy16/stormy16-protos.h	20 Oct 2002 18:52:00 -0000	1.8
+++ gcc/config/stormy16/stormy16-protos.h	20 Oct 2002 21:21:28 -0000
@@ -45,7 +45,6 @@ extern void    xstormy16_expand_builtin_
 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
Index: gcc/config/stormy16/stormy16.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.c,v
retrieving revision 1.29
diff -u -p -b -r1.29 stormy16.c
--- gcc/config/stormy16/stormy16.c	20 Oct 2002 18:52:00 -0000	1.29
+++ gcc/config/stormy16/stormy16.c	20 Oct 2002 21:21:28 -0000
@@ -50,6 +50,8 @@ static rtx emit_addhi3_postreload PARAMS
 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;
@@ -2030,5 +2032,8 @@ xstormy16_handle_interrupt_attribute (no
 #define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
 #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;
Index: gcc/config/stormy16/stormy16.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.h,v
retrieving revision 1.63
diff -u -p -b -r1.63 stormy16.h
--- gcc/config/stormy16/stormy16.h	18 Oct 2002 23:35:37 -0000	1.63
+++ gcc/config/stormy16/stormy16.h	20 Oct 2002 21:21:28 -0000
@@ -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.  */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]