aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog22
-rw-r--r--gcc/Makefile.in8
-rw-r--r--gcc/emit-rtl.c9
-rw-r--r--gcc/expr.c3
-rw-r--r--gcc/expr.h4
-rw-r--r--gcc/profile.c2
-rw-r--r--gcc/scan.c5
-rw-r--r--gcc/stor-layout.c11
-rw-r--r--gcc/toplev.c1
9 files changed, 58 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f9b2e25..f3f3008 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,25 @@
+Sat Sep 4 20:40:19 1999 Richard Henderson <rth@cygnus.com>
+ Bernd Schmidt <bernds@cygnus.co.uk>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (stor-layout.o): Depend on ggc.h.
+ (expr.o): Depend on ggc.h.
+ (profile.o): Depend on ggc.h.
+ (stor-layout.o): Depend on ggc.h.
+ * emit-rtl.c (init_emit_once): Add gc roots.
+ * expr.c: Include ggc.h.
+ (emit_block_move): Add gc roots.
+ (clear_storage): Likewise.
+ * expr.h (init_stor_layout_once): New function.
+ * profile.c: Include ggc.h.
+ (init_arc_profiler): profiler_label is a root.
+ * scan.c (make_sstring_space): Trust xrealloc to function
+ correctly with first parameter NULL.
+ * stor-layout.c: Include ggc.h.
+ (set_sizetype): Add gc root.
+ (init_stor_layout_once): New function.
+ * toplev.c (compile_file): Call it.
+
Sat Sep 4 19:26:25 1999 Richard Henderson <rth@cygnus.com>
Bernd Schmidt <bernds@cygnus.co.uk>
Mark Mitchell <mark@codesourcery.com>
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 77f2b02..789bd0b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1454,7 +1454,7 @@ tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h \
ggc.h
print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H)
stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \
- function.h $(EXPR_H) $(RTL_H) toplev.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)
toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
@@ -1486,7 +1486,8 @@ except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.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
+ output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
+ ggc.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,8 @@ resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \
lcm.o : lcm.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)
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
+ gcov-io.h $(TREE_H) output.h $(REGS_H) toplev.h function.h insn-config.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 \
function.h toplev.h varray.h
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index a781e2d..0b2c10de 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3685,6 +3685,15 @@ init_emit_once (line_numbers)
init_function_start. */
INIT_EXPANDERS;
#endif
+
+ ggc_add_rtx_root (&const_tiny_rtx[0][0], sizeof(const_tiny_rtx)/sizeof(rtx));
+
+ ggc_add_rtx_root (&pic_offset_table_rtx, 1);
+ ggc_add_rtx_root (&struct_value_rtx, 1);
+ ggc_add_rtx_root (&struct_value_incoming_rtx, 1);
+ ggc_add_rtx_root (&static_chain_rtx, 1);
+ ggc_add_rtx_root (&static_chain_incoming_rtx, 1);
+ ggc_add_rtx_root (&return_address_pointer_rtx, 1);
}
/* Query and clear/ restore no_line_numbers. This is used by the
diff --git a/gcc/expr.c b/gcc/expr.c
index 967c3e7..315945a 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */
#include "typeclass.h"
#include "defaults.h"
#include "toplev.h"
+#include "ggc.h"
#define CEIL(x,y) (((x) + (y) - 1) / (y))
@@ -1677,6 +1678,7 @@ emit_block_move (x, y, size, align)
fntype = build_pointer_type (void_type_node);
fntype = build_function_type (fntype, NULL_TREE);
fn = build_decl (FUNCTION_DECL, fn, fntype);
+ ggc_add_tree_root (&fn, 1);
DECL_EXTERNAL (fn) = 1;
TREE_PUBLIC (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
@@ -2451,6 +2453,7 @@ clear_storage (object, size, align)
fntype = build_pointer_type (void_type_node);
fntype = build_function_type (fntype, NULL_TREE);
fn = build_decl (FUNCTION_DECL, fn, fntype);
+ ggc_add_tree_root (&fn, 1);
DECL_EXTERNAL (fn) = 1;
TREE_PUBLIC (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
diff --git a/gcc/expr.h b/gcc/expr.h
index e27797a..958412e 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -878,6 +878,10 @@ extern void init_expr_once PROTO((void));
/* This is run at the start of compiling a function. */
extern void init_expr PROTO((void));
+/* This function is run once to initialize stor-layout.c. */
+
+extern void init_stor_layout_once PROTO((void));
+
/* This is run at the end of compiling a function. */
extern void finish_expr_for_function PROTO((void));
diff --git a/gcc/profile.c b/gcc/profile.c
index f39ea9c..98be128 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -54,6 +54,7 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "gcov-io.h"
#include "toplev.h"
+#include "ggc.h"
/* One of these is dynamically created whenever we identify an arc in the
function. */
@@ -1544,6 +1545,7 @@ init_arc_profiler ()
char *name = xmalloc (20);
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
profiler_label = gen_rtx_SYMBOL_REF (Pmode, name);
+ ggc_add_rtx_root (&profiler_label, 1);
}
/* Output instructions as RTL to increment the arc execution count. */
diff --git a/gcc/scan.c b/gcc/scan.c
index 156cd0e..24dd6632 100644
--- a/gcc/scan.c
+++ b/gcc/scan.c
@@ -35,10 +35,7 @@ make_sstring_space (str, count)
if (new_size <= cur_size)
return;
- if (str->base == NULL)
- str->base = xmalloc (new_size);
- else
- str->base = xrealloc (str->base, new_size);
+ str->base = xrealloc (str->base, new_size);
str->ptr = str->base + cur_size;
str->limit = str->base + new_size;
}
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 8707c8f..7c94f40 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "expr.h"
#include "toplev.h"
+#include "ggc.h"
#define CEIL(x,y) (((x) + (y) - 1) / (y))
@@ -1256,6 +1257,8 @@ set_sizetype (type)
usizetype = make_unsigned_type (oprecision);
ubitsizetype = make_unsigned_type (precision);
}
+
+ ggc_add_tree_root ((tree*) &sizetype_tab, sizeof(sizetype_tab)/sizeof(tree));
}
/* Set the extreme values of TYPE based on its precision in bits,
@@ -1387,3 +1390,11 @@ get_best_mode (bitsize, bitpos, align, largest_mode, volatilep)
return mode;
}
+
+/* This function is run once to initialize stor-layout.c. */
+
+void
+init_stor_layout_once ()
+{
+ ggc_add_tree_root (&pending_sizes, 1);
+}
diff --git a/gcc/toplev.c b/gcc/toplev.c
index eaa013e..becdfe0 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2936,6 +2936,7 @@ compile_file (name)
init_reload ();
init_alias_once ();
init_function_once ();
+ init_stor_layout_once ();
/* The following initialization functions need to generate rtl, so
provide a dummy function context for them. */