public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR91772
@ 2019-09-17 13:51 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2019-09-17 13:51 UTC (permalink / raw)
  To: gcc-patches


When early debug is missing at LTRANS time we create DIEs using
full-blown dwarf2out_decl.  In that case it doesn't make sense
to try adding a location again, instead that might ICE as seen
in the PR.

Bootstrapped / tested on x86_64-unknown-linux-gnu, applied to trunk sofar.

Richard.

2019-09-17  Richard Biener  <rguenther@suse.de>

	PR debug/91772
	* dwarf2out.c (dwarf2out_late_global_decl): If early dwarf
	was missing generate locations only once.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 275800)
+++ gcc/dwarf2out.c	(working copy)
@@ -26647,16 +26651,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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-17 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 13:51 [PATCH] Fix PR91772 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).