diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f8f6491dea13d55f9341ec28db98f414779a858e..0002ce1ff488e51ff82747f437bc889389a18650 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 574307e703b5eb789c7e495b5a827f01db86f9ee..7120f4edf029d035a257e0e64c3e84618bc7f0a3 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)