This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[dwarf4 patch] Fix ICE in output_die when using -gdwarf-4


I'm checking in this patch to the dwarf4 branch, to fix a problem
where the compiler would hit an ICE in output_die() if a declaration
of a type is nested inside a non-defining declaration of a containing
type.

-cary


	* dwarf2out.c (prune_unused_types_mark): Do not mark children of
	non-defining declarations of types when using -gdwarf-4.


Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 148100)
+++ dwarf2out.c	(working copy)
@@ -17661,9 +17661,10 @@ prune_unused_types_mark (dw_die_ref die,
       /* If this is an array type, we need to make sure our
 	 kids get marked, even if they're types.  If we're
 	 breaking out types into comdat sections, do this
-	 for all types.  */
+	 for all type definitions.  */
       if (die->die_tag == DW_TAG_array_type
-          || (use_dwarf4_extensions && is_type_die (die)))
+          || (use_dwarf4_extensions
+              && is_type_die (die) && ! is_declaration_die (die)))
 	FOR_EACH_CHILD (die, c, prune_unused_types_mark (c, 1));
       else
 	FOR_EACH_CHILD (die, c, prune_unused_types_walk (c));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]