From 84e39114ef36f4f202028695936e3725b9a08474 Mon Sep 17 00:00:00 2001 From: bstarynk Date: Tue, 11 Mar 2008 15:19:27 +0000 Subject: 2008-03-11 Basile Starynkevitch merged with trunk r133107 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@133113 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-profile.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'gcc/tree-profile.c') diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index 00fbd862ad9..57c9f5c0c5a 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -181,7 +181,7 @@ tree_gen_edge_profiler (int edgeno, edge e) stmt2 = build_gimple_modify_stmt (gcov_type_tmp_var, build2 (PLUS_EXPR, gcov_type_node, gcov_type_tmp_var, one)); - stmt3 = build_gimple_modify_stmt (ref, gcov_type_tmp_var); + stmt3 = build_gimple_modify_stmt (unshare_expr (ref), gcov_type_tmp_var); bsi_insert_on_edge (e, stmt1); bsi_insert_on_edge (e, stmt2); bsi_insert_on_edge (e, stmt3); @@ -231,11 +231,10 @@ tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base) { tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); - tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; + tree ref_ptr = tree_coverage_counter_addr (tag, base); tree call, val; - ref_ptr = force_gimple_operand_bsi (&bsi, - build_addr (ref, current_function_decl), + ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr, true, NULL_TREE, true, BSI_SAME_STMT); val = prepare_instrumented_value (&bsi, value); call = build_call_expr (tree_pow2_profiler_fn, 2, ref_ptr, val); @@ -251,11 +250,10 @@ tree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base) { tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); - tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; + tree ref_ptr = tree_coverage_counter_addr (tag, base); tree call, val; - ref_ptr = force_gimple_operand_bsi (&bsi, - build_addr (ref, current_function_decl), + ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr, true, NULL_TREE, true, BSI_SAME_STMT); val = prepare_instrumented_value (&bsi, value); call = build_call_expr (tree_one_value_profiler_fn, 2, ref_ptr, val); @@ -275,10 +273,9 @@ tree_gen_ic_profiler (histogram_value value, unsigned tag, unsigned base) tree tmp1, stmt1, stmt2, stmt3; tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); - tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; + tree ref_ptr = tree_coverage_counter_addr (tag, base); - ref_ptr = force_gimple_operand_bsi (&bsi, - build_addr (ref, current_function_decl), + ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr, true, NULL_TREE, true, BSI_SAME_STMT); /* Insert code: @@ -367,11 +364,10 @@ tree_gen_average_profiler (histogram_value value, unsigned tag, unsigned base) { tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); - tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; + tree ref_ptr = tree_coverage_counter_addr (tag, base); tree call, val; - ref_ptr = force_gimple_operand_bsi (&bsi, - build_addr (ref, current_function_decl), + ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr, true, NULL_TREE, true, BSI_SAME_STMT); val = prepare_instrumented_value (&bsi, value); @@ -388,11 +384,10 @@ tree_gen_ior_profiler (histogram_value value, unsigned tag, unsigned base) { tree stmt = value->hvalue.stmt; block_stmt_iterator bsi = bsi_for_stmt (stmt); - tree ref = tree_coverage_counter_ref (tag, base), ref_ptr; + tree ref_ptr = tree_coverage_counter_addr (tag, base); tree call, val; - ref_ptr = force_gimple_operand_bsi (&bsi, - build_addr (ref, current_function_decl), + ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr, true, NULL_TREE, true, BSI_SAME_STMT); val = prepare_instrumented_value (&bsi, value); call = build_call_expr (tree_ior_profiler_fn, 2, ref_ptr, val); -- cgit v1.2.1