This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix debug/17787, infinite loop with -feliminate-unused-debug-symbols
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 1 Oct 2004 20:37:44 -0400
- Subject: [PATCH] Fix debug/17787, infinite loop with -feliminate-unused-debug-symbols
I tried to bootstrap with Ada turned on powerpc-apple-darwin and I got
a bootstrap failure while compiling some Ada code with stage1's gnat1.
We would run out of memory because we kept on adding the same type_decl
to symbol queue. The problem is that we semi treating RECORD only
partially specially in that we would record the TYPE_NAME even if we
should not be.
OK? Bootstrapped on powerpc-apple-darwin with no regressions.
I did not check the gdb testsuite as this should not effect the
debugging output of non-Ada code.
ChangeLog:
* dbxout.c (dbxout_symbol): Really handle RECORD, UNION, and
ENUMs specially instead of just saying we do.
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.204
diff -u -p -r1.204 dbxout.c
--- dbxout.c 24 Sep 2004 06:17:01 -0000 1.204
+++ dbxout.c 2 Oct 2004 00:25:25 -0000
@@ -2182,22 +2182,24 @@ dbxout_symbol (tree decl, int local ATTR
a different name. In that case we also want to output
that. */
- if ((TREE_CODE (t) == RECORD_TYPE
+ if (TREE_CODE (t) == RECORD_TYPE
|| TREE_CODE (t) == UNION_TYPE
|| TREE_CODE (t) == QUAL_UNION_TYPE
|| TREE_CODE (t) == ENUMERAL_TYPE)
- && TYPE_STUB_DECL (t)
- && TYPE_STUB_DECL (t) != decl
- && DECL_P (TYPE_STUB_DECL (t))
- && ! DECL_IGNORED_P (TYPE_STUB_DECL (t)))
{
- debug_queue_symbol (TYPE_STUB_DECL (t));
- if (TYPE_NAME (t)
- && TYPE_NAME (t) != TYPE_STUB_DECL (t)
- && TYPE_NAME (t) != decl
- && DECL_P (TYPE_NAME (t)))
- debug_queue_symbol (TYPE_NAME (t));
- }
+ if (TYPE_STUB_DECL (t)
+ && TYPE_STUB_DECL (t) != decl
+ && DECL_P (TYPE_STUB_DECL (t))
+ && ! DECL_IGNORED_P (TYPE_STUB_DECL (t)))
+ {
+ debug_queue_symbol (TYPE_STUB_DECL (t));
+ if (TYPE_NAME (t)
+ && TYPE_NAME (t) != TYPE_STUB_DECL (t)
+ && TYPE_NAME (t) != decl
+ && DECL_P (TYPE_NAME (t)))
+ debug_queue_symbol (TYPE_NAME (t));
+ }
+ }
else if (TYPE_NAME (t)
&& TYPE_NAME (t) != decl
&& DECL_P (TYPE_NAME (t)))