aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-09-24 22:58:27 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-09-24 18:58:27 -0400
commit6abba05560580219d98dc5e14f1215f8349b3fb2 (patch)
tree6c6496ddfab6090a9d5faadc6583b1547f05c9ff /gcc/tree.c
parent4ed5bcfb1ed415c32bdd8735b2cd0ea0ed37e8b6 (diff)
downloadgcc-6abba05560580219d98dc5e14f1215f8349b3fb2.zip
gcc-6abba05560580219d98dc5e14f1215f8349b3fb2.tar.gz
gcc-6abba05560580219d98dc5e14f1215f8349b3fb2.tar.bz2
tree.c (type_hash_marked_p): Consider as marked if debug symbol number has been set.
* tree.c (type_hash_marked_p): Consider as marked if debug symbol number has been set. (type_hash_mark): Mark type itself. From-SVN: r45794
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 1741f6a..8a8d22d 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3139,22 +3139,31 @@ type_hash_canon (hashcode, type)
}
}
-/* See if the data pointed to by the type hash table is marked. */
+/* See if the data pointed to by the type hash table is marked. We consider
+ it marked if the type is marked or if a debug type number or symbol
+ table entry has been made for the type. This reduces the amount of
+ debugging output and eliminates that dependency of the debug output on
+ the number of garbage collections. */
static int
type_hash_marked_p (p)
const void *p;
{
- return ggc_marked_p (((struct type_hash *) p)->type);
+ tree type = ((struct type_hash *) p)->type;
+
+ return ggc_marked_p (type) || TYPE_SYMTAB_POINTER (type);
}
-/* Mark the entry in the type hash table the type it points to is marked. */
+/* Mark the entry in the type hash table the type it points to is marked.
+ Also mark the type in case we are considering this entry "marked" by
+ virtue of TYPE_SYMTAB_POINTER being set. */
static void
type_hash_mark (p)
const void *p;
{
ggc_mark (p);
+ ggc_mark_tree (((struct type_hash *) p)->type);
}
/* Mark the hashtable slot pointed to by ENTRY (which is really a