Makefile.in (ggc-simple.o): Depend on hash.h.
authorMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 6 Sep 1999 02:10:03 +0000 (02:10 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 6 Sep 1999 02:10:03 +0000 (02:10 +0000)
* Makefile.in (ggc-simple.o): Depend on hash.h.
* ggc.h (ggc_add_tree_hash_table_root): Declare.
(ggc_mark_tree_varray): Likewise.
(ggc_mark_tree_hash_table): Likewise.
* ggc-simple.c: Include hash.h.
(ggc_mark_tree_hash_table_ptr): New function.
(ggc_mark_tree_hash_table_entry): Likewise.
(ggc_mark_tree_hash_table): Likewise.
(ggc_add_tree_hash_table_root): Likewise.
* varray.h (const_equiv_data): Use struct rtx_def *, rather than

* profile.c (output_func_start_profiler): Remove apparently
nonsensical call to start_sequence.

From-SVN: r29134

gcc/ChangeLog
gcc/Makefile.in
gcc/ggc-simple.c
gcc/ggc.h
gcc/profile.c
gcc/varray.h

index 49349677dfdd61acbf611ea9f007dec0a7f1e42e..430e62bc6cb97df5047262b2ca116539ac912305 100644 (file)
@@ -1,3 +1,22 @@
+Sun Sep  5 18:57:42 1999  Mark Mitchell  <mark@codesourcery.com>
+
+       * Makefile.in (ggc-simple.o): Depend on hash.h.
+       * ggc.h (ggc_add_tree_hash_table_root): Declare.
+       (ggc_mark_tree_varray): Likewise.
+       (ggc_mark_tree_hash_table): Likewise.
+       * ggc-simple.c: Include hash.h.
+       (ggc_mark_tree_hash_table_ptr): New function.
+       (ggc_mark_tree_hash_table_entry): Likewise.
+       (ggc_mark_tree_hash_table): Likewise.
+       (ggc_add_tree_hash_table_root): Likewise.
+       * varray.h (const_equiv_data): Use struct rtx_def *, rather than
+       rtx, when defining fields.
+       
+Sun Sep  5 18:57:42 1999  Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
+
+       * profile.c (output_func_start_profiler): Remove apparently
+       nonsensical call to start_sequence.
+       
 Sun Sep  5 17:34:33 1999  Richard Henderson  <rth@cygnus.com>
 
        * clipper/clipper.c (clipper_va_start): Fix typos.
@@ -48,7 +67,7 @@ Sun Sep  5 00:35:17 1999  Richard Henderson  <rth@cygnus.com>
        (simplify_cond): Likewise.
        (simplify_text_exp): Likewise.
        (optimize_attrs): Likewise.
-       * gengentrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when
+       * gengenrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when
        GC'ing.
        (gencode): Generate a #include for ggc.h.
        * ggc-callbacks.c (ggc_p): Define it to zero.
index d60242e8a9ae1c28cfa2d6cab8a0e6f31d43fc13..5cb7a7ca2d8c49c0cdc6df49cf87c70e1c478603 100644 (file)
@@ -1433,7 +1433,7 @@ dumpvers: dumpvers.c
 version.o: version.c
 
 ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_BASE_H) $(TREE_H) flags.h \
-       ggc.h varray.h
+       ggc.h varray.h hash.h
 
 ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_BASE_H) ggc.h
 
index 0e7b53fc18570c32c15530c8d778697958f1395f..c9181a9f319e31361c24152d62778da31e032dd8 100644 (file)
@@ -25,6 +25,7 @@
 #include "ggc.h"
 #include "flags.h"
 #include "varray.h"
+#include "hash.h"
 
 /* Debugging flags.  */
 #undef GGC_DUMP
@@ -98,6 +99,9 @@ static void ggc_free_tree PROTO ((struct ggc_tree *t));
 static void ggc_mark_rtx_ptr PROTO ((void *elt));
 static void ggc_mark_tree_ptr PROTO ((void *elt));
 static void ggc_mark_tree_varray_ptr PROTO ((void *elt));
+static void ggc_mark_tree_hash_table_ptr PROTO ((void *elt));
+static boolean ggc_mark_tree_hash_table_entry PROTO ((struct hash_entry *,
+                                                     hash_table_key));
 
 /* These allocators are dreadfully simple, with no caching whatsoever so
    that Purify-like tools that do allocation versioning can catch errors.
@@ -486,6 +490,26 @@ ggc_mark_tree_varray (v)
     ggc_mark_tree (VARRAY_TREE (v, i));
 }
 
+/* Mark the hash table-entry HE.  It's key field is really a tree.  */
+
+static boolean
+ggc_mark_tree_hash_table_entry (he, k)
+     struct hash_entry *he;
+     hash_table_key k ATTRIBUTE_UNUSED;
+{
+  ggc_mark_tree ((tree) he->key);
+  return true;
+}
+
+/* Mark all the elements of the hash-table H, which contains trees.  */
+
+void
+ggc_mark_tree_hash_table (ht)
+     struct hash_table *ht;
+{
+  hash_traverse (ht, ggc_mark_tree_hash_table_entry, /*info=*/0);
+}
+
 void
 ggc_mark_string (s)
      char *s;
@@ -659,7 +683,7 @@ ggc_add_tree_root (base, nelt)
   ggc_add_root (base, nelt, sizeof(tree), ggc_mark_tree_ptr);
 }
 
-/* Add vV (a varray full of trees) to the list of GC roots.  */
+/* Add V (a varray full of trees) to the list of GC roots.  */
 
 void
 ggc_add_tree_varray_root (base, nelt)
@@ -670,6 +694,18 @@ ggc_add_tree_varray_root (base, nelt)
                ggc_mark_tree_varray_ptr);
 }
 
+/* Add HT (a hash-table where ever key is a tree) to the list of GC
+   roots.  */
+
+void
+ggc_add_tree_hash_table_root (base, nelt)
+     struct hash_table **base;
+     int nelt;
+{
+  ggc_add_root (base, nelt, sizeof (struct hash_table *), 
+               ggc_mark_tree_hash_table_ptr);
+}
+
 void
 ggc_del_root (base)
      void *base;
@@ -716,6 +752,17 @@ ggc_mark_tree_varray_ptr (elt)
   ggc_mark_tree_varray (*(varray_type *)elt);
 }
 
+/* Type-correct function to pass to ggc_add_root.  It just forwards
+   ELT (which is really a struct hash_table **) to
+   ggc_mark_tree_hash_table.  */
+
+static void
+ggc_mark_tree_hash_table_ptr (elt)
+     void *elt;
+{
+  ggc_mark_tree_hash_table (*(struct hash_table **) elt);
+}
+
 #ifdef GGC_DUMP
 /* Don't enable this unless you want a really really lot of data.  */
 static void __attribute__((constructor))
index 557ee064d791c7f1804107857860c5a8d4f20b71..5acf3e9c7eb21c910ebaa26aca68b40607d6bc1f 100644 (file)
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -37,6 +37,7 @@ struct emit_status;
 struct stmt_status;
 struct varasm_status;
 struct varray_head_tag;
+struct hash_table;
 
 /* Startup */
 
@@ -60,12 +61,15 @@ void ggc_add_root PROTO ((void *base, int nelt, int size,
 void ggc_add_rtx_root PROTO ((struct rtx_def **, int nelt));
 void ggc_add_tree_root PROTO ((union tree_node **, int nelt));
 void ggc_add_tree_varray_root PROTO ((struct varray_head_tag **, int nelt));
+void ggc_add_tree_hash_table_root PROTO ((struct hash_table **, int nelt));
 void ggc_del_root PROTO ((void *base));
 
 /* Mark nodes from the gc_add_root callback.  */
 void ggc_mark_rtx PROTO ((struct rtx_def *));
 void ggc_mark_rtvec PROTO ((struct rtvec_def *));
 void ggc_mark_tree PROTO ((union tree_node *));
+void ggc_mark_tree_varray PROTO ((struct varray_head_tag *));
+void ggc_mark_tree_hash_table PROTO ((struct hash_table *));
 void ggc_mark_string PROTO ((char *));
 
 /* Callbacks to the languages.  */
index 98be128a027f847d0d724ee9d9474f5de48bd889..38ed7a72c408761675099af62c6bc419d99a63a1 100644 (file)
@@ -1651,7 +1651,6 @@ output_func_start_profiler ()
 
   /* Synthesize a constructor function to invoke __bb_init_func with a
      pointer to this object file's profile block. */
-  start_sequence ();
 
   /* Try and make a unique name given the "file function name".
 
index 5d773a39ed1f53e28ea92a8516d98ded30d0e992..1b175eff0fad69fae5aa0cdfd245db12770036be 100644 (file)
@@ -47,7 +47,7 @@ struct const_equiv_data {
      pseudos that contain pointers into the replacement area allocated for
      this inline instance.  These pseudos are then marked as being equivalent
      to the appropriate address and substituted if valid.  */
-  rtx rtx;
+  struct rtx_def *rtx;
 
   /* Record the valid age for each entry.  The entry is invalid if its
      age is less than const_age.  */