(override_options): Install it.
(alpha_mark_machine_status): Verify machine non-null.
* config/i386/i386.c (ix86_free_machine_status): New.
(override_options): Install it.
(ix86_init_machine_status): Use xcalloc.
(ix86_mark_machine_status): Verify machine non-null.
* config/ia64/ia64.c (ia64_free_machine_status): New.
(ia64_override_options): Install it.
(ia64_mark_machine_status): Verify machine non-null.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38877
138bc75d-0d04-0410-961f-
82ee72b054a4
+2001-01-10 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_free_machine_status): New.
+ (override_options): Install it.
+ (alpha_mark_machine_status): Verify machine non-null.
+ * config/i386/i386.c (ix86_free_machine_status): New.
+ (override_options): Install it.
+ (ix86_init_machine_status): Use xcalloc.
+ (ix86_mark_machine_status): Verify machine non-null.
+ * config/ia64/ia64.c (ia64_free_machine_status): New.
+ (ia64_override_options): Install it.
+ (ia64_mark_machine_status): Verify machine non-null.
+
Wed Jan 10 11:34:39 2001 Jeffrey A Law (law@cygnus.com)
* function.c (instantiate_virtual_regs): Instantiate virtual
PARAMS ((struct function *p));
static void alpha_mark_machine_status
PARAMS ((struct function *p));
+static void alpha_free_machine_status
+ PARAMS ((struct function *p));
static int alpha_ra_ever_killed
PARAMS ((void));
static rtx set_frame_related_p
/* Set up function hooks. */
init_machine_status = alpha_init_machine_status;
mark_machine_status = alpha_mark_machine_status;
+ free_machine_status = alpha_free_machine_status;
}
\f
/* Returns 1 if VALUE is a mask that contains full bytes of zero or ones. */
{
struct machine_function *machine = p->machine;
- ggc_mark_rtx (machine->eh_epilogue_sp_ofs);
- ggc_mark_rtx (machine->ra_rtx);
+ if (machine)
+ {
+ ggc_mark_rtx (machine->eh_epilogue_sp_ofs);
+ ggc_mark_rtx (machine->ra_rtx);
+ }
+}
+
+static void
+alpha_free_machine_status (p)
+ struct function *p;
+{
+ free (p->machine);
+ p->machine = NULL;
}
/* Start the ball rolling with RETURN_ADDR_RTX. */
rtx));
static void ix86_init_machine_status PARAMS ((struct function *));
static void ix86_mark_machine_status PARAMS ((struct function *));
+static void ix86_free_machine_status PARAMS ((struct function *));
static int ix86_split_to_parts PARAMS ((rtx, rtx *, enum machine_mode));
static int ix86_safe_length_prefix PARAMS ((rtx));
static HOST_WIDE_INT ix86_compute_frame_size PARAMS((HOST_WIDE_INT,
/* Arrange to set up i386_stack_locals for all functions. */
init_machine_status = ix86_init_machine_status;
mark_machine_status = ix86_mark_machine_status;
+ free_machine_status = ix86_free_machine_status;
/* Validate registers in register allocation order. */
if (ix86_reg_alloc_order)
ix86_init_machine_status (p)
struct function *p;
{
- enum machine_mode mode;
- int n;
- p->machine
- = (struct machine_function *) xmalloc (sizeof (struct machine_function));
-
- for (mode = VOIDmode; (int) mode < (int) MAX_MACHINE_MODE;
- mode = (enum machine_mode) ((int) mode + 1))
- for (n = 0; n < MAX_386_STACK_LOCALS; n++)
- ix86_stack_locals[(int) mode][n] = NULL_RTX;
+ p->machine = (struct machine_function *)
+ xcalloc (1, sizeof (struct machine_function));
}
/* Mark machine specific bits of P for GC. */
ix86_mark_machine_status (p)
struct function *p;
{
+ struct machine_function *machine = p->machine;
enum machine_mode mode;
int n;
+ if (! machine)
+ return;
+
for (mode = VOIDmode; (int) mode < (int) MAX_MACHINE_MODE;
mode = (enum machine_mode) ((int) mode + 1))
for (n = 0; n < MAX_386_STACK_LOCALS; n++)
- ggc_mark_rtx (p->machine->stack_locals[(int) mode][n]);
+ ggc_mark_rtx (machine->stack_locals[(int) mode][n]);
+}
+
+static void
+ix86_free_machine_status (p)
+ struct function *p;
+{
+ free (p->machine);
+ p->machine = NULL;
}
/* Return a MEM corresponding to a stack slot with mode MODE.
static void ia64_add_gc_roots PARAMS ((void));
static void ia64_init_machine_status PARAMS ((struct function *));
static void ia64_mark_machine_status PARAMS ((struct function *));
+static void ia64_free_machine_status PARAMS ((struct function *));
static void emit_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_all_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_predicate_relation_info PARAMS ((void));
ia64_mark_machine_status (p)
struct function *p;
{
- ggc_mark_rtx (p->machine->ia64_eh_epilogue_sp);
- ggc_mark_rtx (p->machine->ia64_eh_epilogue_bsp);
- ggc_mark_rtx (p->machine->ia64_gp_save);
+ struct machine_function *machine = p->machine;
+
+ if (machine)
+ {
+ ggc_mark_rtx (machine->ia64_eh_epilogue_sp);
+ ggc_mark_rtx (machine->ia64_eh_epilogue_bsp);
+ ggc_mark_rtx (machine->ia64_gp_save);
+ }
}
+static void
+ia64_free_machine_status (p)
+ struct function *p;
+{
+ free (p->machine);
+ p->machine = NULL;
+}
/* Handle TARGET_OPTIONS switches. */
init_machine_status = ia64_init_machine_status;
mark_machine_status = ia64_mark_machine_status;
+ free_machine_status = ia64_free_machine_status;
ia64_add_gc_roots ();
}