diff options
author | Richard Biener <rguenther@suse.de> | 2018-07-20 11:13:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-07-20 11:13:47 +0000 |
commit | efe0e6cd21477033d1b62343f61fefa0fc4ea6d1 (patch) | |
tree | 0235db53e067d1a79e09b22cca7388dc37b3423e /gcc/lto | |
parent | 4e51aacb1c5b97b07438a62e7654507c6c7a9986 (diff) | |
download | gcc-efe0e6cd21477033d1b62343f61fefa0fc4ea6d1.zip gcc-efe0e6cd21477033d1b62343f61fefa0fc4ea6d1.tar.gz gcc-efe0e6cd21477033d1b62343f61fefa0fc4ea6d1.tar.bz2 |
re PR debug/86585 (ICE in gen_member_die, at dwarf2out.c:24935)
2018-07-20 Richard Biener <rguenther@suse.de>
PR debug/86585
* dwarf2out.c (dwarf2out_die_ref_for_decl): Test in_lto_p
to cover -flto-partition=none.
lto/
* lto.c (unify_scc): Before we throw away an SCC see if we
can amend prevailing single-entry SCC with debug refs.
* g++.dg/lto/pr86585_0.C: New testcase.
* g++.dg/lto/pr86585_1.C: Likewise.
From-SVN: r262901
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto.c | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 91e8647..209a838 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2018-07-20 Richard Biener <rguenther@suse.de> + + PR debug/86585 + * lto.c (unify_scc): Before we throw away an SCC see if we + can amend prevailing single-entry SCC with debug refs. + 2018-07-13 Jan Hubicka <hubicka@ucw.cz> * lto.c (do_stream_out): Add PART parameter; open dump file. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index d1add15..8db280e 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1638,6 +1638,21 @@ unify_scc (struct data_in *data_in, unsigned from, to the tree node mapping computed by compare_tree_sccs. */ if (len == 1) { + /* If we got a debug reference queued, see if the prevailing + tree has a debug reference and if not, register the one + for the tree we are about to throw away. */ + if (dref_queue.length () == 1) + { + dref_entry e = dref_queue.pop (); + gcc_assert (e.decl + == streamer_tree_cache_get_tree (cache, from)); + const char *sym; + unsigned HOST_WIDE_INT off; + if (!debug_hooks->die_ref_for_decl (pscc->entries[0], &sym, + &off)) + debug_hooks->register_external_die (pscc->entries[0], + e.sym, e.off); + } lto_maybe_register_decl (data_in, pscc->entries[0], from); streamer_tree_cache_replace_tree (cache, pscc->entries[0], from); } @@ -1669,7 +1684,9 @@ unify_scc (struct data_in *data_in, unsigned from, free_node (scc->entries[i]); } - /* Drop DIE references. */ + /* Drop DIE references. + ??? Do as in the size-one SCC case which involves sorting + the queue. */ dref_queue.truncate (0); break; |