[PATCH 1/5] Downgrade debug_args_for_decl to non-cache
Without this patch, but with patch "Don't mark live recursively in
gt_cleare_cache" when compiling libgcov-driver.c -m32 we run into:
...
0x133e0e8 void gt_cleare_cache<tree_vec_map_cache_hasher>(hash_table<tree_vec_map_cache_hasher, xcallocator>*)
/home/vries/gcc_versions/devel/src/gcc/hash-table.h:1114
0x133b51f gt_clear_caches_gt_tree_h()
./gt-tree.h:425
0x6c835f gt_clear_caches()
./gtype-c.h:151
0xa8e56e ggc_mark_roots()
/home/vries/gcc_versions/devel/src/gcc/ggc-common.c:103
0x7f724e ggc_collect()
/home/vries/gcc_versions/devel/src/gcc/ggc-page.c:2183
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
...
The offending cache entry is:
...
(gdb) call debug_generic_expr ( (*iter).base.from )
merge_summary.isra.1
(gdb) call debug_generic_expr ( (*iter).to.m_vecdata[0] )
all_prg
(gdb) call debug_generic_expr ( (*iter).to.m_vecdata[1] )
D#8
...
2015-07-10 Tom de Vries <tom@codesourcery.com>
PR libgomp/66714
* tree.c (struct tree_vec_map_hasher): New struct.
(debug_args_for_decl): Use tree_vec_map_hasher instead of
tree_vec_map_cache_hasher. Don't use cache GTY attribute.
(decl_debug_args_insert): Allocate debug_args_for_decl using new type.
---
gcc/tree.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
@@ -268,8 +268,25 @@ struct tree_vec_map_cache_hasher : ggc_cache_ptr_hash<tree_vec_map>
}
};
+struct tree_vec_map_hasher : ggc_ptr_hash<tree_vec_map>
+{
+ static hashval_t hash (tree_vec_map *m) { return DECL_UID (m->base.from); }
+
+ static bool
+ equal (tree_vec_map *a, tree_vec_map *b)
+ {
+ return a->base.from == b->base.from;
+ }
+};
+
+/* TODO: Figure out whether we can declare debug_args_for_decl as:
+
static GTY ((cache))
hash_table<tree_vec_map_cache_hasher> *debug_args_for_decl;
+*/
+
+static GTY (())
+ hash_table<tree_vec_map_hasher> *debug_args_for_decl;
static void set_type_quals (tree, int);
static void print_type_hash_statistics (void);
@@ -6870,7 +6887,7 @@ decl_debug_args_insert (tree from)
if (DECL_HAS_DEBUG_ARGS_P (from))
return decl_debug_args_lookup (from);
if (debug_args_for_decl == NULL)
- debug_args_for_decl = hash_table<tree_vec_map_cache_hasher>::create_ggc (64);
+ debug_args_for_decl = hash_table<tree_vec_map_hasher>::create_ggc (64);
h = ggc_alloc<tree_vec_map> ();
h->base.from = from;
h->to = NULL;
--
1.9.1