aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-08-29 12:15:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-08-29 12:15:57 +0000
commit12d847913a96fc78111f22f4caea9bdf707b8566 (patch)
tree1d3a033f3cf255dfb20ce45e8c8fdbd342b82cec /gcc
parent0694da45b3f362bf099d49ad5babff5a04feb047 (diff)
downloadgcc-12d847913a96fc78111f22f4caea9bdf707b8566.zip
gcc-12d847913a96fc78111f22f4caea9bdf707b8566.tar.gz
gcc-12d847913a96fc78111f22f4caea9bdf707b8566.tar.bz2
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 <rguenther@suse.de> * 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c32
2 files changed, 17 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f8f6491..0002ce1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-29 Richard Biener <rguenther@suse.de>
+
+ * 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 <richard.sandiford@linaro.org>
* gimplify.c (gimplify_call_expr): Copy the nothrow flag to
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 574307e..7120f4e 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)