aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-04-06 00:51:25 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-04-06 00:51:25 +0000
commitbedda2da7f0434c931864fd1860d8b49106733bb (patch)
treee86a0b0c8611c92ba993e13102ca5e6b62015c94
parente0fc4118fea69036438dc790c529a68e183f24fe (diff)
downloadgcc-bedda2da7f0434c931864fd1860d8b49106733bb.zip
gcc-bedda2da7f0434c931864fd1860d8b49106733bb.tar.gz
gcc-bedda2da7f0434c931864fd1860d8b49106733bb.tar.bz2
final.c (final): Use xcalloc to allocate line_note_exists.
* final.c (final): Use xcalloc to allocate line_note_exists. * function.c (free_after_compilation): Free the temp_slots. (assign_stack_temp_for_type): Use xmalloc to allocate temp_slots. (combine_temp_slot): Free temp_slots when they get combined. (purge_addressof): Fix typo in comment. * stmt.c (mark_goto_fixup): Mark the fixup itself. (expand_fixup): Allocate the fixup with ggc_alloc_obj. * ggc.h: Include varray.h. (ggc_pending_trees): Declare. (ggc_mark_tree_children): Remove declaration. (ggc_mark_tree): Just push unmarked trees on ggc_pending_trees. * ggc-common.c (ggc_pending_trees): New variable. (ggc_mark_roots): Call ggc_mark_trees. (ggc_mark_tree_children): Rename to ggc_mark_trees. Process all the ggc_pending_trees. * Makefile.in (GGC_H): New variable. Use it throughout in place of ggc.h. * Makefile.in (GGC_H): New variable. Use it throughout in place of ggc.h. * call.c: Don't include obstack.h. Include ggc.h. (obstack_chunk_alloc): Don't define. (obstack_chunk_free): Likewise. (add_candidate): Allocate the z_candidate with ggc_alloc_obj. * decl.c (push_switch): Use xmalloc to allocate the cp_switch. (pop_switch): Free it. * decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs. * dump.c (dequeue_and_dump): Don't try to print the bit_position if we don't have a DECL_FIELD_OFFSET. * Makefile.in (GGC_H): Add varray.h. From-SVN: r32956
-rw-r--r--gcc/ChangeLog21
-rw-r--r--gcc/Makefile.in73
-rw-r--r--gcc/cp/ChangeLog17
-rw-r--r--gcc/cp/Makefile.in23
-rw-r--r--gcc/cp/call.c13
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/decl2.c11
-rw-r--r--gcc/cp/dump.c3
-rw-r--r--gcc/f/ChangeLog4
-rw-r--r--gcc/f/Makefile.in4
-rw-r--r--gcc/final.c5
-rw-r--r--gcc/function.c22
-rw-r--r--gcc/ggc-common.c283
-rw-r--r--gcc/ggc.h16
-rw-r--r--gcc/stmt.c3
15 files changed, 292 insertions, 212 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c06181c..8e2f503 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,24 @@
+2000-04-05 Mark Mitchell <mark@codesourcery.com>
+
+ * final.c (final): Use xcalloc to allocate line_note_exists.
+ * function.c (free_after_compilation): Free the temp_slots.
+ (assign_stack_temp_for_type): Use xmalloc to allocate temp_slots.
+ (combine_temp_slot): Free temp_slots when they get combined.
+ (purge_addressof): Fix typo in comment.
+ * stmt.c (mark_goto_fixup): Mark the fixup itself.
+ (expand_fixup): Allocate the fixup with ggc_alloc_obj.
+
+ * ggc.h: Include varray.h.
+ (ggc_pending_trees): Declare.
+ (ggc_mark_tree_children): Remove declaration.
+ (ggc_mark_tree): Just push unmarked trees on ggc_pending_trees.
+ * ggc-common.c (ggc_pending_trees): New variable.
+ (ggc_mark_roots): Call ggc_mark_trees.
+ (ggc_mark_tree_children): Rename to ggc_mark_trees. Process all
+ the ggc_pending_trees.
+ * Makefile.in (GGC_H): New variable. Use it throughout in place
+ of ggc.h.
+
Thu Apr 6 00:30:50 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* sh.h (FUNCTION_ARG_PARTIAL_NREGS): Accomodate an unsigned
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 17271fd..7bf0ba1 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -762,6 +762,7 @@ REGS_H = regs.h varray.h $(MACHMODE_H)
INTEGRATE_H = integrate.h varray.h
LOOP_H = loop.h varray.h basic-block.h
GCC_H = gcc.h version.h
+GGC_H = ggc.h varray.h
#
# Language makefile fragments.
@@ -1338,7 +1339,7 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
# C language specific files.
-c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h ggc.h \
+c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h $(GGC_H) \
$(srcdir)/c-parse.h c-tree.h c-common.h input.h flags.h system.h toplev.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
$(srcdir)/c-parse.h: $(srcdir)/c-parse.c
@@ -1358,20 +1359,20 @@ $(srcdir)/c-gperf.h: c-parse.gperf
exit 1 )
$(SHELL) $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
-c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h ggc.h \
+c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h $(GGC_H) \
c-lex.h flags.h function.h output.h toplev.h defaults.h
c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h \
flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h
-c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h ggc.h \
+c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h $(GGC_H) \
c-lex.h toplev.h output.h function.h
c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h c-tree.h \
c-common.h $(srcdir)/c-parse.h $(srcdir)/c-gperf.h c-pragma.h input.h \
- intl.h flags.h toplev.h output.h mbchar.h ggc.h
+ intl.h flags.h toplev.h output.h mbchar.h $(GGC_H)
c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) c-tree.h \
c-common.h flags.h toplev.h
c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) function.h \
- defaults.h c-pragma.h toplev.h ggc.h
+ defaults.h c-pragma.h toplev.h $(GGC_H)
c-iterate.o: c-iterate.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-tree.h \
c-common.h flags.h toplev.h $(EXPR_H)
mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h
@@ -1423,7 +1424,7 @@ s-under: $(GCC_PASSES)
# A file used by all variants of C.
c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h \
- c-common.h flags.h toplev.h output.h c-pragma.h $(RTL_H) ggc.h \
+ c-common.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H)
# Language-independent files.
@@ -1464,17 +1465,17 @@ dumpvers: dumpvers.c
version.o: version.c version.h
ggc-common.o: ggc-common.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
- flags.h ggc.h varray.h hash.h
+ flags.h $(GGC_H) varray.h hash.h
ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
- ggc.h varray.h
+ $(GGC_H) varray.h
ggc-page.o: ggc-page.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
- ggc.h varray.h
+ $(GGC_H) varray.h
-ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_H) ggc.h
+ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_H) $(GGC_H)
-ggc-callbacks.o: ggc-callbacks.c $(CONFIG_H) $(RTL_H) $(TREE_H) ggc.h
+ggc-callbacks.o: ggc-callbacks.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(GGC_H)
obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H)
rm -f obstack.c
@@ -1489,12 +1490,12 @@ prefix.o: prefix.c $(CONFIG_H) system.h Makefile prefix.h
convert.o: convert.c $(CONFIG_H) system.h $(TREE_H) flags.h convert.h toplev.h
tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h \
- ggc.h $(HASHTAB_H)
-print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H) ggc.h
+ $(GGC_H) $(HASHTAB_H)
+print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H) $(GGC_H)
stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \
- function.h $(EXPR_H) $(RTL_H) toplev.h ggc.h
+ function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H)
fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \
- $(RTL_H) ggc.h
+ $(RTL_H) $(GGC_H)
diagnostic.o : diagnostic.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \
input.h insn-attr.h insn-codes.h insn-config.h toplev.h intl.h
toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
@@ -1506,7 +1507,7 @@ toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
-DTARGET_NAME=\"$(target_alias)\" \
-c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
-rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h ggc.h toplev.h
+rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h $(GGC_H) toplev.h
print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) $(BASIC_BLOCK_H)
rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
@@ -1514,20 +1515,20 @@ errors.o : errors.c $(CONFIG_H) system.h errors.h
varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
function.h defaults.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
- xcoffout.h output.h c-pragma.h toplev.h dbxout.h sdbout.h ggc.h
+ xcoffout.h output.h c-pragma.h toplev.h dbxout.h sdbout.h $(GGC_H)
function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
function.h insn-flags.h insn-codes.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
- insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h ggc.h
+ insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H)
stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
insn-flags.h insn-config.h insn-codes.h hard-reg-set.h $(EXPR_H) except.h \
- $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h ggc.h
+ $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H)
except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
function.h insn-flags.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
- insn-config.h $(RECOG_H) output.h except.h toplev.h intl.h ggc.h
+ insn-config.h $(RECOG_H) output.h except.h toplev.h intl.h $(GGC_H)
expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
$(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h $(RECOG_H) \
output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
- ggc.h intl.h
+ $(GGC_H) intl.h
builtins.o : builtins.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
function.h $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h \
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
@@ -1541,7 +1542,7 @@ explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-codes.h toplev.h function.h
optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) reload.h \
- toplev.h ggc.h real.h
+ toplev.h $(GGC_H) real.h
dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h $(REGS_H) \
insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h dbxout.h \
toplev.h
@@ -1554,11 +1555,11 @@ dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
flags.h insn-config.h reload.h output.h defaults.h \
hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h varray.h \
- ggc.h except.h
+ $(GGC_H) except.h
xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \
- flags.h toplev.h output.h dbxout.h ggc.h
+ flags.h toplev.h output.h dbxout.h $(GGC_H)
emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- function.h $(REGS_H) insn-config.h $(RECOG_H) real.h ggc.h \
+ function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
$(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
$(HASHTAB_H)
real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h
@@ -1571,9 +1572,9 @@ jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
- output.h function.h cselib.h ggc.h $(srcdir)/../include/obstack.h
+ output.h function.h cselib.h $(GGC_H) $(srcdir)/../include/obstack.h
cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
- real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h ggc.h
+ real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h $(GGC_H)
gcse.o : gcse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
function.h output.h toplev.h
@@ -1588,7 +1589,7 @@ ssa.o : ssa.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) $(BASIC_BLOCK_H) \
output.h insn-config.h
profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-flags.h \
gcov-io.h $(TREE_H) output.h $(REGS_H) toplev.h function.h insn-config.h \
- ggc.h
+ $(GGC_H)
loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) insn-config.h \
insn-flags.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \
$(BASIC_BLOCK_H) function.h toplev.h varray.h except.h cselib.h
@@ -1603,7 +1604,7 @@ combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h function.h \
$(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h
regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
$(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
- toplev.h function.h output.h ggc.h
+ toplev.h function.h output.h $(GGC_H)
local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
output.h function.h insn-attr.h toplev.h
@@ -1625,7 +1626,7 @@ reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
$(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 ggc.h function.h \
+ $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h $(GGC_H) function.h \
cselib.h $(TREE_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 \
@@ -1648,7 +1649,7 @@ dyn-string.o: dyn-string.c dyn-string.h $(CONFIG_H) system.h
predict.o: predict.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
$(RECOG_H) insn-flags.h function.h except.h $(EXPR_H)
-lists.o: lists.c $(CONFIG_H) system.h toplev.h $(RTL_H) ggc.h
+lists.o: lists.c $(CONFIG_H) system.h toplev.h $(RTL_H) $(GGC_H)
bb-reorder.o : bb-reorder.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
$(RECOG_H) insn-flags.h function.h except.h $(EXPR_H)
@@ -1657,7 +1658,7 @@ regrename.o : regrename.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h \
$(RECOG_H) function.h resource.h
-$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) ggc.h \
+$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
insn-flags.h output.h insn-attr.h insn-codes.h system.h toplev.h function.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file)
@@ -1797,7 +1798,7 @@ s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
touch s-attrtab
-insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) ggc.h $(REGS_H) real.h \
+insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \
conditions.h hard-reg-set.h insn-config.h insn-flags.h insn-attr.h \
output.h $(RECOG_H) function.h insn-codes.h system.h toplev.h flags.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
@@ -1808,7 +1809,7 @@ s-output : $(md_file) genoutput $(srcdir)/move-if-change
$(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
touch s-output
-genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h ggc.h
+genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h $(GGC_H)
genrtl.c genrtl.h : s-genrtl
@true # force gnu make to recheck modification times.
@@ -1902,7 +1903,7 @@ genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEP
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) system.h errors.h ggc.h
+genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) system.h errors.h $(GGC_H)
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
@@ -1924,7 +1925,7 @@ gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h real.h
# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
# with the rules for rtl.o, alloca.o, etc.
$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) system.h $(RTL_H) \
- bitmap.h ggc.h toplev.h
+ bitmap.h $(GGC_H) toplev.h
rm -f $(HOST_PREFIX)rtl.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fa30d81..96c0900 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,20 @@
+2000-04-05 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (GGC_H): New variable. Use it throughout in place
+ of ggc.h.
+
+ * call.c: Don't include obstack.h. Include ggc.h.
+ (obstack_chunk_alloc): Don't define.
+ (obstack_chunk_free): Likewise.
+ (add_candidate): Allocate the z_candidate with ggc_alloc_obj.
+ * decl.c (push_switch): Use xmalloc to allocate the cp_switch.
+ (pop_switch): Free it.
+
+ * decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs.
+
+ * dump.c (dequeue_and_dump): Don't try to print the bit_position
+ if we don't have a DECL_FIELD_OFFSET.
+
Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka <jh@suse.cz>
* optimize.c (calls_setjmp_r): Use setjmp_call_p instead of
diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in
index 43bebf5..647c1fa 100644
--- a/gcc/cp/Makefile.in
+++ b/gcc/cp/Makefile.in
@@ -209,10 +209,11 @@ CXX_TREE_H = $(TREE_H) cp-tree.h $(srcdir)/../c-common.h cp-tree.def \
PARSE_H = $(srcdir)/parse.h
PARSE_C = $(srcdir)/parse.c
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
+GGC_H = $(srcdir)/../ggc.h $(srcdir)/../varray.h
parse.o : $(PARSE_C) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
$(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h $(srcdir)/../ggc.h
+ $(srcdir)/../toplev.h $(GGC_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'`
@@ -251,16 +252,16 @@ spew.o : spew.c $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
lex.o : lex.c $(CXX_TREE_H) \
$(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
$(srcdir)/../c-pragma.h $(srcdir)/../toplev.h \
- $(srcdir)/../output.h $(srcdir)/../mbchar.h $(srcdir)/../ggc.h \
+ $(srcdir)/../output.h $(srcdir)/../mbchar.h $(GGC_H) \
$(srcdir)/../input.h
decl.o : decl.c $(CXX_TREE_H) $(srcdir)/../flags.h \
lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \
$(srcdir)/../except.h $(srcdir)/../toplev.h \
- $(srcdir)/../hash.h $(srcdir)/../ggc.h $(RTL_H)
+ $(srcdir)/../hash.h $(GGC_H) $(RTL_H)
decl2.o : decl2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
lex.h decl.h $(EXPR_H) $(srcdir)/../output.h $(srcdir)/../except.h \
$(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h \
- $(srcdir)/../ggc.h $(RTL_H)
+ $(GGC_H) $(RTL_H)
typeck2.o : typeck2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../toplev.h $(srcdir)/../output.h
typeck.o : typeck.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
@@ -268,20 +269,20 @@ typeck.o : typeck.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
class.o : class.c $(CXX_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../toplev.h $(RTL_H)
call.o : call.c $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../toplev.h $(RTL_H) $(EXPR_H)
+ $(srcdir)/../toplev.h $(RTL_H) $(EXPR_H) $(GGC_H)
friend.o : friend.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
$(srcdir)/../toplev.h
init.o : init.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
- $(EXPR_H) $(srcdir)/../toplev.h $(srcdir)/../ggc.h \
+ $(EXPR_H) $(srcdir)/../toplev.h $(GGC_H) \
$(srcdir)/../except.h
method.o : method.c $(CXX_TREE_H) \
- $(srcdir)/../toplev.h $(srcdir)/../ggc.h $(RTL_H)
+ $(srcdir)/../toplev.h $(GGC_H) $(RTL_H)
cvt.o : cvt.c $(CXX_TREE_H) decl.h \
$(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h
search.o : search.c $(CXX_TREE_H) $(srcdir)/../stack.h \
$(srcdir)/../flags.h $(srcdir)/../toplev.h $(RTL_H)
tree.o : tree.c $(CXX_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../toplev.h $(srcdir)/../ggc.h $(RTL_H) \
+ $(srcdir)/../toplev.h $(GGC_H) $(RTL_H) \
../insn-config.h $(srcdir)/../integrate.h
ptree.o : ptree.c $(CXX_TREE_H) $(srcdir)/../system.h
rtti.o : rtti.c $(CXX_TREE_H) $(srcdir)/../flags.h \
@@ -293,17 +294,17 @@ expr.o : expr.c $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
xref.o : xref.c $(CXX_TREE_H) $(srcdir)/../input.h \
$(srcdir)/../toplev.h
pt.o : pt.c $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
- $(srcdir)/../toplev.h $(srcdir)/../ggc.h $(RTL_H) \
+ $(srcdir)/../toplev.h $(GGC_H) $(RTL_H) \
$(srcdir)/../except.h
error.o : error.c $(CXX_TREE_H) \
$(srcdir)/../toplev.h
errfn.o : errfn.c $(CXX_TREE_H) \
$(srcdir)/../toplev.h
repo.o : repo.c $(CXX_TREE_H) \
- $(srcdir)/../toplev.h $(srcdir)/../ggc.h
+ $(srcdir)/../toplev.h $(GGC_H)
semantics.o: semantics.c $(CXX_TREE_H) lex.h \
$(srcdir)/../except.h $(srcdir)/../toplev.h \
- $(srcdir)/../flags.h $(srcdir)/../ggc.h \
+ $(srcdir)/../flags.h $(GGC_H) \
$(srcdir)/../output.h $(RTL_H)
dump.o: dump.c $(CXX_TREE_H)
optimize.o: optimize.c $(CXX_TREE_H) \
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 6e7c4fb..ef55918 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -34,10 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "defaults.h"
#include "expr.h"
-
-#include "obstack.h"
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
+#include "ggc.h"
extern int inhibit_warnings;
@@ -1232,18 +1229,12 @@ add_candidate (candidates, fn, convs, viable)
tree fn, convs;
int viable;
{
- /* FIXME: This is a memory leak. Presumably, we should use
- ggc_alloc instead. */
struct z_candidate *cand
- = (struct z_candidate *) expralloc (sizeof (struct z_candidate));
+ = (struct z_candidate *) ggc_alloc_obj (sizeof (struct z_candidate), 1);
cand->fn = fn;
cand->convs = convs;
- cand->second_conv = NULL_TREE;
cand->viable = viable;
- cand->basetype_path = NULL_TREE;
- cand->template = NULL_TREE;
- cand->warnings = NULL_TREE;
cand->next = candidates;
return cand;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b779b7d..0611ee7 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4938,7 +4938,7 @@ void
push_switch ()
{
struct cp_switch *p
- = (struct cp_switch *) oballoc (sizeof (struct cp_switch));
+ = (struct cp_switch *) xmalloc (sizeof (struct cp_switch));
p->level = current_binding_level;
p->next = switch_stack;
switch_stack = p;
@@ -4947,7 +4947,11 @@ push_switch ()
void
pop_switch ()
{
+ struct cp_switch *cs;
+
+ cs = switch_stack;
switch_stack = switch_stack->next;
+ free (cs);
}
/* Note that we've seen a definition of a case label, and complain if this
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index be51512..f6d5b78 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1009,9 +1009,16 @@ grokclassfn (ctype, function, flags, quals)
/* Right now we just make this a pointer. But later
we may wish to make it special. */
tree type = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (function)));
+ tree qual_type;
+ tree parm;
+
+ /* The `this' parameter is implicitly `const'; it cannot be
+ assigned to. */
+ this_quals |= TYPE_QUAL_CONST;
+ qual_type = cp_build_qualified_type (type, this_quals);
+ parm = build_decl (PARM_DECL, this_identifier, qual_type);
+ c_apply_type_quals_to_decl (this_quals, parm);
- tree parm = build_decl (PARM_DECL, this_identifier,
- cp_build_qualified_type (type, this_quals | TYPE_QUAL_CONST));
/* Mark the artificial `this' parameter as "artificial". */
SET_DECL_ARTIFICIAL (parm);
DECL_ARG_TYPE (parm) = type;
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index fe43fb0..7f81094 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -550,7 +550,8 @@ dequeue_and_dump (di)
{
if (DECL_C_BIT_FIELD (t))
dump_string (di, "bitfield");
- dump_child ("bpos", bit_position (t));
+ if (DECL_FIELD_OFFSET (t))
+ dump_child ("bpos", bit_position (t));
}
break;
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 05f420a..84eb54a 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,7 @@
+Wed Apr 5 17:46:39 2000 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (GGC_H): Add varray.h.
+
2000-04-03 Zack Weinberg <zack@wolery.cumb.org>
* lang-specs.h: Pass -fno-show-column to the preprocessor.
diff --git a/gcc/f/Makefile.in b/gcc/f/Makefile.in
index f95a155..1f93e55 100644
--- a/gcc/f/Makefile.in
+++ b/gcc/f/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for GNU F77 compiler.
-# Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
#This file is part of GNU Fortran.
@@ -225,7 +225,7 @@ ASSERT_H = $(srcdir)/assert.j $(srcdir)/../assert.h
CONFIG_H = $(srcdir)/config.j ../config.h
CONVERT_H = $(srcdir)/convert.j $(srcdir)/../convert.h
FLAGS_H = $(srcdir)/flags.j $(srcdir)/../flags.h
-GGC_H = $(srcdir)/ggc.j $(srcdir)/../ggc.h
+GGC_H = $(srcdir)/ggc.j $(srcdir)/../ggc.h $(srcdir)/../varray.h
GLIMITS_H = $(srcdir)/glimits.j $(srcdir)/../glimits.h
HCONFIG_H = $(srcdir)/hconfig.j ../hconfig.h
INPUT_H = $(srcdir)/input.j $(srcdir)/../input.h
diff --git a/gcc/final.c b/gcc/final.c
index 34db2ae..ade9da9 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1974,8 +1974,7 @@ final (first, file, optimize, prescan)
max_line = NOTE_LINE_NUMBER (insn);
}
- line_note_exists = (char *) oballoc (max_line + 1);
- bzero (line_note_exists, max_line + 1);
+ line_note_exists = (char *) xcalloc (max_line + 1, sizeof (char));
for (insn = first; insn; insn = NEXT_INSN (insn))
{
@@ -2020,6 +2019,8 @@ final (first, file, optimize, prescan)
add_bb (file);
free_insn_eh_region ();
+ free (line_note_exists);
+ line_note_exists = NULL;
}
const char *
diff --git a/gcc/function.c b/gcc/function.c
index b6265f3..b17f360 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -445,6 +445,9 @@ void
free_after_compilation (f)
struct function *f;
{
+ struct temp_slot *ts;
+ struct temp_slot *next;
+
free_eh_status (f);
free_expr_status (f);
free_emit_status (f);
@@ -456,6 +459,13 @@ free_after_compilation (f)
if (f->x_parm_reg_stack_loc)
free (f->x_parm_reg_stack_loc);
+ for (ts = f->x_temp_slots; ts; ts = next)
+ {
+ next = ts->next;
+ free (ts);
+ }
+ f->x_temp_slots = NULL;
+
f->arg_offset_rtx = NULL;
f->return_rtx = NULL;
f->internal_arg_pointer = NULL;
@@ -476,7 +486,6 @@ free_after_compilation (f)
f->x_parm_birth_insn = NULL;
f->x_last_parm_insn = NULL;
f->x_parm_reg_stack_loc = NULL;
- f->x_temp_slots = NULL;
f->fixup_var_refs_queue = NULL;
f->original_arg_vector = NULL;
f->original_decl_initial = NULL;
@@ -714,7 +723,7 @@ assign_stack_temp_for_type (mode, size, keep, type)
if (best_p->size - rounded_size >= alignment)
{
- p = (struct temp_slot *) oballoc (sizeof (struct temp_slot));
+ p = (struct temp_slot *) xmalloc (sizeof (struct temp_slot));
p->in_use = p->addr_taken = 0;
p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size;
@@ -744,7 +753,7 @@ assign_stack_temp_for_type (mode, size, keep, type)
{
HOST_WIDE_INT frame_offset_old = frame_offset;
- p = (struct temp_slot *) oballoc (sizeof (struct temp_slot));
+ p = (struct temp_slot *) xmalloc (sizeof (struct temp_slot));
/* We are passing an explicit alignment request to assign_stack_local.
One side effect of that is assign_stack_local will not round SIZE
@@ -935,7 +944,10 @@ combine_temp_slots ()
}
/* Either delete Q or advance past it. */
if (delete_q)
- prev_q->next = q->next;
+ {
+ prev_q->next = q->next;
+ free (q);
+ }
else
prev_q = q;
}
@@ -3274,7 +3286,7 @@ purge_addressof (insns)
/* When we actually purge ADDRESSOFs, we turn REGs into MEMs. That
requires a fixup pass over the instruction stream to correct
INSNs that depended on the REG being a REG, and not a MEM. But,
- these fixup passes are slow. Furthermore, more MEMs are not
+ these fixup passes are slow. Furthermore, most MEMs are not
mentioned in very many instructions. So, we speed up the process
by pre-calculating which REGs occur in which INSNs; that allows
us to perform the fixup passes much more quickly. */
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index b73a359..88488fe 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -33,12 +33,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Statistics about the allocation. */
static ggc_statistics *ggc_stats;
+/* Trees that have been marked, but whose children still need marking. */
+varray_type ggc_pending_trees;
+
static void ggc_mark_rtx_ptr PARAMS ((void *));
static void ggc_mark_tree_ptr PARAMS ((void *));
static void ggc_mark_rtx_varray_ptr PARAMS ((void *));
static void ggc_mark_tree_varray_ptr PARAMS ((void *));
static void ggc_mark_tree_hash_table_ptr PARAMS ((void *));
static void ggc_mark_string_ptr PARAMS ((void *));
+static void ggc_mark_trees PARAMS ((void));
static boolean ggc_mark_tree_hash_table_entry PARAMS ((struct hash_entry *,
hash_table_key));
@@ -174,6 +178,8 @@ ggc_mark_roots ()
{
struct ggc_root* x;
+ VARRAY_TREE_INIT (ggc_pending_trees, 4096, "ggc_pending_trees");
+
for (x = roots; x != NULL; x = x->next)
{
char *elt = x->base;
@@ -184,6 +190,10 @@ ggc_mark_roots ()
for (i = 0; i < n; ++i, elt += s)
(*cb)(elt);
}
+
+ /* Mark all the queued up trees, and their children. */
+ ggc_mark_trees ();
+ VARRAY_FREE (ggc_pending_trees);
}
/* R had not been previously marked, but has now been marked via
@@ -297,148 +307,155 @@ ggc_mark_rtvec_children (v)
ggc_mark_rtx (RTVEC_ELT (v, i));
}
-/* T had not been previously marked, but has now been marked via
- ggc_set_mark. Now recurse and process the children. */
+/* Recursively set marks on all of the children of the
+ GCC_PENDING_TREES. */
-void
-ggc_mark_tree_children (t)
- tree t;
+static void
+ggc_mark_trees ()
{
- enum tree_code code = TREE_CODE (t);
-
- /* Collect statistics, if appropriate. */
- if (ggc_stats)
+ while (ggc_pending_trees->elements_used)
{
- ++ggc_stats->num_trees[(int) code];
- ggc_stats->size_trees[(int) code] += ggc_get_size (t);
- }
+ tree t;
+ enum tree_code code;
- /* Bits from common. */
- ggc_mark_tree (TREE_TYPE (t));
- ggc_mark_tree (TREE_CHAIN (t));
+ t = VARRAY_TOP_TREE (ggc_pending_trees);
+ VARRAY_POP (ggc_pending_trees);
+ code = TREE_CODE (t);
- /* Some nodes require special handling. */
- switch (code)
- {
- case TREE_LIST:
- ggc_mark_tree (TREE_PURPOSE (t));
- ggc_mark_tree (TREE_VALUE (t));
- return;
+ /* Collect statistics, if appropriate. */
+ if (ggc_stats)
+ {
+ ++ggc_stats->num_trees[(int) code];
+ ggc_stats->size_trees[(int) code] += ggc_get_size (t);
+ }
- case TREE_VEC:
- {
- int i = TREE_VEC_LENGTH (t);
- while (--i >= 0)
- ggc_mark_tree (TREE_VEC_ELT (t, i));
- return;
- }
+ /* Bits from common. */
+ ggc_mark_tree (TREE_TYPE (t));
+ ggc_mark_tree (TREE_CHAIN (t));
- case SAVE_EXPR:
- ggc_mark_tree (TREE_OPERAND (t, 0));
- ggc_mark_tree (SAVE_EXPR_CONTEXT (t));
- ggc_mark_rtx (SAVE_EXPR_RTL (t));
- return;
-
- case RTL_EXPR:
- ggc_mark_rtx (RTL_EXPR_SEQUENCE (t));
- ggc_mark_rtx (RTL_EXPR_RTL (t));
- return;
-
- case CALL_EXPR:
- ggc_mark_tree (TREE_OPERAND (t, 0));
- ggc_mark_tree (TREE_OPERAND (t, 1));
- ggc_mark_rtx (CALL_EXPR_RTL (t));
- return;
-
- case COMPLEX_CST:
- ggc_mark_tree (TREE_REALPART (t));
- ggc_mark_tree (TREE_IMAGPART (t));
- break;
-
- case STRING_CST:
- ggc_mark_string (TREE_STRING_POINTER (t));
- break;
-
- case PARM_DECL:
- ggc_mark_rtx (DECL_INCOMING_RTL (t));
- break;
-
- case FIELD_DECL:
- ggc_mark_tree (DECL_FIELD_BIT_OFFSET (t));
- break;
-
- case IDENTIFIER_NODE:
- ggc_mark_string (IDENTIFIER_POINTER (t));
- lang_mark_tree (t);
- return;
-
- default:
- break;
- }
+ /* Some nodes require special handling. */
+ switch (code)
+ {
+ case TREE_LIST:
+ ggc_mark_tree (TREE_PURPOSE (t));
+ ggc_mark_tree (TREE_VALUE (t));
+ continue;
+
+ case TREE_VEC:
+ {
+ int i = TREE_VEC_LENGTH (t);
+ while (--i >= 0)
+ ggc_mark_tree (TREE_VEC_ELT (t, i));
+ continue;
+ }
+
+ case SAVE_EXPR:
+ ggc_mark_tree (TREE_OPERAND (t, 0));
+ ggc_mark_tree (SAVE_EXPR_CONTEXT (t));
+ ggc_mark_rtx (SAVE_EXPR_RTL (t));
+ continue;
+
+ case RTL_EXPR:
+ ggc_mark_rtx (RTL_EXPR_SEQUENCE (t));
+ ggc_mark_rtx (RTL_EXPR_RTL (t));
+ continue;
+
+ case CALL_EXPR:
+ ggc_mark_tree (TREE_OPERAND (t, 0));
+ ggc_mark_tree (TREE_OPERAND (t, 1));
+ ggc_mark_rtx (CALL_EXPR_RTL (t));
+ continue;
+
+ case COMPLEX_CST:
+ ggc_mark_tree (TREE_REALPART (t));
+ ggc_mark_tree (TREE_IMAGPART (t));
+ break;
+
+ case STRING_CST:
+ ggc_mark_string (TREE_STRING_POINTER (t));
+ break;
+
+ case PARM_DECL:
+ ggc_mark_rtx (DECL_INCOMING_RTL (t));
+ break;
+
+ case FIELD_DECL:
+ ggc_mark_tree (DECL_FIELD_BIT_OFFSET (t));
+ break;
+
+ case IDENTIFIER_NODE:
+ ggc_mark_string (IDENTIFIER_POINTER (t));
+ lang_mark_tree (t);
+ continue;
+
+ default:
+ break;
+ }
- /* But in general we can handle them by class. */
- switch (TREE_CODE_CLASS (code))
- {
- case 'd': /* A decl node. */
- ggc_mark_string (DECL_SOURCE_FILE (t));
- ggc_mark_tree (DECL_SIZE (t));
- ggc_mark_tree (DECL_SIZE_UNIT (t));
- ggc_mark_tree (DECL_NAME (t));
- ggc_mark_tree (DECL_CONTEXT (t));
- ggc_mark_tree (DECL_ARGUMENTS (t));
- ggc_mark_tree (DECL_RESULT_FLD (t));
- ggc_mark_tree (DECL_INITIAL (t));
- ggc_mark_tree (DECL_ABSTRACT_ORIGIN (t));
- ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
- ggc_mark_tree (DECL_SECTION_NAME (t));
- ggc_mark_tree (DECL_MACHINE_ATTRIBUTES (t));
- ggc_mark_rtx (DECL_RTL (t));
- ggc_mark_rtx (DECL_LIVE_RANGE_RTL (t));
- ggc_mark_tree (DECL_VINDEX (t));
- lang_mark_tree (t);
- break;
-
- case 't': /* A type node. */
- ggc_mark_tree (TYPE_SIZE (t));
- ggc_mark_tree (TYPE_SIZE_UNIT (t));
- ggc_mark_tree (TYPE_ATTRIBUTES (t));
- ggc_mark_tree (TYPE_VALUES (t));
- ggc_mark_tree (TYPE_POINTER_TO (t));
- ggc_mark_tree (TYPE_REFERENCE_TO (t));
- ggc_mark_tree (TYPE_NAME (t));
- ggc_mark_tree (TYPE_MIN_VALUE (t));
- ggc_mark_tree (TYPE_MAX_VALUE (t));
- ggc_mark_tree (TYPE_NEXT_VARIANT (t));
- ggc_mark_tree (TYPE_MAIN_VARIANT (t));
- ggc_mark_tree (TYPE_BINFO (t));
- ggc_mark_tree (TYPE_NONCOPIED_PARTS (t));
- ggc_mark_tree (TYPE_CONTEXT (t));
- lang_mark_tree (t);
- break;
-
- case 'b': /* A lexical block. */
- ggc_mark_tree (BLOCK_VARS (t));
- ggc_mark_tree (BLOCK_SUBBLOCKS (t));
- ggc_mark_tree (BLOCK_SUPERCONTEXT (t));
- ggc_mark_tree (BLOCK_ABSTRACT_ORIGIN (t));
- break;
-
- case 'c': /* A constant. */
- ggc_mark_rtx (TREE_CST_RTL (t));
- break;
-
- case 'r': case '<': case '1':
- case '2': case 'e': case 's': /* Expressions. */
- {
- int i = tree_code_length[TREE_CODE (t)];
- while (--i >= 0)
- ggc_mark_tree (TREE_OPERAND (t, i));
- break;
- }
+ /* But in general we can handle them by class. */
+ switch (TREE_CODE_CLASS (code))
+ {
+ case 'd': /* A decl node. */
+ ggc_mark_string (DECL_SOURCE_FILE (t));
+ ggc_mark_tree (DECL_SIZE (t));
+ ggc_mark_tree (DECL_SIZE_UNIT (t));
+ ggc_mark_tree (DECL_NAME (t));
+ ggc_mark_tree (DECL_CONTEXT (t));
+ ggc_mark_tree (DECL_ARGUMENTS (t));
+ ggc_mark_tree (DECL_RESULT_FLD (t));
+ ggc_mark_tree (DECL_INITIAL (t));
+ ggc_mark_tree (DECL_ABSTRACT_ORIGIN (t));
+ ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
+ ggc_mark_tree (DECL_SECTION_NAME (t));
+ ggc_mark_tree (DECL_MACHINE_ATTRIBUTES (t));
+ ggc_mark_rtx (DECL_RTL (t));
+ ggc_mark_rtx (DECL_LIVE_RANGE_RTL (t));
+ ggc_mark_tree (DECL_VINDEX (t));
+ lang_mark_tree (t);
+ break;
+
+ case 't': /* A type node. */
+ ggc_mark_tree (TYPE_SIZE (t));
+ ggc_mark_tree (TYPE_SIZE_UNIT (t));
+ ggc_mark_tree (TYPE_ATTRIBUTES (t));
+ ggc_mark_tree (TYPE_VALUES (t));
+ ggc_mark_tree (TYPE_POINTER_TO (t));
+ ggc_mark_tree (TYPE_REFERENCE_TO (t));
+ ggc_mark_tree (TYPE_NAME (t));
+ ggc_mark_tree (TYPE_MIN_VALUE (t));
+ ggc_mark_tree (TYPE_MAX_VALUE (t));
+ ggc_mark_tree (TYPE_NEXT_VARIANT (t));
+ ggc_mark_tree (TYPE_MAIN_VARIANT (t));
+ ggc_mark_tree (TYPE_BINFO (t));
+ ggc_mark_tree (TYPE_NONCOPIED_PARTS (t));
+ ggc_mark_tree (TYPE_CONTEXT (t));
+ lang_mark_tree (t);
+ break;
+
+ case 'b': /* A lexical block. */
+ ggc_mark_tree (BLOCK_VARS (t));
+ ggc_mark_tree (BLOCK_SUBBLOCKS (t));
+ ggc_mark_tree (BLOCK_SUPERCONTEXT (t));
+ ggc_mark_tree (BLOCK_ABSTRACT_ORIGIN (t));
+ break;
+
+ case 'c': /* A constant. */
+ ggc_mark_rtx (TREE_CST_RTL (t));
+ break;
- case 'x':
- lang_mark_tree (t);
- break;
+ case 'r': case '<': case '1':
+ case '2': case 'e': case 's': /* Expressions. */
+ {
+ int i = tree_code_length[TREE_CODE (t)];
+ while (--i >= 0)
+ ggc_mark_tree (TREE_OPERAND (t, i));
+ break;
+ }
+
+ case 'x':
+ lang_mark_tree (t);
+ break;
+ }
}
}
diff --git a/gcc/ggc.h b/gcc/ggc.h
index 1ad8d1a..a79ffd5 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -19,6 +19,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "gansidecl.h"
+#include "varray.h"
/* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with
an external gc library that might be linked in. */
@@ -40,11 +41,13 @@ struct rtvec_def;
struct stmt_status;
union tree_node;
struct varasm_status;
-struct varray_head_tag;
/* Constants for general use. */
extern char *empty_string;
+/* Trees that have been marked, but whose children still need marking. */
+extern varray_type ggc_pending_trees;
+
/* Manipulate global roots that are needed between calls to gc. */
void ggc_add_root PARAMS ((void *base, int nelt, int size, void (*)(void *)));
void ggc_add_rtx_root PARAMS ((struct rtx_def **, int nelt));
@@ -64,7 +67,6 @@ extern void ggc_mark_roots PARAMS ((void));
extern void ggc_mark_rtx_children PARAMS ((struct rtx_def *));
extern void ggc_mark_rtvec_children PARAMS ((struct rtvec_def *));
-extern void ggc_mark_tree_children PARAMS ((union tree_node *));
/* If EXPR is not NULL and previously unmarked, mark it and evaluate
to true. Otherwise evaluate to false. */
@@ -78,11 +80,11 @@ extern void ggc_mark_tree_children PARAMS ((union tree_node *));
ggc_mark_rtx_children (r__); \
} while (0)
-#define ggc_mark_tree(EXPR) \
- do { \
- tree t__ = (EXPR); \
- if (ggc_test_and_set_mark (t__)) \
- ggc_mark_tree_children (t__); \
+#define ggc_mark_tree(EXPR) \
+ do { \
+ tree t__ = (EXPR); \
+ if (ggc_test_and_set_mark (t__)) \
+ VARRAY_PUSH_TREE (ggc_pending_trees, t__); \
} while (0)
#define ggc_mark_rtvec(EXPR) \
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 38fb857..8516e36 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -539,6 +539,7 @@ mark_goto_fixup (g)
{
while (g)
{
+ ggc_mark (g);
ggc_mark_rtx (g->before_jump);
ggc_mark_tree (g->target);
ggc_mark_tree (g->context);
@@ -1002,7 +1003,7 @@ expand_fixup (tree_label, rtl_label, last_insn)
{
/* Ok, a fixup is needed. Add a fixup to the list of such. */
struct goto_fixup *fixup
- = (struct goto_fixup *) oballoc (sizeof (struct goto_fixup));
+ = (struct goto_fixup *) ggc_alloc_obj (sizeof (struct goto_fixup), 0);
/* In case an old stack level is restored, make sure that comes
after any pending stack adjust. */
/* ?? If the fixup isn't to come at the present position,