diff options
author | Richard Guenther <rguenther@suse.de> | 2011-06-16 08:41:50 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-06-16 08:41:50 +0000 |
commit | 12430896397b7477294814403674d75e668f9f22 (patch) | |
tree | b02d925dc44622ca4d0a8f09518f68c6859d3dce /gcc/gimple.c | |
parent | e641e49532dd7a8ad66611de27c8f76abb17dfc3 (diff) | |
download | gcc-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.c | 10 |
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), |