Commit c25a4c25 by Richard Kenner

(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
parent 54630035
/* Allocate registers within a basic block, for GNU compiler. /* 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. This file is part of GNU CC.
...@@ -235,6 +235,10 @@ static int scratch_index; ...@@ -235,6 +235,10 @@ static int scratch_index;
static int this_insn_number; static int this_insn_number;
static rtx this_insn; 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 PROTO((int, enum machine_mode, int, int));
static void alloc_qty_for_scratch PROTO((rtx, int, rtx, int, int)); static void alloc_qty_for_scratch PROTO((rtx, int, rtx, int, int));
static void validate_equiv_mem_from_store PROTO((rtx, rtx)); static void validate_equiv_mem_from_store PROTO((rtx, rtx));
...@@ -609,7 +613,6 @@ memref_referenced_p (memref, x) ...@@ -609,7 +613,6 @@ memref_referenced_p (memref, x)
switch (code) switch (code)
{ {
case REG:
case CONST_INT: case CONST_INT:
case CONST: case CONST:
case LABEL_REF: case LABEL_REF:
...@@ -621,6 +624,11 @@ memref_referenced_p (memref, x) ...@@ -621,6 +624,11 @@ memref_referenced_p (memref, x)
case LO_SUM: case LO_SUM:
return 0; return 0;
case REG:
return (reg_equiv_replacement[REGNO (x)] == 0
|| memref_referenced_p (memref,
reg_equiv_replacement[REGNO (x)]));
case MEM: case MEM:
if (true_dependence (memref, x)) if (true_dependence (memref, x))
return 1; return 1;
...@@ -941,9 +949,10 @@ static void ...@@ -941,9 +949,10 @@ static void
update_equiv_regs () update_equiv_regs ()
{ {
rtx *reg_equiv_init_insn = (rtx *) alloca (max_regno * sizeof (rtx *)); rtx *reg_equiv_init_insn = (rtx *) alloca (max_regno * sizeof (rtx *));
rtx *reg_equiv_replacement = (rtx *) alloca (max_regno * sizeof (rtx *));
rtx insn; 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_init_insn, max_regno * sizeof (rtx *));
bzero ((char *) reg_equiv_replacement, max_regno * sizeof (rtx *)); bzero ((char *) reg_equiv_replacement, max_regno * sizeof (rtx *));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment