From: Richard Biener Date: Tue, 17 Sep 2019 13:52:20 +0000 (+0000) Subject: re PR debug/91772 (ICE in add_dwarf_attr, at dwarf2out.c:4412 since r259749) X-Git-Tag: misc/cutover-git~2706 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1160be126809af874f3d68a514bf38b63076d1cd;p=thirdparty%2Fgcc.git re PR debug/91772 (ICE in add_dwarf_attr, at dwarf2out.c:4412 since r259749) 2019-09-17 Richard Biener PR debug/91772 * dwarf2out.c (dwarf2out_late_global_decl): If early dwarf was missing generate locations only once. From-SVN: r275804 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0cbb512bb1d7..6d0337748058 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-09-17 Richard Biener + + PR debug/91772 + * dwarf2out.c (dwarf2out_late_global_decl): If early dwarf + was missing generate locations only once. + 2019-09-17 Feng Xue PR ipa/91089 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c359c2d4af98..5698c82f7dfe 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -26660,16 +26660,12 @@ dwarf2out_late_global_decl (tree decl) { dw_die_ref die = lookup_decl_die (decl); - /* We may have to generate early debug late for LTO in case debug + /* We may have to generate full debug late for LTO in case debug was not enabled at compile-time or the target doesn't support the LTO early debug scheme. */ if (! die && in_lto_p) - { - dwarf2out_decl (decl); - die = lookup_decl_die (decl); - } - - if (die) + dwarf2out_decl (decl); + else if (die) { /* We get called via the symtab code invoking late_global_decl for symbols that are optimized out.