From: Richard Biener Date: Tue, 29 Aug 2017 12:15:57 +0000 (+0000) Subject: dwarf2out.c (add_dwarf_attr): When checking is enabled verify we do not add a DW_AT_i... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=12d847913a96fc78111f22f4caea9bdf707b8566;p=gcc.git dwarf2out.c (add_dwarf_attr): When checking is enabled verify we do not add a DW_AT_inline attribute twice. 2017-08-29 Richard Biener * dwarf2out.c (add_dwarf_attr): When checking is enabled verify we do not add a DW_AT_inline attribute twice. (gen_subprogram_die): Remove code setting DW_AT_inline on DECL_ABSTRACT_P nodes. From-SVN: r251409 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f8f6491dea1..0002ce1ff48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-08-29 Richard Biener + + * dwarf2out.c (add_dwarf_attr): When checking is enabled verify + we do not add a DW_AT_inline attribute twice. + (gen_subprogram_die): Remove code setting DW_AT_inline on + DECL_ABSTRACT_P nodes. + 2017-08-29 Richard Sandiford * gimplify.c (gimplify_call_expr): Copy the nothrow flag to diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 574307e703b..7120f4edf02 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -4122,6 +4122,16 @@ add_dwarf_attr (dw_die_ref die, dw_attr_node *attr) if (die == NULL) return; + if (flag_checking) + { + /* Check we do not add duplicate attrs. Can't use get_AT here + because that recurses to the specification/abstract origin DIE. */ + dw_attr_node *a; + unsigned ix; + FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a) + gcc_assert (a->dw_attr != attr->dw_attr || a->dw_attr != DW_AT_inline); + } + vec_safe_reserve (die->die_attr, 1); vec_safe_push (die->die_attr, *attr); } @@ -22082,28 +22092,6 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) add_AT_flag (subr_die, DW_AT_rvalue_reference, 1); } } - /* Tag abstract instances with DW_AT_inline. */ - else if (DECL_ABSTRACT_P (decl)) - { - if (DECL_DECLARED_INLINE_P (decl)) - { - if (cgraph_function_possibly_inlined_p (decl)) - add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_inlined); - else - add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_not_inlined); - } - else - { - if (cgraph_function_possibly_inlined_p (decl)) - add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_inlined); - else - add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_not_inlined); - } - - if (DECL_DECLARED_INLINE_P (decl) - && lookup_attribute ("artificial", DECL_ATTRIBUTES (decl))) - add_AT_flag (subr_die, DW_AT_artificial, 1); - } /* For non DECL_EXTERNALs, if range information is available, fill the DIE with it. */ else if (!DECL_EXTERNAL (decl) && !early_dwarf)