aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Brolley <brolley@cygnus.com>1998-08-25 11:02:51 +0000
committerDave Brolley <brolley@gcc.gnu.org>1998-08-25 07:02:51 -0400
commit56a65848be386e259d3af5b099afbe83d078d6db (patch)
treebe9b4cfb8c41132f388bc870d0c9b533cdb592ee
parent5d6d333901aacf4485d6dc5f3b4a24d358c4edde (diff)
downloadgcc-56a65848be386e259d3af5b099afbe83d078d6db.zip
gcc-56a65848be386e259d3af5b099afbe83d078d6db.tar.gz
gcc-56a65848be386e259d3af5b099afbe83d078d6db.tar.bz2
re PR target/16300 (Bug in vendor /usr/include/net/if.h needs fixincluding)
PR gcc/16300 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. From-SVN: r21964
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/regclass.c4
-rw-r--r--gcc/reload1.c27
-rw-r--r--gcc/stupid.c25
4 files changed, 46 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d1e50cf..0a12902 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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,
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 293b7c3..ac17dfe 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -726,7 +726,7 @@ regclass (f, nregs)
init_recog ();
- costs = (struct costs *) alloca (nregs * sizeof (struct costs));
+ costs = (struct costs *) xmalloc (nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
@@ -1067,6 +1067,8 @@ regclass (f, nregs)
}
}
#endif /* REGISTER_CONSTRAINTS */
+
+ free (costs);
}
#ifdef REGISTER_CONSTRAINTS
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 309fbe3..ae829f7 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -619,17 +619,17 @@ reload (first, global, dumpfile)
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)
@@ -799,7 +799,13 @@ reload (first, global, dumpfile)
{
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
@@ -2176,6 +2182,13 @@ reload (first, global, dumpfile)
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]);
diff --git a/gcc/stupid.c b/gcc/stupid.c
index 718c39b..dbb0ffe 100644
--- a/gcc/stupid.c
+++ b/gcc/stupid.c
@@ -135,7 +135,7 @@ stupid_life_analysis (f, nregs, file)
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. */
@@ -145,7 +145,7 @@ stupid_life_analysis (f, nregs, file)
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,
@@ -168,19 +168,19 @@ stupid_life_analysis (f, nregs, file)
/* 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 */
@@ -189,7 +189,7 @@ stupid_life_analysis (f, nregs, file)
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));
@@ -316,6 +316,15 @@ stupid_life_analysis (f, nregs, file)
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.