Commit c328adfa by John David Anglin Committed by John David Anglin

pa-protos.h (function_arg): Remove last argument.

	PR/10271
	* pa-protos.h (function_arg): Remove last argument.
	* pa.c (function_arg): Likewise.  Use CUMULATIVE_ARGS struct instead.
	* pa.h (struct hppa_args): Add member incoming.
	(INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Initialize
	member incoming.
	(FUNCTION_ARG): Revise call to function_arg.
	(FUNCTION_INCOMING_ARG): Delete.

From-SVN: r65687
parent 771aa05a
2003-04-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR/10271
* pa-protos.h (function_arg): Remove last argument.
* pa.c (function_arg): Likewise. Use CUMULATIVE_ARGS struct instead.
* pa.h (struct hppa_args): Add member incoming.
(INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Initialize
member incoming.
(FUNCTION_ARG): Revise call to function_arg.
(FUNCTION_INCOMING_ARG): Delete.
2003-04-15 Zack Weinberg <zack@codesourcery.com> 2003-04-15 Zack Weinberg <zack@codesourcery.com>
* configure.in: Unify the code which creates symlinks to a * configure.in: Unify the code which creates symlinks to a
......
...@@ -160,7 +160,7 @@ extern int cmpib_comparison_operator PARAMS ((rtx, enum machine_mode)); ...@@ -160,7 +160,7 @@ extern int cmpib_comparison_operator PARAMS ((rtx, enum machine_mode));
extern int reloc_needed PARAMS ((tree)); extern int reloc_needed PARAMS ((tree));
#ifdef RTX_CODE #ifdef RTX_CODE
extern rtx function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, extern rtx function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode,
tree, int, int)); tree, int));
extern rtx function_value PARAMS ((tree, tree)); extern rtx function_value PARAMS ((tree, tree));
#endif #endif
extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
......
...@@ -8246,12 +8246,11 @@ function_value (valtype, func) ...@@ -8246,12 +8246,11 @@ function_value (valtype, func)
??? We might want to restructure this so that it looks more like other ??? We might want to restructure this so that it looks more like other
ports. */ ports. */
rtx rtx
function_arg (cum, mode, type, named, incoming) function_arg (cum, mode, type, named)
CUMULATIVE_ARGS *cum; CUMULATIVE_ARGS *cum;
enum machine_mode mode; enum machine_mode mode;
tree type; tree type;
int named ATTRIBUTE_UNUSED; int named ATTRIBUTE_UNUSED;
int incoming;
{ {
int max_arg_words = (TARGET_64BIT ? 8 : 4); int max_arg_words = (TARGET_64BIT ? 8 : 4);
int alignment = 0; int alignment = 0;
...@@ -8393,7 +8392,7 @@ function_arg (cum, mode, type, named, incoming) ...@@ -8393,7 +8392,7 @@ function_arg (cum, mode, type, named, incoming)
if (((TARGET_PORTABLE_RUNTIME || TARGET_64BIT || TARGET_ELF32) if (((TARGET_PORTABLE_RUNTIME || TARGET_64BIT || TARGET_ELF32)
/* If we are doing soft-float with portable runtime, then there /* If we are doing soft-float with portable runtime, then there
is no need to worry about FP regs. */ is no need to worry about FP regs. */
&& ! TARGET_SOFT_FLOAT && !TARGET_SOFT_FLOAT
/* The parameter must be some kind of float, else we can just /* The parameter must be some kind of float, else we can just
pass it in integer registers. */ pass it in integer registers. */
&& FLOAT_MODE_P (mode) && FLOAT_MODE_P (mode)
...@@ -8402,14 +8401,15 @@ function_arg (cum, mode, type, named, incoming) ...@@ -8402,14 +8401,15 @@ function_arg (cum, mode, type, named, incoming)
/* libcalls do not need to pass items in both FP and general /* libcalls do not need to pass items in both FP and general
registers. */ registers. */
&& type != NULL_TREE && type != NULL_TREE
/* All this hair applies to outgoing args only. */ /* All this hair applies to "outgoing" args only. This includes
&& ! incoming) sibcall arguments setup with FUNCTION_INCOMING_ARG. */
&& !cum->incoming)
/* Also pass outgoing floating arguments in both registers in indirect /* Also pass outgoing floating arguments in both registers in indirect
calls with the 32 bit ABI and the HP assembler since there is no calls with the 32 bit ABI and the HP assembler since there is no
way to the specify argument locations in static functions. */ way to the specify argument locations in static functions. */
|| (! TARGET_64BIT || (!TARGET_64BIT
&& ! TARGET_GAS && !TARGET_GAS
&& ! incoming && !cum->incoming
&& cum->indirect && cum->indirect
&& FLOAT_MODE_P (mode))) && FLOAT_MODE_P (mode)))
{ {
......
...@@ -772,12 +772,21 @@ extern struct rtx_def *hppa_pic_save_rtx PARAMS ((void)); ...@@ -772,12 +772,21 @@ extern struct rtx_def *hppa_pic_save_rtx PARAMS ((void));
and about the args processed so far, enough to enable macros and about the args processed so far, enough to enable macros
such as FUNCTION_ARG to determine where the next arg should go. such as FUNCTION_ARG to determine where the next arg should go.
On the HP-PA, this is a single integer, which is a number of words On the HP-PA, the WORDS field holds the number of words
of arguments scanned so far (including the invisible argument, of arguments scanned so far (including the invisible argument,
if any, which holds the structure-value-address). if any, which holds the structure-value-address). Thus, 4 or
Thus 4 or more means all following args should go on the stack. */ more means all following args should go on the stack.
The INCOMING field tracks whether this is an "incoming" or
"outgoing" argument.
The INDIRECT field indicates whether this is is an indirect
call or not.
The NARGS_PROTOTYPE field indicates that an argument does not
have a prototype when it less than or equal to 0. */
struct hppa_args {int words, nargs_prototype, indirect; }; struct hppa_args {int words, nargs_prototype, incoming, indirect; };
#define CUMULATIVE_ARGS struct hppa_args #define CUMULATIVE_ARGS struct hppa_args
...@@ -787,6 +796,7 @@ struct hppa_args {int words, nargs_prototype, indirect; }; ...@@ -787,6 +796,7 @@ struct hppa_args {int words, nargs_prototype, indirect; };
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL) \ #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL) \
(CUM).words = 0, \ (CUM).words = 0, \
(CUM).incoming = 0, \
(CUM).indirect = (FNTYPE) && !(FNDECL), \ (CUM).indirect = (FNTYPE) && !(FNDECL), \
(CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \ (CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \
? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \ ? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \
...@@ -801,6 +811,7 @@ struct hppa_args {int words, nargs_prototype, indirect; }; ...@@ -801,6 +811,7 @@ struct hppa_args {int words, nargs_prototype, indirect; };
#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,IGNORE) \ #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,IGNORE) \
(CUM).words = 0, \ (CUM).words = 0, \
(CUM).incoming = 1, \
(CUM).indirect = 0, \ (CUM).indirect = 0, \
(CUM).nargs_prototype = 1000 (CUM).nargs_prototype = 1000
...@@ -876,7 +887,7 @@ struct hppa_args {int words, nargs_prototype, indirect; }; ...@@ -876,7 +887,7 @@ struct hppa_args {int words, nargs_prototype, indirect; };
tempted to try and simply it, but I worry about breaking something. */ tempted to try and simply it, but I worry about breaking something. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED, 0) function_arg (&CUM, MODE, TYPE, NAMED)
/* Nonzero if we do not know how to pass TYPE solely in registers. */ /* Nonzero if we do not know how to pass TYPE solely in registers. */
#define MUST_PASS_IN_STACK(MODE,TYPE) \ #define MUST_PASS_IN_STACK(MODE,TYPE) \
...@@ -884,9 +895,6 @@ struct hppa_args {int words, nargs_prototype, indirect; }; ...@@ -884,9 +895,6 @@ struct hppa_args {int words, nargs_prototype, indirect; };
&& (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
|| TREE_ADDRESSABLE (TYPE))) || TREE_ADDRESSABLE (TYPE)))
#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED, 1)
/* For an arg passed partly in registers and partly in memory, /* For an arg passed partly in registers and partly in memory,
this is the number of registers used. this is the number of registers used.
For args passed entirely in registers or entirely in memory, zero. */ For args passed entirely in registers or entirely in memory, zero. */
......
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