OSDN Git Service

* Makefile.in (stor-layout.o): Depend on ggc.h.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 5 Sep 1999 03:49:52 +0000 (03:49 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 5 Sep 1999 03:49:52 +0000 (03:49 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29122 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/Makefile.in
gcc/emit-rtl.c
gcc/expr.c
gcc/expr.h
gcc/profile.c
gcc/scan.c
gcc/stor-layout.c
gcc/toplev.c

index f9b2e25..f3f3008 100644 (file)
@@ -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>
index 77f2b02..789bd0b 100644 (file)
@@ -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
index a781e2d..0b2c10d 100644 (file)
@@ -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);
 }
 \f
 /* Query and clear/ restore no_line_numbers.  This is used by the
index 967c3e7..315945a 100644 (file)
@@ -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;
index e27797a..958412e 100644 (file)
@@ -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));
 
index f39ea9c..98be128 100644 (file)
@@ -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.  */
index 156cd0e..24dd663 100644 (file)
@@ -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;
 }
index 8707c8f..7c94f40 100644 (file)
@@ -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);
+}
index eaa013e..becdfe0 100644 (file)
@@ -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.  */