Commit 26a110f5 by Richard Henderson Committed by Richard Henderson

ia64.h (struct machine_function): Add n_varargs.

        * config/ia64/ia64.h (struct machine_function): Add n_varargs.
        * config/ia64/ia64.c (ia64_compute_frame_size): Use it.
        (ia64_expand_prologue): Likewise.
        (ia64_setup_incoming_varargs): Set it.  Properly skip the current
        argument for stdargs.

From-SVN: r35994
parent ecff20d4
2000-08-25 Richard Henderson <rth@cygnus.com>
* config/ia64/ia64.h (struct machine_function): Add n_varargs.
* config/ia64/ia64.c (ia64_compute_frame_size): Use it.
(ia64_expand_prologue): Likewise.
(ia64_setup_incoming_varargs): Set it. Properly skip the current
argument for stdargs.
2000-08-25 Jason Merrill <jason@redhat.com> 2000-08-25 Jason Merrill <jason@redhat.com>
* integrate.c (expand_inline_function): Pull out the original decl. * integrate.c (expand_inline_function): Pull out the original decl.
......
...@@ -1183,7 +1183,7 @@ ia64_compute_frame_size (size) ...@@ -1183,7 +1183,7 @@ ia64_compute_frame_size (size)
break; break;
current_frame_info.n_local_regs = regno - LOC_REG (0) + 1; current_frame_info.n_local_regs = regno - LOC_REG (0) + 1;
if (current_function_varargs || current_function_stdarg) if (cfun->machine->n_varargs > 0)
current_frame_info.n_input_regs = 8; current_frame_info.n_input_regs = 8;
else else
{ {
...@@ -1323,7 +1323,7 @@ ia64_compute_frame_size (size) ...@@ -1323,7 +1323,7 @@ ia64_compute_frame_size (size)
/* If we're forced to use st8.spill, we're forced to save and restore /* If we're forced to use st8.spill, we're forced to save and restore
ar.unat as well. */ ar.unat as well. */
if (spilled_gr_p || current_function_varargs || current_function_stdarg) if (spilled_gr_p || cfun->machine->n_varargs)
{ {
SET_HARD_REG_BIT (mask, AR_UNAT_REGNUM); SET_HARD_REG_BIT (mask, AR_UNAT_REGNUM);
current_frame_info.reg_save_ar_unat = find_gr_spill (spill_size == 0); current_frame_info.reg_save_ar_unat = find_gr_spill (spill_size == 0);
...@@ -1782,7 +1782,7 @@ ia64_expand_prologue () ...@@ -1782,7 +1782,7 @@ ia64_expand_prologue ()
/* Set up frame pointer, stack pointer, and spill iterators. */ /* Set up frame pointer, stack pointer, and spill iterators. */
n_varargs = current_function_pretend_args_size / UNITS_PER_WORD; n_varargs = cfun->machine->n_varargs;
setup_spill_pointers (current_frame_info.n_spilled + n_varargs, setup_spill_pointers (current_frame_info.n_spilled + n_varargs,
stack_pointer_rtx, 0); stack_pointer_rtx, 0);
...@@ -2437,17 +2437,21 @@ ia64_initialize_trampoline (addr, fnaddr, static_chain) ...@@ -2437,17 +2437,21 @@ ia64_initialize_trampoline (addr, fnaddr, static_chain)
void void
ia64_setup_incoming_varargs (cum, int_mode, type, pretend_size, second_time) ia64_setup_incoming_varargs (cum, int_mode, type, pretend_size, second_time)
CUMULATIVE_ARGS cum; CUMULATIVE_ARGS cum;
int int_mode ATTRIBUTE_UNUSED; int int_mode;
tree type ATTRIBUTE_UNUSED; tree type;
int * pretend_size; int * pretend_size;
int second_time ATTRIBUTE_UNUSED; int second_time ATTRIBUTE_UNUSED;
{ {
/* If this is a stdarg function, then don't save the current argument. */ /* If this is a stdarg function, then skip the current argument. */
int offset = ! current_function_varargs; if (! current_function_varargs)
ia64_function_arg_advance (&cum, int_mode, type, 1);
if (cum.words < MAX_ARGUMENT_SLOTS) if (cum.words < MAX_ARGUMENT_SLOTS)
*pretend_size = ((MAX_ARGUMENT_SLOTS - cum.words - offset) {
* UNITS_PER_WORD); int n = MAX_ARGUMENT_SLOTS - cum.words;
*pretend_size = n * UNITS_PER_WORD;
cfun->machine->n_varargs = n;
}
} }
/* Check whether TYPE is a homogeneous floating point aggregate. If /* Check whether TYPE is a homogeneous floating point aggregate. If
......
...@@ -2795,6 +2795,9 @@ struct machine_function ...@@ -2795,6 +2795,9 @@ struct machine_function
/* The GP value save register. */ /* The GP value save register. */
struct rtx_def* ia64_gp_save; struct rtx_def* ia64_gp_save;
/* The number of varargs registers to save. */
int n_varargs;
}; };
......
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