aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-10-04 14:41:14 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-10-04 12:41:14 +0000
commit3edbcdbead288664d874dd3a2e0d8ada4c565af0 (patch)
treee312a412289bc88a481440b075cfa23d7989e321 /gcc/value-prof.c
parent668f8d452697359a150bd651149c75109f66eb06 (diff)
downloadgcc-3edbcdbead288664d874dd3a2e0d8ada4c565af0.zip
gcc-3edbcdbead288664d874dd3a2e0d8ada4c565af0.tar.gz
gcc-3edbcdbead288664d874dd3a2e0d8ada4c565af0.tar.bz2
Fix divergence in indirect profiling (PR gcov-profile/84107).
2018-10-04 Martin Liska <mliska@suse.cz> PR gcov-profile/84107 * tree-profile.c (init_ic_make_global_vars): Remove ic_void_ptr_var and ic_gcov_type_ptr_var. Come up with new ic_tuple* variables. Emit __gcov_indirect_call{,_topn} variables. (gimple_gen_ic_profiler): Access the variable and emit gimple. (gimple_gen_ic_func_profiler): Access __gcov_indirect_call.callee field. (gimple_init_gcov_profiler): Use ptr_type_node. * value-prof.c (gimple_ic): Use ptr_type_node. 2018-10-04 Martin Liska <mliska@suse.cz> PR gcov-profile/84107 * libgcov-profiler.c (__gcov_indirect_call): Change type to indirect_call_tuple. (struct indirect_call_tuple): New struct. (__gcov_indirect_call_topn_profiler): Change type. (__gcov_indirect_call_profiler_v2): Use the new variables. * libgcov.h (struct indirect_call_tuple): New struct definition. From-SVN: r264840
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 29489e0..60b9827 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1290,7 +1290,6 @@ gimple_ic (gcall *icall_stmt, struct cgraph_node *direct_call,
gcond *cond_stmt;
tree tmp0, tmp1, tmp;
basic_block cond_bb, dcall_bb, icall_bb, join_bb = NULL;
- tree optype = build_pointer_type (void_type_node);
edge e_cd, e_ci, e_di, e_dj = NULL, e_ij;
gimple_stmt_iterator gsi;
int lp_nr, dflags;
@@ -1300,13 +1299,13 @@ gimple_ic (gcall *icall_stmt, struct cgraph_node *direct_call,
cond_bb = gimple_bb (icall_stmt);
gsi = gsi_for_stmt (icall_stmt);
- tmp0 = make_temp_ssa_name (optype, NULL, "PROF");
- tmp1 = make_temp_ssa_name (optype, NULL, "PROF");
+ tmp0 = make_temp_ssa_name (ptr_type_node, NULL, "PROF");
+ tmp1 = make_temp_ssa_name (ptr_type_node, NULL, "PROF");
tmp = unshare_expr (gimple_call_fn (icall_stmt));
load_stmt = gimple_build_assign (tmp0, tmp);
gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);
- tmp = fold_convert (optype, build_addr (direct_call->decl));
+ tmp = fold_convert (ptr_type_node, build_addr (direct_call->decl));
load_stmt = gimple_build_assign (tmp1, tmp);
gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);