Hi!
gengtype has an option '-d' which allows to dump it's internal state. I planned
to use it in order to create some kind of list of all data which GCC stores in
garbage-collected memory.
Unfortunately this option was broken. The attached patch fixes it. Because it
only affects gengtype's internal debugging option (and is also rather small), I
think it's OK to commit it without approve (as obvious).
Bootstrapped and regtested on x86_64-pc-linux-gnu.
--
Regards,
Mikhail Maltsev
gcc/ChangeLog:
2015-10-18 Mikhail Maltsev <[email protected]>
PR other/65800
* gengtype.c (dump_type): Handle TYPE_UNDEFINED correctly.
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 866d809..8c5c36d 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -4878,10 +4878,17 @@ dump_type (int indent, type_p t)
{
PTR *slot;
+ printf ("%*cType at %p: ", indent, ' ', (void *) t);
+ if (t->kind == TYPE_UNDEFINED)
+ {
+ gcc_assert (t->gc_used == GC_UNUSED);
+ printf ("undefined.\n");
+ return;
+ }
+
if (seen_types == NULL)
seen_types = htab_create (100, htab_hash_pointer, htab_eq_pointer, NULL);
- printf ("%*cType at %p: ", indent, ' ', (void *) t);
slot = htab_find_slot (seen_types, t, INSERT);
if (*slot != NULL)
{