https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119712
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Andrew Macleod <amacl...@gcc.gnu.org>: https://gcc.gnu.org/g:f685d317738524dc837dee94bb762f71ff30fb23 commit r15-9607-gf685d317738524dc837dee94bb762f71ff30fb23 Author: Andrew MacLeod <amacl...@redhat.com> Date: Mon Apr 14 16:25:15 2025 -0400 Always reflect lower bits from mask in subranges. During intersection, we expand the subranges to exclude the lower values from a bitmask with trailing zeros. This leads to inconsistant evaluations and in this case of this PR, that lead to an infinite cycle. Always expand the lower subranges in set_range_from_bitmask instead. PR tree-optimization/119712 gcc/ * value-range.cc (range_bitmask::adjust_range): Delete. (irange::set_range_from_bitmask): Integrate adjust_range. (irange::update_bitmask): Do nothing if bitmask doesnt change. (irange:intersect_bitmask): Do not call adjust_range. Exit if there is no second bitmask. * value-range.h (adjust_range): Remove prototype. gcc/testsuite/ * gcc.dg/pr119712.c: New. * gcc.dg/pr83072-2.c: Adjust. * gcc.dg/tree-ssa/phi-opt-value-5.c: Adjust. * gcc.dg/tree-ssa/vrp122.c: Adjust