OSDN Git Service

2006-12-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / local-alloc.c
index d22e9e7..e6ff69e 100644 (file)
@@ -1,6 +1,7 @@
 /* Allocate registers within a basic block, for GNU compiler.
    Copyright (C) 1987, 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+   Inc.
 
 This file is part of GCC.
 
@@ -906,7 +907,7 @@ update_equiv_regs (void)
             REG_EQUAL note on the insn.  Since this note would be redundant,
             there's no point creating it earlier than here.  */
          if (! note && ! rtx_varies_p (src, 0))
-           note = set_unique_reg_note (insn, REG_EQUAL, src);
+           note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
 
          /* Don't bother considering a REG_EQUAL note containing an EXPR_LIST
             since it represents a function call */
@@ -952,7 +953,8 @@ update_equiv_regs (void)
          if (note == 0 && REG_BASIC_BLOCK (regno) >= 0
              && MEM_P (SET_SRC (set))
              && validate_equiv_mem (insn, dest, SET_SRC (set)))
-           REG_NOTES (insn) = note = gen_rtx_EXPR_LIST (REG_EQUIV, SET_SRC (set),
+           REG_NOTES (insn) = note = gen_rtx_EXPR_LIST (REG_EQUIV,
+                                                        copy_rtx (SET_SRC (set)),
                                                         REG_NOTES (insn));
 
          if (note)
@@ -962,8 +964,7 @@ update_equiv_regs (void)
 
              /* If we haven't done so, record for reload that this is an
                 equivalencing insn.  */
-             if (!reg_equiv[regno].is_arg_equivalence
-                 && (!MEM_P (x) || rtx_equal_p (src, x)))
+             if (!reg_equiv[regno].is_arg_equivalence)
                reg_equiv_init[regno]
                  = gen_rtx_INSN_LIST (VOIDmode, insn, reg_equiv_init[regno]);
 
@@ -1061,7 +1062,7 @@ update_equiv_regs (void)
              && ! memref_used_between_p (dest, init_insn, insn))
            {
              REG_NOTES (init_insn)
-               = gen_rtx_EXPR_LIST (REG_EQUIV, dest,
+               = gen_rtx_EXPR_LIST (REG_EQUIV, copy_rtx (dest),
                                     REG_NOTES (init_insn));
              /* This insn makes the equivalence, not the one initializing
                 the register.  */
@@ -2523,7 +2524,7 @@ dump_local_alloc (FILE *file)
 
 /* Run old register allocator.  Return TRUE if we must exit
    rest_of_compilation upon return.  */
-static void
+static unsigned int
 rest_of_handle_local_alloc (void)
 {
   int rebuild_notes;
@@ -2537,8 +2538,10 @@ rest_of_handle_local_alloc (void)
   allocate_reg_info (max_regno, FALSE, TRUE);
 
   /* And the reg_equiv_memory_loc array.  */
-  VARRAY_GROW (reg_equiv_memory_loc_varray, max_regno);
-  reg_equiv_memory_loc = &VARRAY_RTX (reg_equiv_memory_loc_varray, 0);
+  VEC_safe_grow (rtx, gc, reg_equiv_memory_loc_vec, max_regno);
+  memset (VEC_address (rtx, reg_equiv_memory_loc_vec), 0,
+         sizeof (rtx) * max_regno);
+  reg_equiv_memory_loc = VEC_address (rtx, reg_equiv_memory_loc_vec);
 
   allocate_initial_values (reg_equiv_memory_loc);
 
@@ -2566,6 +2569,7 @@ rest_of_handle_local_alloc (void)
       dump_local_alloc (dump_file);
       timevar_pop (TV_DUMP);
     }
+  return 0;
 }
 
 struct tree_opt_pass pass_local_alloc =