diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-01-26 15:32:42 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-01-26 15:32:42 +0000 |
commit | 351a758bd93d01a6782e922b3c094121ada93a0b (patch) | |
tree | 77ea786667d21beed217b66f970e3935d885b66c /gcc | |
parent | 26fd4eae69871cb45835bea5c0ce35657415cf15 (diff) | |
download | gcc-351a758bd93d01a6782e922b3c094121ada93a0b.zip gcc-351a758bd93d01a6782e922b3c094121ada93a0b.tar.gz gcc-351a758bd93d01a6782e922b3c094121ada93a0b.tar.bz2 |
ia64-protos.h: Remove the prototype for ia64_setup_incoming_varargs and ia64_return_in_memory.
* 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.
From-SVN: r76635
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 20 | ||||
-rw-r--r-- | gcc/config/ia64/ia64-protos.h | 5 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 72 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.h | 42 |
4 files changed, 81 insertions, 58 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index af75fc1..757afc5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +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 diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h index c6920fa..50456a6 100644 --- a/gcc/config/ia64/ia64-protos.h +++ b/gcc/config/ia64/ia64-protos.h @@ -1,5 +1,5 @@ /* 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. @@ -114,15 +114,12 @@ extern rtx ia64_va_arg (tree, tree); 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 */ diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index a0af1b4..b97dcd2 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1,5 +1,6 @@ /* 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>. @@ -182,7 +183,10 @@ static rtx gen_fr_spill_x (rtx, rtx, rtx); 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); @@ -260,6 +264,7 @@ static void ia64_vms_init_libfuncs (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); /* Table of valid machine attributes. */ @@ -366,6 +371,34 @@ static const struct attribute_spec ia64_attribute_table[] = #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; /* Return 1 if OP is a valid operand for the MEM of a CALL insn. */ @@ -3375,17 +3408,19 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain) 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; } @@ -3846,8 +3881,8 @@ ia64_va_arg (tree valist, tree type) /* 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; @@ -3859,7 +3894,7 @@ ia64_return_in_memory (tree valtype) { 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. */ @@ -3870,14 +3905,14 @@ ia64_return_in_memory (tree valtype) 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. */ @@ -8803,4 +8838,13 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, 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" diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 84e8649..e9fd52a 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -1,5 +1,6 @@ /* 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>. @@ -344,12 +345,6 @@ do \ } \ 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 @@ -1267,13 +1262,6 @@ enum reg_class /* 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'. */ @@ -1434,22 +1422,11 @@ do { \ /* 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) - /* Caller-Saves Register Allocation */ @@ -1524,21 +1501,6 @@ do { \ fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE); \ } while (0) -/* 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 - - /* Trampolines for Nested Functions. */ /* We need 32 bytes, so we can save the sp, ar.rnat, ar.bsp, and ar.pfs of |