[patch#2] dwarf2out: Drop the size + performance overhead of DW_AT_sibling
diff mbox

Message ID 20111018082809.GA30776@host1.jankratochvil.net
State New
Headers show

Commit Message

Jan Kratochvil Oct. 18, 2011, 8:28 a.m. UTC
On Tue, 18 Oct 2011 09:24:08 +0200, Tristan Gingold wrote:
> What is wrong with my suggestion of adding a command line option to keep the
> siblings ?  This option could be removed in a few years if nobody complained
> about sibling removal.

I find an extra option just a pollution of doc and everything by an option
which will never get used.  Wouldn't it be enough to disable it by
-gstrict-dwarf?  While currently the -gstrict-dwarf meaning is different
I believe the purpose is correct - to be more backward compatible.


Thanks,
Jan


gcc/
2011-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Stop producing DW_AT_sibling without -gstrict-dwarf.
	* dwarf2out.c (dwarf2out_finish): Remove calls of
	add_sibling_attributes if !DWARF_STRICT.  Extend the comment with
	reason.

Comments

Jakub Jelinek Oct. 18, 2011, 8:38 a.m. UTC | #1
On Tue, Oct 18, 2011 at 10:28:09AM +0200, Jan Kratochvil wrote:
> 2011-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	Stop producing DW_AT_sibling without -gstrict-dwarf.
> 	* dwarf2out.c (dwarf2out_finish): Remove calls of
> 	add_sibling_attributes if !DWARF_STRICT.  Extend the comment with
> 	reason.

This is ok for trunk.

	Jakub
Jan Kratochvil Oct. 20, 2011, 2:24 p.m. UTC | #2
On Tue, 18 Oct 2011 10:38:23 +0200, Jakub Jelinek wrote:
> On Tue, Oct 18, 2011 at 10:28:09AM +0200, Jan Kratochvil wrote:
> > 2011-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > 
> > 	Stop producing DW_AT_sibling without -gstrict-dwarf.
> > 	* dwarf2out.c (dwarf2out_finish): Remove calls of
> > 	add_sibling_attributes if !DWARF_STRICT.  Extend the comment with
> > 	reason.
> 
> This is ok for trunk.

FYI this patch has not yet been checked in, it has negative performance effect
on the systemtap DWARF consumer.
	http://sourceware.org/ml/archer/2011-q4/msg00004.html

I will post a patch removing only very short DW_AT_sibling skips later.


Thanks,
Jan

Patch
diff mbox

--- gcc/dwarf2out.c	(revision 180121)
+++ gcc/dwarf2out.c	(working copy)
@@ -22496,13 +22496,17 @@  dwarf2out_finish (const char *filename)
       prune_unused_types ();
     }
 
-  /* Traverse the DIE's and add add sibling attributes to those DIE's
-     that have children.  */
-  add_sibling_attributes (comp_unit_die ());
-  for (node = limbo_die_list; node; node = node->next)
-    add_sibling_attributes (node->die);
-  for (ctnode = comdat_type_list; ctnode != NULL; ctnode = ctnode->next)
-    add_sibling_attributes (ctnode->root_die);
+  if (dwarf_strict)
+    {
+      /* Traverse the DIE's and add add sibling attributes to those DIE's that
+	 have children.  It is produced only for compatibility reasons as it is
+	 both a size and consumer performance hit.  */
+      add_sibling_attributes (comp_unit_die ());
+      for (node = limbo_die_list; node; node = node->next)
+	add_sibling_attributes (node->die);
+      for (ctnode = comdat_type_list; ctnode != NULL; ctnode = ctnode->next)
+	add_sibling_attributes (ctnode->root_die);
+    }
 
   /* Output a terminator label for the .text section.  */
   switch_to_section (text_section);