aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-06-16 08:41:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-06-16 08:41:50 +0000
commit12430896397b7477294814403674d75e668f9f22 (patch)
treeb02d925dc44622ca4d0a8f09518f68c6859d3dce /gcc/gimple.c
parente641e49532dd7a8ad66611de27c8f76abb17dfc3 (diff)
downloadgcc-12430896397b7477294814403674d75e668f9f22.zip
gcc-12430896397b7477294814403674d75e668f9f22.tar.gz
gcc-12430896397b7477294814403674d75e668f9f22.tar.bz2
gimple.c (canonicalize_cond_expr_cond): (bool)x is not the same as x != 0.
2011-06-16 Richard Guenther <rguenther@suse.de> * gimple.c (canonicalize_cond_expr_cond): (bool)x is not the same as x != 0. * fold-const.c (fold_binary_loc): Do not fold X & 1 != 0 to (bool) X & 1. * ipa-prop.c (ipa_analyze_indirect_call_uses): Also allow equality compares against zero for the lower bit. From-SVN: r175096
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 6a9b58d6..fd97579 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3139,16 +3139,8 @@ canonicalize_cond_expr_cond (tree t)
&& truth_value_p (TREE_CODE (TREE_OPERAND (t, 0))))
t = TREE_OPERAND (t, 0);
- /* For (bool)x use x != 0. */
- if (CONVERT_EXPR_P (t)
- && TREE_CODE (TREE_TYPE (t)) == BOOLEAN_TYPE)
- {
- tree top0 = TREE_OPERAND (t, 0);
- t = build2 (NE_EXPR, TREE_TYPE (t),
- top0, build_int_cst (TREE_TYPE (top0), 0));
- }
/* For !x use x == 0. */
- else if (TREE_CODE (t) == TRUTH_NOT_EXPR)
+ if (TREE_CODE (t) == TRUTH_NOT_EXPR)
{
tree top0 = TREE_OPERAND (t, 0);
t = build2 (EQ_EXPR, TREE_TYPE (t),