diff options
author | Martin Liska <mliska@suse.cz> | 2018-02-19 19:29:20 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-02-19 18:29:20 +0000 |
commit | a197d3406c4c2c472b8f38fb5de2bdc4e3db9476 (patch) | |
tree | 8716daad238c58550f1b704d0ac990ed1afcd3f7 /libdecnumber | |
parent | d48fc34a45248f83f3d00b1ba7d8ec46854702c8 (diff) | |
download | gcc-a197d3406c4c2c472b8f38fb5de2bdc4e3db9476.tar.gz |
Do not use bit and for conjunction of predicates (PR c/81272).
2018-02-19 Martin Liska <mliska@suse.cz>
PR c/81272
* decNumber.c (decCompareOp): Do not use bit and
for conjunction of predicates.
From-SVN: r257815
Diffstat (limited to 'libdecnumber')
-rw-r--r-- | libdecnumber/ChangeLog | 6 | ||||
-rw-r--r-- | libdecnumber/decNumber.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libdecnumber/ChangeLog b/libdecnumber/ChangeLog index bc86f268a26..ab463f57eba 100644 --- a/libdecnumber/ChangeLog +++ b/libdecnumber/ChangeLog @@ -1,3 +1,9 @@ +2018-02-19 Martin Liska <mliska@suse.cz> + + PR c/81272 + * decNumber.c (decCompareOp): Do not use bit and + for conjunction of predicates. + 2018-01-03 Jakub Jelinek <jakub@redhat.com> Update copyright years. diff --git a/libdecnumber/decNumber.c b/libdecnumber/decNumber.c index ebfb6c5dd96..e4194211fdc 100644 --- a/libdecnumber/decNumber.c +++ b/libdecnumber/decNumber.c @@ -6029,11 +6029,11 @@ decNumber * decCompareOp(decNumber *res, const decNumber *lhs, /* If total ordering then handle differing signs 'up front' */ if (op==COMPTOTAL) { /* total ordering */ - if (decNumberIsNegative(lhs) & !decNumberIsNegative(rhs)) { + if (decNumberIsNegative(lhs) && !decNumberIsNegative(rhs)) { result=-1; break; } - if (!decNumberIsNegative(lhs) & decNumberIsNegative(rhs)) { + if (!decNumberIsNegative(lhs) && decNumberIsNegative(rhs)) { result=+1; break; } |