diff mbox

[1/5] Downgrade debug_args_for_decl to non-cache

Message ID 55A28C2F.7040202@mentor.com
State New
Headers show

Commit Message

Tom de Vries July 12, 2015, 3:47 p.m. UTC
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

Comments

Richard Biener July 14, 2015, 10:35 a.m. UTC | #1
On Sun, Jul 12, 2015 at 5:47 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> 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?

Ok.

Thanks,
Richard.

> Thanks,
> - Tom
>
diff mbox

Patch

[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