+2004-01-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/ia64/ia64-protos.h: Remove the prototype for
+ ia64_setup_incoming_varargs and ia64_return_in_memory.
+ * config/ia64/ia64.c (TARGET_STRUCT_VALUE_RTX): New.
+ (TARGET_RETURN_IN_MEMORY): Likewise.
+ (TARGET_SETUP_INCOMING_VARARGS): Likewise.
+ (TARGET_STRICT_ARGUMENT_NAMING): Likewise.
+ (ia64_setup_incoming_varargs): Adjust the arguments to meet
+ the requirement of TARGET_SETUP_INCOMING_VARARGS.
+ (ia64_return_in_memory): Make it static. Change the return
+ type to bool from int. Add an argument.
+ (ia64_struct_value_rtx): New.
+ * config/ia64/ia64.h: Remove commented-out definitions of
+ PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, and
+ PROMOTE_PROTOTYPES.
+ (RETURN_IN_MEMORY): Remove.
+ (STRUCT_VALUE_REGNUM): Likewise.
+ (STRICT_ARGUMENT_NAMING): Likewise.
+
2004-01-26 Eric Botcazou <ebotcazou@libertysurf.fr>
PR target/13666
/* Definitions of target machine for GNU compiler for IA-64.
- Copyright (C) 1999, 2000, 2002, 2003
+ Copyright (C) 1999, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
extern rtx ia64_function_value (tree, tree);
#endif /* RTX_CODE */
-extern void ia64_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree,
- int *, int);
extern int ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
tree, int);
extern int ia64_function_arg_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
-extern int ia64_return_in_memory (tree);
extern void ia64_asm_output_external (FILE *, tree, const char *);
#endif /* TREE_CODE */
/* Definitions of target machine for GNU compiler.
- 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 James E. Wilson <wilson@cygnus.com> and
David Mosberger <davidm@hpl.hp.com>.
static rtx gen_fr_restore_x (rtx, rtx, rtx);
static enum machine_mode hfa_element_mode (tree, int);
+static void ia64_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int *, int);
static bool ia64_function_ok_for_sibcall (tree, tree);
+static bool ia64_return_in_memory (tree, tree);
static bool ia64_rtx_costs (rtx, int, int, int *);
static void fix_range (const char *);
static struct machine_function * ia64_init_machine_status (void);
static tree ia64_handle_model_attribute (tree *, tree, tree, int, bool *);
static void ia64_encode_section_info (tree, rtx, int);
+static rtx ia64_struct_value_rtx (tree, int);
\f
/* Table of valid machine attributes. */
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO ia64_encode_section_info
+/* ??? ABI doesn't allow us to define this. */
+#if 0
+#undef TARGET_PROMOTE_FUNCTION_ARGS
+#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true
+#endif
+
+/* ??? ABI doesn't allow us to define this. */
+#if 0
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
+#endif
+
+/* ??? Investigate. */
+#if 0
+#undef TARGET_PROMOTE_PROTOTYPES
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
+#endif
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX ia64_struct_value_rtx
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY ia64_return_in_memory
+
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS ia64_setup_incoming_varargs
+#undef TARGET_STRICT_ARGUMENT_NAMING
+#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */
We generate the actual spill instructions during prologue generation. */
-void
-ia64_setup_incoming_varargs (CUMULATIVE_ARGS cum, int int_mode, tree type,
- int * pretend_size,
+static void
+ia64_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int * pretend_size,
int second_time ATTRIBUTE_UNUSED)
{
+ CUMULATIVE_ARGS next_cum = *cum;
+
/* Skip the current argument. */
- ia64_function_arg_advance (&cum, int_mode, type, 1);
+ ia64_function_arg_advance (&next_cum, mode, type, 1);
- if (cum.words < MAX_ARGUMENT_SLOTS)
+ if (next_cum.words < MAX_ARGUMENT_SLOTS)
{
- int n = MAX_ARGUMENT_SLOTS - cum.words;
+ int n = MAX_ARGUMENT_SLOTS - next_cum.words;
*pretend_size = n * UNITS_PER_WORD;
cfun->machine->n_varargs = n;
}
/* Return 1 if function return value returned in memory. Return 0 if it is
in a register. */
-int
-ia64_return_in_memory (tree valtype)
+static bool
+ia64_return_in_memory (tree valtype, tree fntype ATTRIBUTE_UNUSED)
{
enum machine_mode mode;
enum machine_mode hfa_mode;
{
byte_size = int_size_in_bytes (valtype);
if (byte_size < 0)
- return 1;
+ return true;
}
/* Hfa's with up to 8 elements are returned in the FP argument registers. */
int hfa_size = GET_MODE_SIZE (hfa_mode);
if (byte_size / hfa_size > MAX_ARGUMENT_SLOTS)
- return 1;
+ return true;
else
- return 0;
+ return false;
}
else if (byte_size > UNITS_PER_WORD * MAX_INT_RETURN_SLOTS)
- return 1;
+ return true;
else
- return 0;
+ return false;
}
/* Return rtx for register that holds the function return value. */
no_new_pseudos = 0;
}
+/* Worker function for TARGET_STRUCT_VALUE_RTX. */
+
+static rtx
+ia64_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+ int incoming ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (Pmode, GR_REG (8));
+}
+
#include "gt-ia64.h"
/* Definitions of target machine GNU compiler. IA-64 version.
- 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 James E. Wilson <wilson@cygnus.com> and
David Mosberger <davidm@hpl.hp.com>.
} \
while (0)
-/* ??? ABI doesn't allow us to define this. */
-/* #define PROMOTE_FUNCTION_ARGS */
-
-/* ??? ABI doesn't allow us to define this. */
-/* #define PROMOTE_FUNCTION_RETURN */
-
#define PARM_BOUNDARY 64
/* Define this macro if you wish to preserve a certain alignment for the stack
\f
/* Passing Function Arguments on the Stack */
-/* Define this macro if an argument declared in a prototype as an integral type
- smaller than `int' should actually be passed as an `int'. In addition to
- avoiding errors in certain cases of mismatch, it also makes for better code
- on certain machines. */
-/* ??? Investigate. */
-/* #define PROMOTE_PROTOTYPES */
-
/* If defined, the maximum amount of space required for outgoing arguments will
be computed and placed into the variable
`current_function_outgoing_args_size'. */
\f
/* How Large Values are Returned */
-/* A nonzero value says to return the function value in memory, just as large
- structures are always returned. */
-
-#define RETURN_IN_MEMORY(TYPE) \
- ia64_return_in_memory (TYPE)
-
/* If you define this macro to be 0, then the conventions used for structure
and union return values are decided by the `RETURN_IN_MEMORY' macro. */
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* 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 GR_REG (8)
-
\f
/* Caller-Saves Register Allocation */
fputs ("\tmov out2 = b0\n", FILE); \
fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE); \
} while (0)
-\f
-/* Implementing the Varargs Macros. */
-
-/* Define this macro to store the anonymous register arguments into the stack
- so that all the arguments appear to have been passed consecutively on the
- stack. */
-
-#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
- ia64_setup_incoming_varargs (ARGS_SO_FAR, MODE, TYPE, & PRETEND_ARGS_SIZE, SECOND_TIME)
-
-/* Define this macro if the location where a function argument is passed
- depends on whether or not it is a named argument. */
-
-#define STRICT_ARGUMENT_NAMING 1
-
\f
/* Trampolines for Nested Functions. */