summaryrefslogtreecommitdiff
path: root/gcc/tree-profile.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 12:06:57 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 12:06:57 +0000
commit251e7603b8f0016178515eb5f041f6f1e29ec588 (patch)
treec58a9f0704189719510e62faa499e804da793b0b /gcc/tree-profile.c
parent2b7c48a1cd57b926109f7d954695df901427bab7 (diff)
downloadgcc-251e7603b8f0016178515eb5f041f6f1e29ec588.tar.gz
2010-07-07 Richard Guenther <rguenther@suse.de>
* tree-ssa-propagate.h (valid_gimple_call_p): Remove. * tree-ssa-propagate.c (valid_gimple_call_p): Make static. Fix. * gimple.h (is_gimple_operand): Remove. * gimple.c (is_gimple_operand): Likewise. (walk_gimple_op): Fix wi->val_only setting for calls. * tree-cfg.c (verify_gimple_call): Fix argument validation. * tree-profile.c (tree_gen_ic_func_profiler): Do not create invalid gimple calls. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161905 138bc75d-0d04-0410-961f-82ee72b054a4
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));