aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJosef Zlomek <zlomekj@suse.cz>2003-08-21 07:47:43 +0200
committerJosef Zlomek <zlomek@gcc.gnu.org>2003-08-21 05:47:43 +0000
commited6f90f7ffbe1ac86034e376962a575c02becade (patch)
tree052163f6ff9f03792feac0f725a159dd8b0df6ac /gcc
parent01bf0f3e3ac0c920504c26a5c3ad325fea567716 (diff)
downloadgcc-ed6f90f7ffbe1ac86034e376962a575c02becade.zip
gcc-ed6f90f7ffbe1ac86034e376962a575c02becade.tar.gz
gcc-ed6f90f7ffbe1ac86034e376962a575c02becade.tar.bz2
fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0 and similarly in (A | C) == D where C...
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dc01407..44d5e33 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index bf6b1f8..3869c06 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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);
}