This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch#2] dwarf2out: Drop the size + performance overhead of DW_AT_sibling
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.
--- 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);