aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2009-04-28 19:31:18 +0000
committerAldy Hernandez <aldyh@redhat.com>2009-04-28 19:31:18 +0000
commitc1b59440a618cf57a2af221108ba0f710147acad (patch)
tree717e4ff5243458b5d78a7df8d6e368a418ed8d8c
parent11892361eba1f9524060e8f3ee438caaa13e6344 (diff)
+ * debuglocus.c (create_duplicate_debuglocus): Allow non debuglocusdebuglocus
+ 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. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/debuglocus@146911 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/debuglocus.c7
-rw-r--r--gcc/tree-mudflap.c7
-rw-r--r--gcc/tree-vect-transform.c4
4 files changed, 24 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a4d1b63f971..79d6aa7fd27 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2009-04-23 Aldy Hernandez <aldyh@redhat.com>
+
+ * 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.
+
2009-04-22 Aldy Hernandez <aldyh@redhat.com>
* gimple.c (gimple_copy): Unshare the debuglocus.
diff --git a/gcc/debuglocus.c b/gcc/debuglocus.c
index 56fee02b8a3..31993b43180 100644
--- a/gcc/debuglocus.c
+++ b/gcc/debuglocus.c
@@ -297,14 +297,17 @@ debuglocus_from_pointer (debuglocus_p dlocus)
/* 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);
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 831fcc1791a..88bd664cdb6 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -555,6 +555,7 @@ mf_build_check_statement_for (tree base, tree limit,
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, tree limit,
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, tree limit,
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, tree limit,
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, tree limit,
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 seq, location_t location)
/* 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. */
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 2afd4e03394..648a57aa3d4 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -2174,6 +2174,7 @@ vect_finish_stmt_generation (gimple stmt, gimple vec_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, gimple vec_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);
}