summaryrefslogtreecommitdiff
path: root/gcc/tree-profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-profile.c')
-rw-r--r--gcc/tree-profile.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 127082e1530..a854c50f77e 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -340,7 +340,7 @@ tree_gen_ic_func_profiler (void)
basic_block bb;
edge_iterator ei;
gimple stmt1, stmt2;
- tree tree_uid, cur_func;
+ tree tree_uid, cur_func, counter_ptr, ptr_var;
if (cgraph_only_called_directly_p (c_node))
return;
@@ -358,13 +358,16 @@ tree_gen_ic_func_profiler (void)
build_addr (current_function_decl,
current_function_decl),
true, NULL_TREE,
- true, GSI_SAME_STMT);
+ true, GSI_NEW_STMT);
+ counter_ptr = force_gimple_operand_gsi (&gsi, ic_gcov_type_ptr_var,
+ true, NULL_TREE, false,
+ GSI_NEW_STMT);
+ ptr_var = force_gimple_operand_gsi (&gsi, ic_void_ptr_var,
+ true, NULL_TREE, false,
+ GSI_NEW_STMT);
tree_uid = build_int_cst (gcov_type_node, c_node->pid);
stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 4,
- ic_gcov_type_ptr_var,
- tree_uid,
- cur_func,
- ic_void_ptr_var);
+ counter_ptr, tree_uid, cur_func, ptr_var);
gsi_insert_after (&gsi, stmt1, GSI_NEW_STMT);
gcc_assert (EDGE_COUNT (bb->succs) == 1);
bb = split_edge (EDGE_I (bb->succs, 0));