https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83765
--- Comment #1 from Richard Biener ---
Doesn't seem to work :/
I guess making the old_die && declaration more prevalent might work.
Index: gcc/dwarf2out.c
===
--- gcc/dwarf2out.c (revision 256378)
+++ gcc/dwarf2out.c (working copy)
@@ -22044,6 +22044,11 @@ gen_subprogram_die (tree decl, dw_die_re
int declaration = (current_function_decl != decl
|| class_or_namespace_scope_p (context_die));
+ /* A declaration that has been previously dumped needs no
+ additional information. */
+ if (old_die && declaration)
+return;
+
/* Now that the C++ front end lazily declares artificial member fns, we
might need to retrofit the declaration into its class. */
if (!declaration && !origin && !old_die
@@ -22084,11 +22089,6 @@ gen_subprogram_die (tree decl, dw_die_re
much as possible. */
else if (old_die)
{
- /* A declaration that has been previously dumped needs no
-additional information. */
- if (declaration)
- return;
-
if (!get_AT_flag (old_die, DW_AT_declaration)
/* We can have a normal definition following an inline one in the
case of redefinition of GNU C extern inlines.