]> git.ipfire.org Git - people/ms/gcc.git/commit
lto/106540 - fix LTO tree input wrt dwarf2out_register_external_die
authorRichard Biener <rguenther@suse.de>
Mon, 8 Aug 2022 07:07:23 +0000 (09:07 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 8 Aug 2022 09:13:13 +0000 (11:13 +0200)
commit2a1448f2763a72c83e2ec496f78243a975b0d44e
tree9ab30d7711c8b408b831ca51087fa98c4c27fc45
parent2633c8d8f338f1e2b53d3757f3edf4179bfcc218
lto/106540 - fix LTO tree input wrt dwarf2out_register_external_die

I've revisited the earlier two workarounds for dwarf2out_register_external_die
getting duplicate entries.  It turns out that r11-525-g03d90a20a1afcb
added dref_queue pruning to lto_input_tree but decl reading uses that
to stream in DECL_INITIAL even when in the middle of SCC streaming.
When that SCC then gets thrown away we can end up with debug nodes
registered which isn't supposed to happen.  The following adjusts
the DECL_INITIAL streaming to go the in-SCC way, using lto_input_tree_1,
since no SCCs are expected at this point, just refs.

PR lto/106540
PR lto/106334
* dwarf2out.cc (dwarf2out_register_external_die): Restore
original assert.
* lto-streamer-in.cc (lto_read_tree_1): Use lto_input_tree_1
to input DECL_INITIAL, avoiding to commit drefs.
gcc/dwarf2out.cc
gcc/lto-streamer-in.cc