From: Richard Biener Date: Wed, 10 Jan 2018 14:23:29 +0000 (+0000) Subject: re PR debug/83765 (LTO bootstrap with Ada fails) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31a3f58f9bc947ecf3d59eb210199a3e5ca0b49f;p=gcc.git re PR debug/83765 (LTO bootstrap with Ada fails) 2018-01-10 Richard Biener PR debug/83765 * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration early out so it also covers the case where we have a non-NULL origin. From-SVN: r256428 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f0e9e5948a2..01a89c72ef3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-10 Richard Biener + + PR debug/83765 + * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration + early out so it also covers the case where we have a non-NULL + origin. + 2018-01-10 Richard Sandiford PR tree-optimization/83753 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a34b294106c..b70856fce8b 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -22044,6 +22044,11 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) 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_ref context_die) 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.