diff options
author | Richard Guenther <rguenther@suse.de> | 2006-04-24 07:58:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-04-24 07:58:53 +0000 |
commit | 7e1584f82dcb1d1a2953381a16542772ab4f5adf (patch) | |
tree | 047d09366bf5c0f83cb9a0899199c15b84de22de /gcc/value-prof.c | |
parent | e2537f2c039f645cff41975b5a6ddcf26b7c4c79 (diff) | |
download | gcc-7e1584f82dcb1d1a2953381a16542772ab4f5adf.zip gcc-7e1584f82dcb1d1a2953381a16542772ab4f5adf.tar.gz gcc-7e1584f82dcb1d1a2953381a16542772ab4f5adf.tar.bz2 |
re PR tree-optimization/22525 (tree based value profiling (-fprofile-use) produces mismatch types in conditional)
2006-04-24 Richard Guenther <rguenther@suse.de>
PR tree-optimization/22525
* value-prof.c (tree_mod_pow2): Remove unnecessary temporary
variable, adjust types of generated expressions.
From-SVN: r113216
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r-- | gcc/value-prof.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c index f089790..59b0f35 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -342,7 +342,7 @@ tree_mod_pow2 (tree stmt, tree operation, tree op1, tree op2, int prob, gcov_type count, gcov_type all) { tree stmt1, stmt2, stmt3, stmt4; - tree tmp1, tmp2, tmp3; + tree tmp2, tmp3; tree label_decl1 = create_artificial_label (); tree label_decl2 = create_artificial_label (); tree label_decl3 = create_artificial_label (); @@ -357,19 +357,17 @@ tree_mod_pow2 (tree stmt, tree operation, tree op1, tree op2, int prob, bb = bb_for_stmt (stmt); bsi = bsi_for_stmt (stmt); - tmp1 = create_tmp_var (optype, "PROF"); tmp2 = create_tmp_var (optype, "PROF"); tmp3 = create_tmp_var (optype, "PROF"); - stmt1 = build2 (MODIFY_EXPR, optype, tmp1, fold_convert (optype, op2)); stmt2 = build2 (MODIFY_EXPR, optype, tmp2, - build2 (PLUS_EXPR, optype, op2, integer_minus_one_node)); + build2 (PLUS_EXPR, optype, op2, build_int_cst (optype, -1))); stmt3 = build2 (MODIFY_EXPR, optype, tmp3, - build2 (BIT_AND_EXPR, optype, tmp2, tmp1)); + build2 (BIT_AND_EXPR, optype, tmp2, op2)); stmt4 = build3 (COND_EXPR, void_type_node, - build2 (NE_EXPR, boolean_type_node, tmp3, integer_zero_node), - build1 (GOTO_EXPR, void_type_node, label_decl2), - build1 (GOTO_EXPR, void_type_node, label_decl1)); - bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT); + build2 (NE_EXPR, boolean_type_node, + tmp3, build_int_cst (optype, 0)), + build1 (GOTO_EXPR, void_type_node, label_decl2), + build1 (GOTO_EXPR, void_type_node, label_decl1)); bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT); bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT); bsi_insert_before (&bsi, stmt4, BSI_SAME_STMT); |