+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.
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,
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));
#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;
\f
/* Parse target option strings. */
}
}
-/* 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
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;
final (insn, file, 1, 0);
final_end_function ();
}
+#endif /* TARGET_ABI_OSF */
\f
/* Debugging support. */
/* 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
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));
#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
#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;
\f
/* Obstack for minipool constant handling. */
}
#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;
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. */
# 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
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. */
#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. */
/* 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;
#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) \
`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(())
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));
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));
\f
/* Initialize the GCC target structure. */
#undef TARGET_ASM_FUNCTION_PROLOGUE
#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;
\f
/* Given a SYMBOL_REF, return true if it points to small data. */
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;
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
-
\f
/* Generating Code for Profiling. */
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
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
{
#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;
\f
/* Sometimes certain combinations of command options do not make
}
-void
+static void
x86_output_mi_vcall_thunk (file, thunk, delta, vcall_index, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
}
}
-void
+static void
x86_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk;
#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 ";#"
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
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 *));
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. */
#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;
\f
/* Override conflicting target switch options.
}
}
-void
+static void
i960_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
/* 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
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,
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,
#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;
\f
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */
flag_pic = save_pic;
}
-void
+static void
ia64_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
#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) \
: "d" (_beg), "d" (_len) \
: "%d0", "%d2", "%d3"); \
}
-\f
-/* 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
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));
#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));
\f
/* Alignment to use for loops and jumps */
#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;
\f
/* Sometimes certain combinations of command options do not make
}
#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);
}
#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. */
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
-
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
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'
#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.
/* TARGET_ASM_OUTPUT_MI_THUNK. */
-void
+static void
mmix_asm_output_mi_thunk (stream, fndecl, delta, func)
FILE * stream;
tree fndecl ATTRIBUTE_UNUSED;
#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)
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));
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 */
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));
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. */
#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;
\f
void
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;
/* 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;
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
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 */
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"
#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;
}
}
-void
+static void
s390_output_mi_thunk (file, thunk, delta, function)
FILE *file;
tree thunk ATTRIBUTE_UNUSED;
#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 */
#define DWARF2_UNWIND_INFO 0
#undef ASM_PREFERRED_EH_DATA_FORMAT
-
-/* Default sparc.h does already define TARGET_ASM_OUTPUT_MI_THUNK */
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__ */
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));
\f
/* Option handling. */
#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;
\f
/* Validate and override various options, and do some machine dependent
/* 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;
#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) == '_')
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
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. */
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;
#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;
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
-
\f
/* Generating Code for Profiling. */
/* 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. */