Commit 75e649f6 by Eric Botcazou Committed by Eric Botcazou

tree-ssa-forwprop.c (forward_propagate_into_comparison): Do not make the…

tree-ssa-forwprop.c (forward_propagate_into_comparison): Do not make the replacement if the conversion to the LHS type is not useless.

	* tree-ssa-forwprop.c (forward_propagate_into_comparison): Do not make
	the replacement if the conversion to the LHS type is not useless.

From-SVN: r179730
parent 7de61dc6
2011-10-09 Eric Botcazou <ebotcazou@adacore.com>
* tree-ssa-forwprop.c (forward_propagate_into_comparison): Do not make
the replacement if the conversion to the LHS type is not useless.
2011-10-09 Ira Rosen <ira.rosen@linaro.org> 2011-10-09 Ira Rosen <ira.rosen@linaro.org>
PR tree-optimization/50635 PR tree-optimization/50635
...@@ -465,16 +465,15 @@ forward_propagate_into_comparison (gimple_stmt_iterator *gsi) ...@@ -465,16 +465,15 @@ forward_propagate_into_comparison (gimple_stmt_iterator *gsi)
gimple stmt = gsi_stmt (*gsi); gimple stmt = gsi_stmt (*gsi);
tree tmp; tree tmp;
bool cfg_changed = false; bool cfg_changed = false;
tree type = TREE_TYPE (gimple_assign_lhs (stmt));
tree rhs1 = gimple_assign_rhs1 (stmt); tree rhs1 = gimple_assign_rhs1 (stmt);
tree rhs2 = gimple_assign_rhs2 (stmt); tree rhs2 = gimple_assign_rhs2 (stmt);
/* Combine the comparison with defining statements. */ /* Combine the comparison with defining statements. */
tmp = forward_propagate_into_comparison_1 (stmt, tmp = forward_propagate_into_comparison_1 (stmt,
gimple_assign_rhs_code (stmt), gimple_assign_rhs_code (stmt),
TREE_TYPE type, rhs1, rhs2);
(gimple_assign_lhs (stmt)), if (tmp && useless_type_conversion_p (type, TREE_TYPE (tmp)))
rhs1, rhs2);
if (tmp)
{ {
gimple_assign_set_rhs_from_tree (gsi, tmp); gimple_assign_set_rhs_from_tree (gsi, tmp);
fold_stmt (gsi); fold_stmt (gsi);
......
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