------- Comment #3 from hjl dot tools at gmail dot com 2010-05-27 23:01 ------- This one avoids one extra is_naming_typedef_decl call:
--- Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 159943) +++ dwarf2out.c (working copy) @@ -19401,6 +19401,7 @@ gen_typedef_die (tree decl, dw_die_ref c else { tree type; + bool naming_typedef_decl = is_naming_typedef_decl (decl); add_name_and_src_coords_attributes (type_die, decl); if (DECL_ORIGINAL_TYPE (decl)) @@ -19427,13 +19428,14 @@ gen_typedef_die (tree decl, dw_die_ref c generate that DIE right away. add_type_attribute called below will then pick (via lookup_type_die) that anonymous struct DIE. */ - gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE); + if (naming_typedef_decl) + gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE); } add_type_attribute (type_die, type, TREE_READONLY (decl), TREE_THIS_VOLATILE (decl), context_die); - if (is_naming_typedef_decl (decl)) + if (naming_typedef_decl) /* We want that all subsequent calls to lookup_type_die with TYPE in argument yield the DW_TAG_typedef we have just created. */ --- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44302