diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2023-07-25 12:34:21 -0400 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2023-07-26 10:41:16 +0200 |
commit | 4a188dee6287746b58c701517cb054766565c5e1 (patch) | |
tree | 880c09024612bff8222095b7d4e086cc2b81ede4 /gcc | |
parent | 5cac2394ef958945d80112b7d18673fce0c93872 (diff) | |
download | gcc-4a188dee6287746b58c701517cb054766565c5e1.zip gcc-4a188dee6287746b58c701517cb054766565c5e1.tar.gz gcc-4a188dee6287746b58c701517cb054766565c5e1.tar.bz2 |
[range-ops] Handle bitmasks for BIT_NOT_EXPR.
gcc/ChangeLog:
* range-op-mixed.h (class operator_bitwise_not): Add update_bitmask.
* range-op.cc (operator_bitwise_not::update_bitmask): New.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/range-op-mixed.h | 2 | ||||
-rw-r--r-- | gcc/range-op.cc | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index 6944742..ead41ed 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -551,6 +551,8 @@ public: bool op1_range (irange &r, tree type, const irange &lhs, const irange &op2, relation_trio rel = TRIO_VARYING) const final override; + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override; }; class operator_bitwise_xor : public range_operator diff --git a/gcc/range-op.cc b/gcc/range-op.cc index d959a3e..13ba973 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -4027,6 +4027,13 @@ operator_bitwise_not::op1_range (irange &r, tree type, return fold_range (r, type, lhs, op2); } +void +operator_bitwise_not::update_bitmask (irange &r, const irange &lh, + const irange &rh) const +{ + update_known_bitmask (r, BIT_NOT_EXPR, lh, rh); +} + bool operator_cst::fold_range (irange &r, tree type ATTRIBUTE_UNUSED, |