This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 2/3] move gimple_canonical_types htab out of gc memory
- From: tsaunders at mozilla dot com
- To: gcc-patches at gcc dot gnu dot org
- Cc: Trevor Saunders <tsaunders at mozilla dot com>
- Date: Sun, 23 Nov 2014 23:11:35 -0500
- Subject: [PATCH 2/3] move gimple_canonical_types htab out of gc memory
- Authentication-results: sourceware.org; auth=none
- References: <1416802296-15833-1-git-send-email-tsaunders at mozilla dot com>
From: Trevor Saunders <tsaunders@mozilla.com>
Hi,
The memory allocated for the hash table is never rooted by anything, so keeping
it in gc memory only works if it never needs to survive a gc.
Trev
lto/
* lto.c (read_cgraph_and_symbols): allocate gimple_canonical_types
htab with malloc instead of ggc.
---
gcc/lto/lto.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index a1cd958..1ff02f8 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2926,8 +2926,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
symtab->state = LTO_STREAMING;
canonical_type_hash_cache = new hash_map<const_tree, hashval_t> (251);
- gimple_canonical_types = htab_create_ggc (16381, gimple_canonical_type_hash,
- gimple_canonical_type_eq, 0);
+ gimple_canonical_types = htab_create (16381, gimple_canonical_type_hash,
+ gimple_canonical_type_eq, NULL);
gcc_obstack_init (&tree_scc_hash_obstack);
tree_scc_hash = new hash_table<tree_scc_hasher> (4096);
--
2.1.3