+2001-01-09 Nick Clifton <nickc@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_sysv_varargs_p): Delete.
+ (setup_incoming_varargs): Use sysv_varargs_p field of the
+ cfun->machine structure.
+ (struct machine_function): Move to rs6000.h
+ (rs6000_save_machine_status): Delete.
+ (rs6000_restore_machine_status): Delete.
+ (rs6000_init_machine_status): New Function.
+ (rs6000_free_machine_status): New Function.
+ (rs6000_init_expanders): Use new functions.
+
+ * config/rs6000/rs6000.h (rs6000_sysv_varargs_p): Delete
+ export.
+ (struct machine_function): Move here.
+
+ * config/rs6000/sysv4.h (RS6000_VARARGS_AREA): Use
+ sysv_varargs_p field of the cfun->machine structure.
+
+ * config/rs6000/rs6000-protos.h (rs6000_save_machine_status):
+ Remove prototype.
+ (rs6000_restore_machine_status): Remove prototype.
+
2001-01-09 Richard Henderson <rth@redhat.com>
* sched-int.h (struct deps): Add max_reg, reg_last_in_use; merge
struct rtx_def *d30v_compare_op0;
struct rtx_def *d30v_compare_op1;
-/* Define the information needed to modify the epilogue for EH. */
-
-rtx d30v_eh_epilogue_sp_ofs;
-
/* Cached value of d30v_stack_info */
static d30v_stack_t *d30v_stack_cache = (d30v_stack_t *)0;
-/* Cache for __builtin_return_addr */
-static rtx d30v_return_addr_rtx;
-
/* Values of the -mbranch-cost=n string. */
int d30v_branch_cost = D30V_DEFAULT_BRANCH_COST;
const char *d30v_branch_cost_string = (const char *)0;
for (i = GPR_FIRST; i <= GPR_LAST; i++)
if (info->save_p[i] == 1)
{
- if (d30v_eh_epilogue_sp_ofs && i == GPR_LINK)
+ if (cfun->machine->eh_epilogue_sp_ofs && i == GPR_LINK)
extra_stack = 4;
else
{
if (extra_stack)
{
- if (d30v_eh_epilogue_sp_ofs)
- emit_insn (gen_addsi3 (d30v_eh_epilogue_sp_ofs,
- d30v_eh_epilogue_sp_ofs,
+ if (cfun->machine->eh_epilogue_sp_ofs)
+ emit_insn (gen_addsi3 (cfun->machine->eh_epilogue_sp_ofs,
+ cfun->machine->eh_epilogue_sp_ofs,
GEN_INT (extra_stack)));
else
emit_insn (gen_addsi3 (sp, sp, GEN_INT (extra_stack)));
}
- if (d30v_eh_epilogue_sp_ofs)
- emit_insn (gen_addsi3 (sp, sp, d30v_eh_epilogue_sp_ofs));
+ if (cfun->machine->eh_epilogue_sp_ofs)
+ emit_insn (gen_addsi3 (sp, sp, cfun->machine->eh_epilogue_sp_ofs));
/* Now emit the return instruction. */
emit_jump_insn (gen_rtx_RETURN (VOIDmode));
}
\f
-/* Functions to save and restore d30v_return_addr_rtx. */
-
-struct machine_function
-{
- rtx ra_rtx;
-};
+/* Routine to allocate, mark and free a per-function,
+ machine specific structure. */
static void
-d30v_save_machine_status (p)
+d30v_init_machine_status (p)
struct function *p;
{
- struct machine_function *machine =
+ p->machine =
(struct machine_function *) xmalloc (sizeof (struct machine_function));
+}
- p->machine = machine;
- machine->ra_rtx = d30v_return_addr_rtx;
+static void
+d30v_mark_machine_status (p)
+ struct function * p;
+{
+ if (p->machine == NULL)
+ return;
+
+ ggc_mark_rtx (p->machine->ra_rtx);
+ ggc_mark_rtx (p->machine->eh_epilogue_sp_ofs);
}
static void
-d30v_restore_machine_status (p)
+d30v_free_machine_status (p)
struct function *p;
{
struct machine_function *machine = p->machine;
- d30v_return_addr_rtx = machine->ra_rtx;
+ if (machine == NULL)
+ return;
free (machine);
- p->machine = (struct machine_function *)0;
+ p->machine = NULL;
}
/* Do anything needed before RTL is emitted for each function. */
void
d30v_init_expanders ()
{
- d30v_return_addr_rtx = NULL_RTX;
- d30v_eh_epilogue_sp_ofs = NULL_RTX;
-
/* Arrange to save and restore machine status around nested functions. */
- save_machine_status = d30v_save_machine_status;
- restore_machine_status = d30v_restore_machine_status;
+ init_machine_status = d30v_init_machine_status;
+ mark_machine_status = d30v_mark_machine_status;
+ free_machine_status = d30v_free_machine_status;
}
/* Find the current function's return address.
{
rtx ret;
- if ((ret = d30v_return_addr_rtx) == NULL)
+ ret = cfun->machine->ra_rtx;
+
+ if (ret == NULL)
{
rtx init;
- d30v_return_addr_rtx = ret = gen_reg_rtx (Pmode);
+ cfun->machine->ra_rtx = ret = gen_reg_rtx (Pmode);
init = gen_rtx (SET, VOIDmode, ret, gen_rtx (REG, Pmode, GPR_LINK));
push_topmost_sequence ();
{
ggc_add_rtx_root (&d30v_compare_op0, 1);
ggc_add_rtx_root (&d30v_compare_op1, 1);
- ggc_add_rtx_root (&d30v_eh_epilogue_sp_ofs, 1);
- ggc_add_rtx_root (&d30v_return_addr_rtx, 1);
}