fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0 and similarly in ...
authorJosef Zlomek <zlomekj@suse.cz>
Thu, 21 Aug 2003 05:47:43 +0000 (07:47 +0200)
committerJosef Zlomek <zlomek@gcc.gnu.org>
Thu, 21 Aug 2003 05:47:43 +0000 (05:47 +0000)
* fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0
and similarly in (A | C) == D where C & ~D != 0.

From-SVN: r70637

gcc/ChangeLog
gcc/fold-const.c

index dc01407d87de5a293c5392d9e6464de391139cec..44d5e33d06348e867e2f25f7b4946847bae2a0ae 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-21  Josef Zlomek  <zlomekj@suse.cz>
+
+       * fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0
+       and similarly in (A | C) == D where C & ~D != 0.
+
 2003-08-20  Geoffrey Keating  <geoffk@apple.com>
 
        PR 8180
index bf6b1f8e9f154969f9edf3af3f39b4bca26a435e..3869c0612a374c2b00b1cee6ef455068438ee696 100644 (file)
@@ -7397,7 +7397,7 @@ fold (tree expr)
          tree dandnotc = fold (build (BIT_ANDTC_EXPR, TREE_TYPE (arg0),
                                       arg1, TREE_OPERAND (arg0, 1)));
          tree rslt = code == EQ_EXPR ? integer_zero_node : integer_one_node;
-         if (!integer_zerop (dandnotc))
+         if (integer_nonzerop (dandnotc))
            return omit_one_operand (type, rslt, arg0);
        }
 
@@ -7411,7 +7411,7 @@ fold (tree expr)
          tree candnotd = fold (build (BIT_ANDTC_EXPR, TREE_TYPE (arg0),
                                       TREE_OPERAND (arg0, 1), arg1));
          tree rslt = code == EQ_EXPR ? integer_zero_node : integer_one_node;
-         if (!integer_zerop (candnotd))
+         if (integer_nonzerop (candnotd))
            return omit_one_operand (type, rslt, arg0);
        }