+Sun Oct 24 13:14:20 1999 Graham <grahams@rcp.co.uk>
+ Richard Henderson <rth@cygnus.com>
+
+ * alias.c: Include ggc.h.
+ (reg_base_value, new_reg_base_value, reg_base_value_size): Make static.
+ (record_set): Verify enough room in reg_base_value.
+ (init_alias_analysis): Allocate reg_base_value with xcalloc.
+ Register it as a GC root.
+ (end_alias_analysis): Free reg_base_value. Remove it as a GC root.
+ * Makefile.in (alias.o): Depend on ggc.h.
+
+ * unroll.c (unroll_loop): Verify the insn before a barrier
+ is a JUMP_INSN before checking JUMP_LABEL.
+
Sun Oct 24 15:46:44 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* mips/bsd-5.h (ASM_OUTPUT_ASCII): Constify a char*.
$(BASIC_BLOCK_H) $(REGS_H) insn-config.h insn-attr.h insn-flags.h \
$(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h
alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
- $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h
+ $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h ggc.h
regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
$(RECOG_H) output.h reload.h $(REGS_H) hard-reg-set.h flags.h function.h \
$(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
#include "tree.h"
#include "tm_p.h"
#include "function.h"
+#include "insn-flags.h"
#include "expr.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "output.h"
#include "toplev.h"
#include "splay-tree.h"
-#include "insn-flags.h"
+#include "ggc.h"
/* The alias sets assigned to MEMs assist the back-end in determining
which MEMs can alias which other MEMs. In general, two MEMs in
address. The mode determines whether it is a function argument or
other special value. */
-rtx *reg_base_value;
-rtx *new_reg_base_value;
-unsigned int reg_base_value_size; /* size of reg_base_value array */
+static rtx *reg_base_value;
+static rtx *new_reg_base_value;
+static unsigned int reg_base_value_size; /* size of reg_base_value array */
#define REG_BASE_VALUE(X) \
((unsigned) REGNO (X) < reg_base_value_size ? reg_base_value[REGNO (X)] : 0)
record_set (dest, set)
rtx dest, set;
{
- register int regno;
+ register unsigned regno;
rtx src;
if (GET_CODE (dest) != REG)
regno = REGNO (dest);
+ if (regno >= reg_base_value_size)
+ abort ();
+
if (set)
{
/* A CLOBBER wipes out any old value but does not prevent a previously
optimization. Loop unrolling can create a large number of
registers. */
reg_base_value_size = maxreg * 2;
- reg_base_value = (rtx *)oballoc (reg_base_value_size * sizeof (rtx));
+ reg_base_value = (rtx *) xcalloc (reg_base_value_size, sizeof (rtx));
+ if (ggc_p)
+ ggc_add_rtx_root (reg_base_value, reg_base_value_size);
+
new_reg_base_value = (rtx *)alloca (reg_base_value_size * sizeof (rtx));
reg_seen = (char *)alloca (reg_base_value_size);
- bzero ((char *) reg_base_value, reg_base_value_size * sizeof (rtx));
if (! reload_completed && flag_unroll_loops)
{
+ /* ??? Why are we realloc'ing if we're just going to zero it? */
alias_invariant = (rtx *)xrealloc (alias_invariant,
reg_base_value_size * sizeof (rtx));
bzero ((char *)alias_invariant, reg_base_value_size * sizeof (rtx));
end_alias_analysis ()
{
reg_known_value = 0;
- reg_base_value = 0;
+ reg_known_value_size = 0;
+ if (reg_base_value)
+ {
+ if (ggc_p)
+ ggc_del_root (reg_base_value);
+ free (reg_base_value);
+ reg_base_value = 0;
+ }
reg_base_value_size = 0;
if (alias_invariant)
{
- free ((char *)alias_invariant);
+ free (alias_invariant);
alias_invariant = 0;
}
}
if (unroll_type == UNROLL_NAIVE
&& GET_CODE (last_loop_insn) == BARRIER
+ && GET_CODE (PREV_INSN (last_loop_insn)) == JUMP_INSN
&& start_label != JUMP_LABEL (PREV_INSN (last_loop_insn)))
{
/* In this case, we must copy the jump and barrier, because they will
/* Make split induction variable constants `permanent' since we
know there are no backward branches across iteration variable
settings which would invalidate this. */
- if (dest_reg_was_split)
+ if (dest_reg_was_split
+ && (GET_CODE (pattern) == SET || GET_CODE (pattern) == USE))
{
int regno = REGNO (SET_DEST (pattern));