[PATCH] Save some memory at debug stream-in time

Richard Biener rguenther@suse.de
Tue Nov 3 12:58:53 GMT 2020


This allows us to release references to BLOCKs by not keeping
them rooted in the external_die_map but instead remove it from
there as soon as we created the corresponding stub DIE.  For
decls it doesn't help since we still keep the decl_die_table.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

2020-11-03  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (maybe_create_die_with_external_ref): Remove
	hashtable entry.
---
 gcc/dwarf2out.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 534877babfb..64ac94a8cbd 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5974,6 +5974,7 @@ maybe_create_die_with_external_ref (tree decl)
 
   const char *sym = desc->sym;
   unsigned HOST_WIDE_INT off = desc->off;
+  external_die_map->remove (decl);
 
   in_lto_p = false;
   dw_die_ref die = (TREE_CODE (decl) == BLOCK
-- 
2.26.2


More information about the Gcc-patches mailing list