public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8281] debug/113488 - DW_AT_abstract_origin to self
@ 2024-01-19  9:43 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2024-01-19  9:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:62b59bc4f70d02a485c527aa3277f4b4010edb6b

commit r14-8281-g62b59bc4f70d02a485c527aa3277f4b4010edb6b
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jan 19 09:50:43 2024 +0100

    debug/113488 - DW_AT_abstract_origin to self
    
    The new sanity check avoiding creating of DIE refs to self triggers
    on the PRs testcase when using -g1 and -ffat-lto-objects as while
    early DWARF with -g1 doesn't contain any DIEs for LABEL_DECLs later
    cloning will still mark DECLs as in if they would via
    dwarf2out_abstract_function calling set_block_origin_self.
    
    Instead of messing with the delicate setup of dwarf2out at this stage
    the following simply rectifies things after the fact during LTO
    streaming when the decl indicates there's an early DIE but there
    isn't fixup that indication.
    
            PR debug/113488
            * lto-streamer-in.cc (lto_read_tree_1): When there isn't
            an early DIE but there should be, do not pretend there is.

Diff:
---
 gcc/lto-streamer-in.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/lto-streamer-in.cc b/gcc/lto-streamer-in.cc
index bef0743b2cd..ad0ca24007a 100644
--- a/gcc/lto-streamer-in.cc
+++ b/gcc/lto-streamer-in.cc
@@ -1746,6 +1746,11 @@ lto_read_tree_1 (class lto_input_block *ib, class data_in *data_in, tree expr)
 	  dref_entry e = { expr, str, off };
 	  dref_queue.safe_push (e);
 	}
+      /* When there's no early DIE to refer to but dwarf2out set up
+	 things in a way to expect that fixup.  This tends to happen
+	 with -g1, see for example PR113488.  */
+      else if (DECL_P (expr) && DECL_ABSTRACT_ORIGIN (expr) == expr)
+	DECL_ABSTRACT_ORIGIN (expr) = NULL_TREE;
     }
 }

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

only message in thread, other threads:[~2024-01-19  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19  9:43 [gcc r14-8281] debug/113488 - DW_AT_abstract_origin to self 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).