https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122200
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Macleod <[email protected]>: https://gcc.gnu.org/g:9e04a43012be504b75217704124987d0510f7fdc commit r16-4452-g9e04a43012be504b75217704124987d0510f7fdc Author: Andrew MacLeod <[email protected]> Date: Tue Oct 7 11:56:08 2025 -0400 Range snap bitmasks as they are set. Range bounds adjustments based on a bitmask were lazily set. This lead to some inconsitencies which were causing problems. Improve the bounds, and do it every time the bitmask is adjusted. PR tree-optimization/121468 PR tree-optimization/121206 PR tree-optimization/122200 gcc/ * value-range.cc (irange_bitmask::range_from_mask): New. (irange::snap): Add explicit overflow flag. (irange::snap_subranges): Use overflow flag. (irange::set_range_from_bitmask): Use range_from_mask. (test_irange_snap_bounds): Adjust for improved ranges. * value-range.h (irange::range_from_mask): Add prototype. (irange::snap): Adjust prototype. gcc/testsuite/ * gcc.dg/pr121468.c: New. * gcc.dg/pr122200.c: New.
