Commit 09a2b93a by Kazu Hirata Committed by Kazu Hirata

mcore-protos.h: Remove the prototype for mcore_setup_incoming_varargs.

	* config/mcore/mcore-protos.h: Remove the prototype for
	mcore_setup_incoming_varargs.
	* config/mcore/mcore.c (TARGET_ASM_EXTERNAL_LIBCALL): New.
	(TARGET_PROMOTE_FUNCTION_ARGS): Likewise.
	(TARGET_PROMOTE_FUNCTION_RETURN): Likewise.
	(TARGET_PROMOTE_PROTOTYPES): Likewise.
	(TARGET_STRUCT_VALUE_RTX): Likewise.
	(TARGET_RETURN_IN_MEMORY): Likewise.
	(TARGET_SETUP_INCOMING_VARARGS): Likewise.
	(mcore_setup_incoming_varargs): Make it static.  Receive the
	first argument by reference.  Add argument second_time.
	(mcore_external_libcall): New.
	(mcore_return_in_memory): Likewise.
	* config/mcore/mcore.h (PROMOTE_FUNCTION_ARGS): New.
	(PROMOTE_FUNCTION_RETURN): Likewise.
	(STRUCT_VALUE): Likewise.
	(RETURN_IN_MEMORY): Likewise.
	(SETUP_INCOMING_VARARGS): Likewise.
	(PROMOTE_PROTOTYPES): Likewise.
	(ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise.

From-SVN: r76835
parent a7ed00da
2004-01-28 Kazu Hirata <kazu@cs.umass.edu> 2004-01-28 Kazu Hirata <kazu@cs.umass.edu>
* config/mcore/mcore-protos.h: Remove the prototype for
mcore_setup_incoming_varargs.
* config/mcore/mcore.c (TARGET_ASM_EXTERNAL_LIBCALL): New.
(TARGET_PROMOTE_FUNCTION_ARGS): Likewise.
(TARGET_PROMOTE_FUNCTION_RETURN): Likewise.
(TARGET_PROMOTE_PROTOTYPES): Likewise.
(TARGET_STRUCT_VALUE_RTX): Likewise.
(TARGET_RETURN_IN_MEMORY): Likewise.
(TARGET_SETUP_INCOMING_VARARGS): Likewise.
(mcore_setup_incoming_varargs): Make it static. Receive the
first argument by reference. Add argument second_time.
(mcore_external_libcall): New.
(mcore_return_in_memory): Likewise.
* config/mcore/mcore.h (PROMOTE_FUNCTION_ARGS): New.
(PROMOTE_FUNCTION_RETURN): Likewise.
(STRUCT_VALUE): Likewise.
(RETURN_IN_MEMORY): Likewise.
(SETUP_INCOMING_VARARGS): Likewise.
(PROMOTE_PROTOTYPES): Likewise.
(ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise.
2004-01-28 Kazu Hirata <kazu@cs.umass.edu>
* config/m32r/m32r-protos.h: Remove the prototype for * config/m32r/m32r-protos.h: Remove the prototype for
m32r_setup_incoming_varargs. m32r_setup_incoming_varargs.
* config/m32r/m32r.c (TARGET_PROMOTE_PROTOTYPES): New. * config/m32r/m32r.c (TARGET_PROMOTE_PROTOTYPES): New.
......
/* Prototypes for exported functions defined in mcore.c /* Prototypes for exported functions defined in mcore.c
Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Nick Clifton (nickc@redhat.com) Contributed by Nick Clifton (nickc@redhat.com)
This file is part of GCC. This file is part of GCC.
...@@ -37,7 +37,6 @@ extern int mcore_naked_function_p (void); ...@@ -37,7 +37,6 @@ extern int mcore_naked_function_p (void);
#ifdef TREE_CODE #ifdef TREE_CODE
#ifdef HAVE_MACHINE_MODES #ifdef HAVE_MACHINE_MODES
extern int mcore_function_arg_partial_nregs (CUMULATIVE_ARGS, enum machine_mode, tree, int); extern int mcore_function_arg_partial_nregs (CUMULATIVE_ARGS, enum machine_mode, tree, int);
extern void mcore_setup_incoming_varargs (CUMULATIVE_ARGS, enum machine_mode, tree, int *);
extern int mcore_num_arg_regs (enum machine_mode, tree); extern int mcore_num_arg_regs (enum machine_mode, tree);
extern int mcore_must_pass_on_stack (enum machine_mode, tree); extern int mcore_must_pass_on_stack (enum machine_mode, tree);
#endif /* HAVE_MACHINE_MODES */ #endif /* HAVE_MACHINE_MODES */
......
/* Output routines for Motorola MCore processor /* Output routines for Motorola MCore processor
Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -123,6 +124,7 @@ static int try_constant_tricks (long, int *, int *); ...@@ -123,6 +124,7 @@ static int try_constant_tricks (long, int *, int *);
static const char * output_inline_const (enum machine_mode, rtx *); static const char * output_inline_const (enum machine_mode, rtx *);
static void block_move_sequence (rtx, rtx, rtx, rtx, int, int, int); static void block_move_sequence (rtx, rtx, rtx, rtx, int, int, int);
static void layout_mcore_frame (struct mcore_frame *); static void layout_mcore_frame (struct mcore_frame *);
static void mcore_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
static cond_type is_cond_candidate (rtx); static cond_type is_cond_candidate (rtx);
static rtx emit_new_cond_insn (rtx, int); static rtx emit_new_cond_insn (rtx, int);
static rtx conditionalize_block (rtx); static rtx conditionalize_block (rtx);
...@@ -146,8 +148,14 @@ static int mcore_const_costs (rtx, RTX_CODE); ...@@ -146,8 +148,14 @@ static int mcore_const_costs (rtx, RTX_CODE);
static int mcore_and_cost (rtx); static int mcore_and_cost (rtx);
static int mcore_ior_cost (rtx); static int mcore_ior_cost (rtx);
static bool mcore_rtx_costs (rtx, int, int, int *); static bool mcore_rtx_costs (rtx, int, int, int *);
static void mcore_external_libcall (rtx);
static bool mcore_return_in_memory (tree, tree);
/* Initialize the GCC target structure. */ /* Initialize the GCC target structure. */
#undef TARGET_ASM_EXTERNAL_LIBCALL
#define TARGET_ASM_EXTERNAL_LIBCALL mcore_external_libcall
#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES #ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
#undef TARGET_MERGE_DECL_ATTRIBUTES #undef TARGET_MERGE_DECL_ATTRIBUTES
#define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes #define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes
...@@ -175,6 +183,21 @@ static bool mcore_rtx_costs (rtx, int, int, int *); ...@@ -175,6 +183,21 @@ static bool mcore_rtx_costs (rtx, int, int, int *);
#undef TARGET_MACHINE_DEPENDENT_REORG #undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mcore_reorg #define TARGET_MACHINE_DEPENDENT_REORG mcore_reorg
#undef TARGET_PROMOTE_FUNCTION_ARGS
#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
#undef TARGET_PROMOTE_FUNCTION_RETURN
#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY mcore_return_in_memory
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS mcore_setup_incoming_varargs
struct gcc_target targetm = TARGET_INITIALIZER; struct gcc_target targetm = TARGET_INITIALIZER;
/* Adjust the stack and return the number of bytes taken to do it. */ /* Adjust the stack and return the number of bytes taken to do it. */
...@@ -2188,22 +2211,23 @@ mcore_initial_elimination_offset (int from, int to) ...@@ -2188,22 +2211,23 @@ mcore_initial_elimination_offset (int from, int to)
/* Keep track of some information about varargs for the prolog. */ /* Keep track of some information about varargs for the prolog. */
void static void
mcore_setup_incoming_varargs (CUMULATIVE_ARGS args_so_far, mcore_setup_incoming_varargs (CUMULATIVE_ARGS *args_so_far,
enum machine_mode mode, tree type, enum machine_mode mode, tree type,
int * ptr_pretend_size ATTRIBUTE_UNUSED) int * ptr_pretend_size ATTRIBUTE_UNUSED,
int second_time ATTRIBUTE_UNUSED)
{ {
current_function_anonymous_args = 1; current_function_anonymous_args = 1;
/* We need to know how many argument registers are used before /* We need to know how many argument registers are used before
the varargs start, so that we can push the remaining argument the varargs start, so that we can push the remaining argument
registers during the prologue. */ registers during the prologue. */
number_of_regs_before_varargs = args_so_far + mcore_num_arg_regs (mode, type); number_of_regs_before_varargs = *args_so_far + mcore_num_arg_regs (mode, type);
/* There is a bug somewhere in the arg handling code. /* There is a bug somewhere in the arg handling code.
Until I can find it this workaround always pushes the Until I can find it this workaround always pushes the
last named argument onto the stack. */ last named argument onto the stack. */
number_of_regs_before_varargs = args_so_far; number_of_regs_before_varargs = *args_so_far;
/* The last named argument may be split between argument registers /* The last named argument may be split between argument registers
and the stack. Allow for this here. */ and the stack. Allow for this here. */
...@@ -3428,3 +3452,17 @@ mcore_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED) ...@@ -3428,3 +3452,17 @@ mcore_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED)
fprintf (asm_out_file, "\t.section %s\n", name); fprintf (asm_out_file, "\t.section %s\n", name);
} }
#endif /* OBJECT_FORMAT_ELF */ #endif /* OBJECT_FORMAT_ELF */
static void
mcore_external_libcall (rtx fun)
{
fprintf (asm_out_file, "\t.import\t");
assemble_name (asm_out_file, XSTR (fun, 0));
fprintf (asm_out_file, "\n");
}
static bool
mcore_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
{
return int_size_in_bytes (type) > 2 * UNITS_PER_WORD;
}
/* Definitions of target machine for GNU compiler, /* Definitions of target machine for GNU compiler,
for Motorola M*CORE Processor. for Motorola M*CORE Processor.
Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003 Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -216,10 +216,6 @@ extern const char * mcore_stack_increment_string; ...@@ -216,10 +216,6 @@ extern const char * mcore_stack_increment_string;
(UNSIGNEDP) = 1; \ (UNSIGNEDP) = 1; \
} }
#define PROMOTE_FUNCTION_ARGS
#define PROMOTE_FUNCTION_RETURN
/* Define this if most significant bit is lowest numbered /* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields. */ in instructions that operate on numbered bit-fields. */
#define BITS_BIG_ENDIAN 0 #define BITS_BIG_ENDIAN 0
...@@ -435,9 +431,6 @@ extern int mcore_stack_increment; ...@@ -435,9 +431,6 @@ extern int mcore_stack_increment;
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
OFFSET = mcore_initial_elimination_offset (FROM, TO) OFFSET = mcore_initial_elimination_offset (FROM, TO)
/* Place that structure value return address is placed. */
#define STRUCT_VALUE 0
/* Define the classes of registers for register constraints in the /* Define the classes of registers for register constraints in the
machine description. Also define ranges of constants. machine description. Also define ranges of constants.
...@@ -661,9 +654,6 @@ extern const enum reg_class reg_class_from_letter[]; ...@@ -661,9 +654,6 @@ extern const enum reg_class reg_class_from_letter[];
we want to retain compatibility with older gcc versions. */ we want to retain compatibility with older gcc versions. */
#define DEFAULT_PCC_STRUCT_RETURN 0 #define DEFAULT_PCC_STRUCT_RETURN 0
/* How many registers to use for struct return. */
#define RETURN_IN_MEMORY(TYPE) (int_size_in_bytes (TYPE) > 2 * UNITS_PER_WORD)
/* Define how to find the value returned by a library function /* Define how to find the value returned by a library function
assuming the value has mode MODE. */ assuming the value has mode MODE. */
#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, FIRST_RET_REG) #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, FIRST_RET_REG)
...@@ -741,11 +731,6 @@ extern const enum reg_class reg_class_from_letter[]; ...@@ -741,11 +731,6 @@ extern const enum reg_class reg_class_from_letter[];
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
mcore_function_arg_partial_nregs (CUM, MODE, TYPE, NAMED) mcore_function_arg_partial_nregs (CUM, MODE, TYPE, NAMED)
/* Perform any needed actions needed for a function that is receiving a
variable number of arguments. */
#define SETUP_INCOMING_VARARGS(ASF, MODE, TYPE, PAS, ST) \
mcore_setup_incoming_varargs (ASF, MODE, TYPE, & PAS)
/* Call the function profiler with a given profile label. */ /* Call the function profiler with a given profile label. */
#define FUNCTION_PROFILER(STREAM,LABELNO) \ #define FUNCTION_PROFILER(STREAM,LABELNO) \
{ \ { \
...@@ -962,9 +947,6 @@ extern const enum reg_class reg_class_from_letter[]; ...@@ -962,9 +947,6 @@ extern const enum reg_class reg_class_from_letter[];
/* Why is this defined??? -- dac */ /* Why is this defined??? -- dac */
#define NO_FUNCTION_CSE 1 #define NO_FUNCTION_CSE 1
/* Chars and shorts should be passed as ints. */
#define PROMOTE_PROTOTYPES 1
/* The machine modes of pointers and functions. */ /* The machine modes of pointers and functions. */
#define Pmode SImode #define Pmode SImode
#define FUNCTION_MODE Pmode #define FUNCTION_MODE Pmode
...@@ -1164,18 +1146,6 @@ extern long mcore_current_compilation_timestamp; ...@@ -1164,18 +1146,6 @@ extern long mcore_current_compilation_timestamp;
regardless of whether any call sites remain. regardless of whether any call sites remain.
This makes this aspect of the compiler non-ABI compliant. */ This makes this aspect of the compiler non-ABI compliant. */
/* Similar, but for libcall. FUN is an rtx. */
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
do \
{ \
fprintf (FILE, "\t.import\t"); \
assemble_name (FILE, XSTR (FUN, 0)); \
fprintf (FILE, "\n"); \
} \
while (0)
/* This says how to output an assembler line /* This says how to output an assembler line
to define a local common symbol.... */ to define a local common symbol.... */
#undef ASM_OUTPUT_LOCAL #undef ASM_OUTPUT_LOCAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment