diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-10-31 11:51:34 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-11-03 12:54:50 -0400 |
commit | a291237b628f419d7f7ac264dd7b42947b565222 (patch) | |
tree | aa34be42614ff3921c052cbaf49045653e6ea82f /gcc/value-range.h | |
parent | 751fc7bcdcdf25e7cc0d9821f69313b6571a62e3 (diff) | |
download | gcc-a291237b628f419d7f7ac264dd7b42947b565222.zip gcc-a291237b628f419d7f7ac264dd7b42947b565222.tar.gz gcc-a291237b628f419d7f7ac264dd7b42947b565222.tar.bz2 |
Remove simple ranges from trailing zero bitmasks.
During the intersection operation, it can be helpful to remove any
low-end ranges when the bitmask has trailing zeros. This prevents
obviously incorrect ranges from appearing without requiring a bitmask
check.
* value-range.cc (irange_bitmask::adjust_range): New.
(irange::intersect_bitmask): Call adjust_range.
* value-range.h (irange_bitmask::adjust_range): New prototype.
Diffstat (limited to 'gcc/value-range.h')
-rw-r--r-- | gcc/value-range.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/value-range.h b/gcc/value-range.h index e9d81d2..84f65ff 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -139,6 +139,8 @@ public: void verify_mask () const; void dump (FILE *) const; + void adjust_range (irange &r) const; + // Convenience functions for nonzero bitmask compatibility. wide_int get_nonzero_bits () const; void set_nonzero_bits (const wide_int &bits); |