+2004-01-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/m32r/m32r-protos.h: Remove the prototype for
+ m32r_setup_incoming_varargs.
+ * config/m32r/m32r.c (TARGET_PROMOTE_PROTOTYPES): New.
+ (TARGET_STRUCT_VALUE_RTX): Likewise.
+ (TARGET_RETURN_IN_MEMORY): Likewise.
+ (TARGET_SETUP_INCOMING_VARARGS): Likewise.
+ (m32r_return_in_memory): New.
+ (m32r_setup_incoming_varargs): Make it static.
+ * config/m32r/m32r.h: Remove #undef of
+ ASM_OUTPUT_EXTERNAL_LIBCALL. Remove the commented-out
+ definitions of PROMOTE_FUNCTION_ARGS and
+ PROMOTE_FUNCTION_RETURN.
+ (PROMOTE_PROTOTYPES): Remove.
+ (RETURN_IN_MEMORY): Likewise.
+ (STRUCT_VALUE): Likewise.
+
2004-01-28 Kazu Hirata <kazu@cs.umass.edu>
* config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES): New.
/* Prototypes for m32r.c functions used in the md file & elsewhere.
- Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GCC.
extern enum m32r_function_type m32r_compute_function_type (tree);
#ifdef HAVE_MACHINE_MODES
-extern void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, Mmode, tree, int *, int);
extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, Mmode, tree, int);
#endif
#endif /* TREE_CODE */
/* Subroutines used for code generation on the Renesas M32R cpu.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
static void m32r_encode_section_info (tree, rtx, int);
static bool m32r_in_small_data_p (tree);
+static bool m32r_return_in_memory (tree, tree);
+static void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int *, int);
static void init_idents (void);
static bool m32r_rtx_costs (rtx, int, int, int *);
\f
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST hook_int_rtx_0
+#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 m32r_return_in_memory
+
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS m32r_setup_incoming_varargs
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Called by OVERRIDE_OPTIONS to initialize various things. */
return ret;
}
+/* Worker function for TARGET_RETURN_IN_MEMORY. */
+
+static bool
+m32r_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+ return m32r_pass_by_reference (type);
+}
+
/* Do any needed setup for a variadic function. For the M32R, we must
create a register parameter block, and then copy any anonymous arguments
in registers to memory.
CUM has not been updated for the last named argument which has type TYPE
and mode MODE, and we rely on this fact. */
-void
+static void
m32r_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int *pretend_size, int no_rtl)
{
#undef PTRDIFF_TYPE
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
-#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#undef TARGET_VERSION
#undef CPP_SPEC
#undef ASM_SPEC
(MODE) = SImode; \
}
-/* Define this macro if the promotion described by `PROMOTE_MODE'
- should also be done for outgoing function arguments. */
-/*#define PROMOTE_FUNCTION_ARGS*/
-
-/* Likewise, if the function return value is promoted.
- If defined, FUNCTION_VALUE must perform the same promotions done by
- PROMOTE_MODE. */
-/*#define PROMOTE_FUNCTION_RETURN*/
-
/* Allocation boundary (in *bits*) for storing arguments in argument list. */
#define PARM_BOUNDARY 32
\f
/* Function argument passing. */
-/* When a prototype says `char' or `short', really pass an `int'. */
-#define PROMOTE_PROTOTYPES 1
-
/* If defined, the maximum amount of space required for outgoing
arguments will be computed and placed into the variable
`current_function_outgoing_args_size'. No space will be pushed
? PARM_BOUNDARY : 2 * PARM_BOUNDARY)
#endif
-/* This macro offers an alternative
- to using `__builtin_saveregs' and defining the macro
- `EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous register
- arguments into the stack so that all the arguments appear to have
- been passed consecutively on the stack. Once this is done, you
- can use the standard implementation of varargs that works for
- machines that pass all their arguments on the stack.
-
- The argument ARGS_SO_FAR is the `CUMULATIVE_ARGS' data structure,
- containing the values that obtain after processing of the named
- arguments. The arguments MODE and TYPE describe the last named
- argument--its machine mode and its data type as a tree node.
-
- The macro implementation should do two things: first, push onto the
- stack all the argument registers *not* used for the named
- arguments, and second, store the size of the data thus pushed into
- the `int'-valued variable whose name is supplied as the argument
- PRETEND_SIZE. The value that you store here will serve as
- additional offset for setting up the stack frame.
-
- If the argument NO_RTL is nonzero, it means that the
- arguments of the function are being analyzed for the second time.
- This happens for an inline function, which is not actually
- compiled until the end of the source file. The macro
- `SETUP_INCOMING_VARARGS' should not generate any instructions in
- this case. */
-
-#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_SIZE, NO_RTL) \
- m32r_setup_incoming_varargs (& ARGS_SO_FAR, MODE, TYPE, & PRETEND_SIZE, NO_RTL)
-
/* Implement `va_arg'. */
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
m32r_va_arg (valist, type)
/* ??? What about r1 in DI/DF values. */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
-/* A C expression which can inhibit the returning of certain function
- values in registers, based on the type of value. A nonzero value says
- to return the function value in memory, just as large structures are
- always returned. Here TYPE will be a C expression of type `tree',
- representing the data type of the value. */
-#define RETURN_IN_MEMORY(TYPE) m32r_pass_by_reference (TYPE)
-
/* Tell GCC to use RETURN_IN_MEMORY. */
#define DEFAULT_PCC_STRUCT_RETURN 0
-
-/* Register in which address to store a structure value
- is passed to a function, or 0 to use `invisible' first argument. */
-#define STRUCT_VALUE 0
\f
/* Function entry and exit. */