This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/5] Downgrade debug_args_for_decl to non-cache


On 12/07/15 17:45, Tom de Vries wrote:
Hi,

this patch series implements the forbidding of multi-step garbage
collection liveness dependencies between caches.

The first four patches downgrade 3 caches to non-cache, since they
introduce multi-step dependencies. This allows us to decouple:
- establishing a policy for multi-step dependencies in caches, and
- fixing issues that allow us to use these 3 as caches again.

1. Downgrade debug_args_for_decl to non-cache
2. Add struct tree_decl_map_hasher
3. Downgrade debug_expr_for_decl to non-cache
4. Downgrade value_expr_for_decl to non-cache
5. Don't mark live recursively in gt_cleare_cache

Bootstrapped and reg-tested on x86_64, with ENABLE_CHECKING.

I'll post the patches in response to this email.

This patch downgrades debug_args_for_decl to non-cache.

OK for trunk?

Thanks,
- Tom

[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(-)

diff --git a/gcc/tree.c b/gcc/tree.c
index 6628a38..5e27e48 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]