aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-10-09 21:39:12 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-10-09 21:39:12 +0000
commit75e649f6f48d121f830f244827551618d903fd07 (patch)
tree113c5588f603f68fb0d8f8a6cf5152e1f5b03392 /gcc
parent7de61dc6ac5ec699bffb6af49636db501f436004 (diff)
downloadgcc-75e649f6f48d121f830f244827551618d903fd07.zip
gcc-75e649f6f48d121f830f244827551618d903fd07.tar.gz
gcc-75e649f6f48d121f830f244827551618d903fd07.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-forwprop.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 925b625..3a3c985 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
PR tree-optimization/50635
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index a8737da..de782c9 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);