From c25a4c251b9d1b7d347d9f15d5abfa7d0cad4f5f Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 1 Jan 1996 18:23:33 -0500 Subject: (reg_equiv_replacement): New variable. (memref_referenced_p, case REG): Check for reg_equiv_replacement. (update_equiv_regs): reg_equiv_replacement now file-scope. From-SVN: r10930 --- gcc/local-alloc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 20bcc1cc4b5..b11cf2a9ab1 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1,5 +1,5 @@ /* Allocate registers within a basic block, for GNU compiler. - Copyright (C) 1987, 88, 91, 93, 94, 1995 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 91, 93, 94, 95, 1996 Free Software Foundation, Inc. This file is part of GNU CC. @@ -235,6 +235,10 @@ static int scratch_index; static int this_insn_number; static rtx this_insn; +/* Used to communicate changes made by update_equiv_regs to + memref_referenced_p. */ +static rtx *reg_equiv_replacement; + static void alloc_qty PROTO((int, enum machine_mode, int, int)); static void alloc_qty_for_scratch PROTO((rtx, int, rtx, int, int)); static void validate_equiv_mem_from_store PROTO((rtx, rtx)); @@ -609,7 +613,6 @@ memref_referenced_p (memref, x) switch (code) { - case REG: case CONST_INT: case CONST: case LABEL_REF: @@ -621,6 +624,11 @@ memref_referenced_p (memref, x) case LO_SUM: return 0; + case REG: + return (reg_equiv_replacement[REGNO (x)] == 0 + || memref_referenced_p (memref, + reg_equiv_replacement[REGNO (x)])); + case MEM: if (true_dependence (memref, x)) return 1; @@ -941,9 +949,10 @@ static void update_equiv_regs () { rtx *reg_equiv_init_insn = (rtx *) alloca (max_regno * sizeof (rtx *)); - rtx *reg_equiv_replacement = (rtx *) alloca (max_regno * sizeof (rtx *)); rtx insn; + reg_equiv_replacement = (rtx *) alloca (max_regno * sizeof (rtx *)); + bzero ((char *) reg_equiv_init_insn, max_regno * sizeof (rtx *)); bzero ((char *) reg_equiv_replacement, max_regno * sizeof (rtx *)); -- cgit v1.2.1