+Tue Aug 25 13:19:46 1998 Dave Brolley <brolley@cygnus.com>
+
+ * regclass.c (regclass): Use xmalloc/free instead of alloca.
+ * stupid.c (stupid_life_analysis): Ditto.
+ * reload1.c (reload): Ditto.
+
Tue Aug 25 05:48:18 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
* config/sparc/sparc.c (arith_4096_operand, arith_add_operand,
init_recog ();
- costs = (struct costs *) alloca (nregs * sizeof (struct costs));
+ costs = (struct costs *) xmalloc (nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
}
}
#endif /* REGISTER_CONSTRAINTS */
+
+ free (costs);
}
\f
#ifdef REGISTER_CONSTRAINTS
Record memory equivalents in reg_mem_equiv so they can
be substituted eventually by altering the REG-rtx's. */
- reg_equiv_constant = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_constant = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_constant, max_regno * sizeof (rtx));
- reg_equiv_memory_loc = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_memory_loc = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_memory_loc, max_regno * sizeof (rtx));
- reg_equiv_mem = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_mem = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_mem, max_regno * sizeof (rtx));
- reg_equiv_init = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_init = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_init, max_regno * sizeof (rtx));
- reg_equiv_address = (rtx *) alloca (max_regno * sizeof (rtx));
+ reg_equiv_address = (rtx *) xmalloc (max_regno * sizeof (rtx));
bzero ((char *) reg_equiv_address, max_regno * sizeof (rtx));
- reg_max_ref_width = (int *) alloca (max_regno * sizeof (int));
+ reg_max_ref_width = (int *) xmalloc (max_regno * sizeof (int));
bzero ((char *) reg_max_ref_width, max_regno * sizeof (int));
if (SMALL_REGISTER_CLASSES)
{
free (real_known_ptr);
free (real_at_ptr);
- return;
+ free (reg_equiv_constant);
+ free (reg_equiv_memory_loc);
+ free (reg_equiv_mem);
+ free (reg_equiv_init);
+ free (reg_equiv_address);
+ free (reg_max_ref_width);
+ return 0;
}
#endif
free (scratch_block);
scratch_block = 0;
+ free (reg_equiv_constant);
+ free (reg_equiv_memory_loc);
+ free (reg_equiv_mem);
+ free (reg_equiv_init);
+ free (reg_equiv_address);
+ free (reg_max_ref_width);
+
CLEAR_HARD_REG_SET (used_spill_regs);
for (i = 0; i < n_spills; i++)
SET_HARD_REG_BIT (used_spill_regs, spill_regs[i]);
bzero (regs_ever_live, sizeof regs_ever_live);
- regs_live = (char *) alloca (nregs);
+ regs_live = (char *) xmalloc (nregs);
/* First find the last real insn, and count the number of insns,
and assign insns their suids. */
i = INSN_UID (insn);
max_uid = i + 1;
- uid_suid = (int *) alloca ((i + 1) * sizeof (int));
+ uid_suid = (int *) xmalloc ((i + 1) * sizeof (int));
/* Compute the mapping from uids to suids.
Suids are numbers assigned to insns, like uids,
/* Allocate tables to record info about regs. */
- reg_where_dead = (int *) alloca (nregs * sizeof (int));
+ reg_where_dead = (int *) xmalloc (nregs * sizeof (int));
bzero ((char *) reg_where_dead, nregs * sizeof (int));
- reg_where_born = (int *) alloca (nregs * sizeof (int));
+ reg_where_born = (int *) xmalloc (nregs * sizeof (int));
bzero ((char *) reg_where_born, nregs * sizeof (int));
- reg_order = (int *) alloca (nregs * sizeof (int));
+ reg_order = (int *) xmalloc (nregs * sizeof (int));
bzero ((char *) reg_order, nregs * sizeof (int));
- regs_change_size = (char *) alloca (nregs * sizeof (char));
+ regs_change_size = (char *) xmalloc (nregs * sizeof (char));
bzero ((char *) regs_change_size, nregs * sizeof (char));
- regs_crosses_setjmp = (char *) alloca (nregs * sizeof (char));
+ regs_crosses_setjmp = (char *) xmalloc (nregs * sizeof (char));
bzero ((char *) regs_crosses_setjmp, nregs * sizeof (char));
/* Allocate the reg_renumber array */
reg_renumber[i] = i;
after_insn_hard_regs
- = (HARD_REG_SET *) alloca (max_suid * sizeof (HARD_REG_SET));
+ = (HARD_REG_SET *) xmalloc (max_suid * sizeof (HARD_REG_SET));
bzero ((char *) after_insn_hard_regs, max_suid * sizeof (HARD_REG_SET));
if (file)
dump_flow_info (file);
+
+ free (regs_live);
+ free (uid_suid);
+ free (reg_where_dead);
+ free (reg_where_born);
+ free (reg_order);
+ free (regs_change_size);
+ free (regs_crosses_setjmp);
+ free (after_insn_hard_regs);
}
/* Comparison function for qsort.