diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-16 08:41:50 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-16 08:41:50 +0000 |
commit | 71b5c25e1115138075e8fa8f4be22a31bbfdc21a (patch) | |
tree | b02d925dc44622ca4d0a8f09518f68c6859d3dce /gcc/gimple.c | |
parent | 2d7063ae919014ba7c1182821b7b1aa4a9e250d9 (diff) | |
download | gcc-71b5c25e1115138075e8fa8f4be22a31bbfdc21a.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175096 138bc75d-0d04-0410-961f-82ee72b054a4
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 6a9b58d6023..fd9757908f0 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), |