------- Comment #9 from davek at gcc dot gnu dot org 2009-09-19 10:56 ------- (In reply to comment #8) > The "ret" string is shared between some attribute and a value from > CONST_STRING.
Sorry, as I just figured out I was off by one on that: (gdb) fin Run till exit from #0 gen_label_for_indirect_string (node=0x7e945910) at /gnu/gcc/gcc-unpatched/gcc/dwarf2out.c:6849 get_debug_string_label (str=0x7f15e0b8 "ret") at /gnu/gcc/gcc-unpatched/gcc/dwarf2out.c:6864 6864 return gen_rtx_SYMBOL_REF (Pmode, node->label); (gdb) print ((struct indirect_string_node *) 0x7e945910)[0] $5 = {str = 0x7ff2f498 "ret", refcount = 2, form = 0, label = 0x8284dc0 "*LASF74"} (gdb) > But prune_unused_types_walk_attribs resets the count to 0: > /* Set the string's refcount to 0 so that prune_unused_types_mark > accounts properly for it. */ > if (AT_class (a) == dw_val_class_str) > a->dw_attr_val.v.val_str->refcount = 0; > and while attributes are walked, location lists are not and thus nothing > notices it is still used. I'll have to read the prune_unused_types stuff > carefully to understand how this can be fixed, ideally if we could just > decrement refcount in prune_unused_types_walk_attribs, as long as we are sure > it is walked for all attributes, it could fix this. Alternatively we'd have > to > walk all location lists as well, looking for labels for strings. But we're looking at the same suspect here anyway :) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41404