From: Andrew MacLeod Date: Thu, 12 Jun 2025 18:48:50 +0000 (-0400) Subject: intersect_bitmask - Always update bitmask. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99c2075f76480a18e29ff5f0feb7f994087254d5;p=thirdparty%2Fgcc.git intersect_bitmask - Always update bitmask. The bitmask wasn't always being updated, resulting in some less than perfect masks being stored.:x * value-range.cc (irange::intersect_bitmask): Always update the stored mask to reflect the current calculated mask. --- diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 348c68ec902..0f0770ad705 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -2548,15 +2548,14 @@ irange::intersect_bitmask (const irange &r) irange_bitmask bm = get_bitmask (); irange_bitmask save = bm; bm.intersect (r.get_bitmask ()); - if (save == bm) - return false; - + // Use ths opportunity to make sure mask reflects always reflects the + // best mask we have. m_bitmask = bm; // Updating m_bitmask may still yield a semantic bitmask (as // returned by get_bitmask) which is functionally equivalent to what // we originally had. In which case, there's still no change. - if (save == get_bitmask ()) + if (save == bm || save == get_bitmask ()) return false; if (!set_range_from_bitmask ())