Commit 7e1584f8 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/22525 (tree based value profiling (-fprofile-use)…

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
parent e2537f2c
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.
2006-04-23 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in (c-convert.o): Add dependency on $(TARGET_H)
......
......@@ -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),
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, stmt1, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt4, BSI_SAME_STMT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment