+2004-01-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/frv/frv-protos.h: Remove the prototype for
+ frv_expand_builtin_saveregs.
+ * config/frv/frv.c (TARGET_STRUCT_VALUE_RTX): Likewise.
+ (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise.
+ (frv_stack_info): Use FRV_STRUCT_VALUE_REGNUM instead of
+ STRUCT_VALUE_REGNUM.
+ (frv_expand_builtin_saveregs): Make it static.
+ (frv_struct_value_rtx): New.
+ * config/frv/frv.h (EXPAND_BUILTIN_SAVEREGS): Remove.
+
2004-01-29 Jan Hubicka <jh@suse.cz>
PR c++/12850
/* Frv prototypes.
- Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
enum machine_mode,
tree, int);
-extern rtx frv_expand_builtin_saveregs (void);
extern void frv_setup_incoming_varargs (CUMULATIVE_ARGS *,
enum machine_mode,
tree, int *, int);
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004
+ Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
static bool frv_in_small_data_p (tree);
static void frv_asm_output_mi_thunk
(FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
+static rtx frv_expand_builtin_saveregs (void);
static bool frv_rtx_costs (rtx, int, int, int*);
static void frv_asm_out_constructor (rtx, int);
static void frv_asm_out_destructor (rtx, int);
+static rtx frv_struct_value_rtx (tree, int);
\f
/* Initialize the GCC target structure. */
#undef TARGET_ASM_FUNCTION_PROLOGUE
#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE frv_use_dfa_pipeline_interface
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX frv_struct_value_rtx
+
+#undef TARGET_EXPAND_BUILTIN_SAVEREGS
+#define TARGET_EXPAND_BUILTIN_SAVEREGS frv_expand_builtin_saveregs
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Given a CONST, return true if the symbol_ref points to small data. */
info_ptr->regs[STACK_REGS_STDARG].special_p = 1;
info_ptr->regs[STACK_REGS_STRUCT].name = "struct";
- info_ptr->regs[STACK_REGS_STRUCT].first = STRUCT_VALUE_REGNUM;
- info_ptr->regs[STACK_REGS_STRUCT].last = STRUCT_VALUE_REGNUM;
+ info_ptr->regs[STACK_REGS_STRUCT].first = FRV_STRUCT_VALUE_REGNUM;
+ info_ptr->regs[STACK_REGS_STRUCT].last = FRV_STRUCT_VALUE_REGNUM;
info_ptr->regs[STACK_REGS_STRUCT].special_p = 1;
info_ptr->regs[STACK_REGS_FP].name = "fp";
case STACK_REGS_STRUCT:
if (cfun->returns_struct)
{
- info_ptr->save_p[STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
+ info_ptr->save_p[FRV_STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
size_1word += UNITS_PER_WORD;
}
break;
if (cfun->returns_struct)
{
- info_ptr->save_p[STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
- info_ptr->reg_offset[STRUCT_VALUE_REGNUM] = offset + UNITS_PER_WORD;
+ info_ptr->save_p[FRV_STRUCT_VALUE_REGNUM] = REG_SAVE_1WORD;
+ info_ptr->reg_offset[FRV_STRUCT_VALUE_REGNUM] = offset + UNITS_PER_WORD;
info_ptr->regs[STACK_REGS_STRUCT].size_1word = UNITS_PER_WORD;
}
If this macro is not defined, the compiler will output an ordinary call to
the library function `__builtin_saveregs'. */
-rtx
+static rtx
frv_expand_builtin_saveregs (void)
{
int offset = UNITS_PER_WORD * FRV_NUM_ARG_REGS;
assemble_align (POINTER_SIZE);
assemble_integer_with_op ("\t.picptr\t", symbol);
}
+
+/* Worker function for TARGET_STRUCT_VALUE_RTX. */
+
+static rtx
+frv_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+ int incoming ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (Pmode, FRV_STRUCT_VALUE_REGNUM);
+}
/* Target macros for the FRV port of GCC.
- Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Contributed by Red Hat Inc.
This file is part of GCC.
(Actually, on most machines, scalar values are returned in the same place
regardless of mode).
- If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same promotion
- rules specified in `PROMOTE_MODE' if VALTYPE is a scalar type.
+ If `TARGET_PROMOTE_FUNCTION_RETURN' is defined to return true, you
+ must apply the same promotion rules specified in `PROMOTE_MODE' if
+ VALTYPE is a scalar type.
If the precise function being called is known, FUNC is a tree node
(`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This makes it
functions when all their calls are known.
`FUNCTION_VALUE' is not used for return vales with aggregate data types,
- because these are returned in another way. See `STRUCT_VALUE_REGNUM' and
- related macros, below. */
+ because these are returned in another way. See
+ `TARGET_STRUCT_VALUE_RTX' and related macros, below. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx (REG, TYPE_MODE (VALTYPE), RETURN_VALUE_REGNUM)
\f
/* How Large Values are Returned. */
-/* If the structure value address is passed in a register, then
- `STRUCT_VALUE_REGNUM' should be the number of that register. */
-#define STRUCT_VALUE_REGNUM (GPR_FIRST + 3)
+/* The number of the register that is used to to pass the structure
+ value address. */
+#define FRV_STRUCT_VALUE_REGNUM (GPR_FIRST + 3)
\f
/* Function Entry and Exit. */
\f
/* Implementing the Varargs Macros. */
-/* If defined, is a C expression that produces the machine-specific code for a
- call to `__builtin_saveregs'. This code will be moved to the very beginning
- of the function, before any parameter access are made. The return value of
- this function should be an RTX that contains the value to use as the return
- of `__builtin_saveregs'.
-
- If this macro is not defined, the compiler will output an ordinary call to
- the library function `__builtin_saveregs'. */
-
-#define EXPAND_BUILTIN_SAVEREGS() frv_expand_builtin_saveregs ()
-
/* 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 target hook `TARGET_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