diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-20 11:45:26 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-20 11:45:26 +0000 |
commit | 2bc9fc534419994243e17f21b906cad1795461e1 (patch) | |
tree | 9c02ce26170091fbc2cb20b4806f8a3edce09bd1 | |
parent | cc69bcd02109a1bd756944f5c7a9b36f37d6672c (diff) | |
download | linaro-gcc-2bc9fc534419994243e17f21b906cad1795461e1.tar.gz linaro-gcc-2bc9fc534419994243e17f21b906cad1795461e1.tar.bz2 linaro-gcc-2bc9fc534419994243e17f21b906cad1795461e1.zip |
* Makefile.in (GTFILES): Add $(srcdir)/reload.h.
* gengtype.c (open_base_files): Include reload.h in ifiles.
* reload.h (reg_equiv_memory_loc_varray): Declare.
* reload1.c (reg_equiv_memory_loc_varray): New variable.
(init_reload): Initialize it.
(reload): Instead of freeing reg_equiv_memory_loc, 'grow'
reg_equiv_memory_loc_varray to size 0.
* ra.c (reg_alloc): Allocate reg_equiv_memory_loc by
growing reg_equiv_memory_loc_varray to the desired size.
* passes.c (rest_of_handle_old_regalloc): Likewise.
* reload.c: Amend comment on calling init_reload.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82050 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/gengtype.c | 2 | ||||
-rw-r--r-- | gcc/passes.c | 3 | ||||
-rw-r--r-- | gcc/ra.c | 3 | ||||
-rw-r--r-- | gcc/reload.c | 1 | ||||
-rw-r--r-- | gcc/reload.h | 1 | ||||
-rw-r--r-- | gcc/reload1.c | 8 |
8 files changed, 28 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50e9407871c..24e1c24ba43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2004-05-20 J"orn Rennecke <joern.rennecke@superh.com> + + * Makefile.in (GTFILES): Add $(srcdir)/reload.h. + * gengtype.c (open_base_files): Include reload.h in ifiles. + * reload.h (reg_equiv_memory_loc_varray): Declare. + * reload1.c (reg_equiv_memory_loc_varray): New variable. + (init_reload): Initialize it. + (reload): Instead of freeing reg_equiv_memory_loc, 'grow' + reg_equiv_memory_loc_varray to size 0. + * ra.c (reg_alloc): Allocate reg_equiv_memory_loc by + growing reg_equiv_memory_loc_varray to the desired size. + * passes.c (rest_of_handle_old_regalloc): Likewise. + * reload.c: Amend comment on calling init_reload. + 2004-05-20 Nick Clifton <nickc@redhat.com> * config/c4x/c4x.h (INITIALIZE_TRAMPOLINE): Replace 'tramp' diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 804aa5ea88a..35f8bcbccb1 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -2265,7 +2265,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \ $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \ $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \ $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \ - $(srcdir)/c-common.h $(srcdir)/c-tree.h \ + $(srcdir)/c-common.h $(srcdir)/c-tree.h $(srcdir)/reload.h \ $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \ $(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \ $(srcdir)/dojump.c \ diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 1b56a839fcc..95c88efd48b 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -1100,7 +1100,7 @@ open_base_files (void) "function.h", "insn-config.h", "expr.h", "hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h", "optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h", - "tree-alias-type.h", "tree-flow.h", + "tree-alias-type.h", "tree-flow.h", "reload.h", NULL }; const char *const *ifp; diff --git a/gcc/passes.c b/gcc/passes.c index 379df57415f..841e361149c 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -624,7 +624,8 @@ rest_of_handle_old_regalloc (tree decl, rtx insns) allocate_reg_info (max_regno, FALSE, TRUE); /* And the reg_equiv_memory_loc array. */ - reg_equiv_memory_loc = xcalloc (max_regno, sizeof (rtx)); + VARRAY_GROW (reg_equiv_memory_loc_varray, max_regno); + reg_equiv_memory_loc = &VARRAY_RTX (reg_equiv_memory_loc_varray, 0); allocate_initial_values (reg_equiv_memory_loc); @@ -887,7 +887,8 @@ reg_alloc (void) "after allocation/spilling, before reload", NULL); /* Allocate the reg_equiv_memory_loc array for reload. */ - reg_equiv_memory_loc = xcalloc (max_regno, sizeof (rtx)); + VARRAY_GROW (reg_equiv_memory_loc_varray, max_regno); + reg_equiv_memory_loc = &VARRAY_RTX (reg_equiv_memory_loc_varray, 0); /* And possibly initialize it. */ allocate_initial_values (reg_equiv_memory_loc); /* And one last regclass pass just before reload. */ diff --git a/gcc/reload.c b/gcc/reload.c index ae211302efa..dc5d9f70e56 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -27,6 +27,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ought to be used instead. Before processing the first insn of the function, call `init_reload'. + init_reload actually has to be called earlier anyway. To scan an insn, call `find_reloads'. This does two things: 1. sets up tables describing which values must be reloaded diff --git a/gcc/reload.h b/gcc/reload.h index 9a5e33c843a..166d2ab0647 100644 --- a/gcc/reload.h +++ b/gcc/reload.h @@ -164,6 +164,7 @@ extern struct reload rld[MAX_RELOADS]; extern int n_reloads; #endif +extern GTY (()) struct varray_head_tag *reg_equiv_memory_loc_varray; extern rtx *reg_equiv_constant; extern rtx *reg_equiv_memory_loc; extern rtx *reg_equiv_address; diff --git a/gcc/reload1.c b/gcc/reload1.c index c848ce67101..428228052dd 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -102,6 +102,10 @@ rtx *reg_equiv_constant; is transferred to either reg_equiv_address or reg_equiv_mem. */ rtx *reg_equiv_memory_loc; +/* We allocate reg_equiv_memory_loc inside a varray so that the garbage + collector can keep track of what is inside. */ +varray_type reg_equiv_memory_loc_varray; + /* Element N is the address of stack slot to which pseudo reg N is equivalent. This is used when the address is not valid as a memory address (because its displacement is too big for the machine.) */ @@ -482,6 +486,7 @@ init_reload (void) INIT_REG_SET (&spilled_pseudos); INIT_REG_SET (&pseudos_counted); + VARRAY_RTX_INIT (reg_equiv_memory_loc_varray, 0, "reg_equiv_memory_loc"); } /* List of insn chains that are currently unused. */ @@ -1236,8 +1241,7 @@ reload (rtx first, int global) if (reg_equiv_constant) free (reg_equiv_constant); reg_equiv_constant = 0; - if (reg_equiv_memory_loc) - free (reg_equiv_memory_loc); + VARRAY_GROW (reg_equiv_memory_loc_varray, 0); reg_equiv_memory_loc = 0; if (offsets_known_at) |