public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [debuglocus] fix vectorizer and mudflap sharing
@ 2009-04-23 22:24 Aldy Hernandez
  2009-04-28 15:08 ` Andrew MacLeod
  0 siblings, 1 reply; 2+ messages in thread
From: Aldy Hernandez @ 2009-04-23 22:24 UTC (permalink / raw)
  To: amacleod, gcc-patches

This patch fixes the remaining debuglocus sharing violations.  We can
now bootstrap with no testsuite regressions, while forcing sharing
verification.

Andrew, I've made create_duplicate_debuglocus() work with plain location
entries, and just return the location.  This simplifies things a bit.  I
can change the caller to do the check if you prefer.

[I've been thinking that perhaps it's better to have
gimple_set_location() accept a boolean specifying whether to to call
create_duplicate_debuglocus() automatically.  Also, what do you think
about checking for duplicate entries by default and aborting-- at least
during development.]

OK for branch?

Aldy

	* debuglocus.c (create_duplicate_debuglocus): Allow non debuglocus
	entries.
	* tree-mudflap.c (mf_build_check_statement_for): Duplicate debuglocus
	entries.
	(mx_register_decls): Same.
	* tree-vect-transform.c (vect_finish_stmt_generation): Same.

Index: debuglocus.c
===================================================================
--- debuglocus.c	(revision 146577)
+++ debuglocus.c	(working copy)
@@ -297,14 +297,17 @@ debuglocus_from_pointer (debuglocus_p dl
 
 
 /* Copy the debuglocus LOCUS. This requires duplicating the debuglocus, as well
-   as any chain of debuglocus's attached to it.  */
+   as any chain of debuglocus's attached to it.
+
+   If the LOCUS is not a debuglocus, just return the LOCUS.  */
 source_location
 create_duplicate_debuglocus (source_location locus)
 {
   int root_i, new_i, src_i, dest_i, prev_dest_i;
   debuglocus_p root_p, new_p, src_p, dest_p, prev_dest_p;
 
-  gcc_assert (is_debuglocus (locus));
+  if (!is_debuglocus (locus))
+    return locus;
 
   root_i = DEBUGLOCUS_INDEX (locus);   /* Root is the locus being copied.  */
   root_p = get_debuglocus_entry (current_debuglocus_table (), root_i);
Index: tree-mudflap.c
===================================================================
--- tree-mudflap.c	(revision 146206)
+++ tree-mudflap.c	(working copy)
@@ -555,6 +555,7 @@ mf_build_check_statement_for (tree base,
   t = fold_convert (mf_uintptr_type, unshare_expr (base));
   gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
   g = gimple_build_assign (mf_base, t);
+  location = create_duplicate_debuglocus (location);
   gimple_set_location (g, location);
   gimple_seq_add_stmt (&seq, g);
 
@@ -562,6 +563,7 @@ mf_build_check_statement_for (tree base,
   t = fold_convert (mf_uintptr_type, unshare_expr (limit));
   gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
   g = gimple_build_assign (mf_limit, t);
+  location = create_duplicate_debuglocus (location);
   gimple_set_location (g, location);
   gimple_seq_add_stmt (&seq, g);
 
@@ -579,6 +581,7 @@ mf_build_check_statement_for (tree base,
   t = build1 (ADDR_EXPR, mf_cache_structptr_type, t);
   gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
   g = gimple_build_assign (mf_elem, t);
+  location = create_duplicate_debuglocus (location);
   gimple_set_location (g, location);
   gimple_seq_add_stmt (&seq, g);
 
@@ -625,6 +628,7 @@ mf_build_check_statement_for (tree base,
   gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
   cond = create_tmp_var (boolean_type_node, "__mf_unlikely_cond");
   g = gimple_build_assign  (cond, t);
+  location = create_duplicate_debuglocus (location);
   gimple_set_location (g, location);
   gimple_seq_add_stmt (&seq, g);
 
@@ -632,6 +636,7 @@ mf_build_check_statement_for (tree base,
      simply build a void COND_EXPR.  We do need labels in both arms though.  */
   g = gimple_build_cond (NE_EXPR, cond, integer_zero_node, NULL_TREE,
 			 NULL_TREE);
+  location = create_duplicate_debuglocus (location);
   gimple_set_location (g, location);
   gimple_seq_add_stmt (&seq, g);
 
@@ -1048,7 +1053,9 @@ mx_register_decls (tree decl, gimple_seq
 	  
 
           /* Accumulate the two calls.  */
+	  location = create_duplicate_debuglocus (location);
 	  gimple_set_location (register_fncall, location);
+	  location = create_duplicate_debuglocus (location);
 	  gimple_set_location (unregister_fncall, location);
 
           /* Add the __mf_register call at the current appending point.  */
Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c	(revision 146206)
+++ tree-vect-transform.c	(working copy)
@@ -2174,6 +2174,7 @@ vect_finish_stmt_generation (gimple stmt
 {
   stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
   loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+  location_t dlocus;
 
   gcc_assert (gimple_code (stmt) != GIMPLE_LABEL);
 
@@ -2187,7 +2188,8 @@ vect_finish_stmt_generation (gimple stmt
       print_gimple_stmt (vect_dump, vec_stmt, 0, TDF_SLIM);
     }
 
-  gimple_set_location (vec_stmt, gimple_location (gsi_stmt (*gsi)));
+  dlocus = create_duplicate_debuglocus (gimple_location (gsi_stmt (*gsi)));
+  gimple_set_location (vec_stmt, dlocus);
 }
 
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [debuglocus] fix vectorizer and mudflap sharing
  2009-04-23 22:24 [debuglocus] fix vectorizer and mudflap sharing Aldy Hernandez
@ 2009-04-28 15:08 ` Andrew MacLeod
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew MacLeod @ 2009-04-28 15:08 UTC (permalink / raw)
  To: Aldy Hernandez; +Cc: gcc-patches

Aldy Hernandez wrote:
> This patch fixes the remaining debuglocus sharing violations.  We can
> now bootstrap with no testsuite regressions, while forcing sharing
> verification.
>
> Andrew, I've made create_duplicate_debuglocus() work with plain location
> entries, and just return the location.  This simplifies things a bit.  I
> can change the caller to do the check if you prefer.
>
>   
Thats fine.
> [I've been thinking that perhaps it's better to have
> gimple_set_location() accept a boolean specifying whether to to call
> create_duplicate_debuglocus() automatically.  Also, what do you think
>   

I don't think I want to take that step just yet.
> about checking for duplicate entries by default and aborting-- at least
> during development.]
>
>   
The only problem is that initially the RTL side is going to have a bunch 
of duplicates, but maybe that will be ok, force me to fix them as I go.

Sure, make it abort for now.
> OK for branch?
>   

OK.

Andrew


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-28 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23 22:24 [debuglocus] fix vectorizer and mudflap sharing Aldy Hernandez
2009-04-28 15:08 ` Andrew MacLeod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).