aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-10-09 21:39:12 +0000
committerEric Botcazou <ebotcazou@adacore.com>2011-10-09 21:39:12 +0000
commit5e2845789eb754192c0ad2e9ffca8abfeb9d652d (patch)
tree113c5588f603f68fb0d8f8a6cf5152e1f5b03392 /gcc/tree-ssa-forwprop.c
parentc931131da12cf352a388c2718e52f490d31c6a76 (diff)
* tree-ssa-forwprop.c (forward_propagate_into_comparison): Do not make
the replacement if the conversion to the LHS type is not useless. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@179730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index a8737dac933..de782c9be9f 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -465,16 +465,15 @@ forward_propagate_into_comparison (gimple_stmt_iterator *gsi)
gimple stmt = gsi_stmt (*gsi);
tree tmp;
bool cfg_changed = false;
+ tree type = TREE_TYPE (gimple_assign_lhs (stmt));
tree rhs1 = gimple_assign_rhs1 (stmt);
tree rhs2 = gimple_assign_rhs2 (stmt);
/* Combine the comparison with defining statements. */
tmp = forward_propagate_into_comparison_1 (stmt,
gimple_assign_rhs_code (stmt),
- TREE_TYPE
- (gimple_assign_lhs (stmt)),
- rhs1, rhs2);
- if (tmp)
+ type, rhs1, rhs2);
+ if (tmp && useless_type_conversion_p (type, TREE_TYPE (tmp)))
{
gimple_assign_set_rhs_from_tree (gsi, tmp);
fold_stmt (gsi);