On Tue, Nov 01, 2016 at 01:20:23PM -0400, Jason Merrill wrote: > On Tue, Nov 1, 2016@12:10 PM, Jakub Jelinek <ja...@redhat.com> wrote: > > + && !get_AT (var_die, DW_AT_inline) > > + && (origin_die == NULL || get_AT (origin_die, DW_AT_inline) == > > NULL) > > Can we drop this repetition (here and for DW_AT_const_expr)? get_AT > should look through DW_AT_abstract_origin, and we should have added > that earlier in gen_variable_die. > > OK with that change.
That seemed to have been the last usage of origin_die in gen_variable_die. So removing that caused: /home/mark/src/gcc/gcc/dwarf2out.c: In function ‘void gen_variable_die(tree, tree, dw_die_ref)’: /home/mark/src/gcc/gcc/dwarf2out.c:22454:14: error: variable ‘origin_die’ set but not used [-Werror=unused-but-set-variable] dw_die_ref origin_die = NULL; ^~~~~~~~~~ cc1plus: all warnings being treated as errors make[3]: *** [dwarf2out.o] Error 1 The following seems to work around that and makes things build again for me: diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5ff6f97..24b85c1 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -22451,7 +22451,6 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) tree ultimate_origin; dw_die_ref var_die; dw_die_ref old_die = decl ? lookup_decl_die (decl) : NULL; - dw_die_ref origin_die = NULL; bool declaration = (DECL_EXTERNAL (decl_or_origin) || class_or_namespace_scope_p (context_die)); bool specialization_p = false; @@ -22627,7 +22626,7 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) var_die = new_die (DW_TAG_variable, context_die, decl); if (origin != NULL) - origin_die = add_abstract_origin_attribute (var_die, origin); + add_abstract_origin_attribute (var_die, origin); /* Loop unrolling can create multiple blocks that refer to the same static variable, so we must test for the DW_AT_declaration flag. Cheers, Mark