[gcc r17-3525] middle-end: Add bitmask to default POLY_INT_CST ranges.

Tamar Christina via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:d9171eae3d69fe2a63ef8f03a5792c04e9d14271

commit r17-3525-gd9171eae3d69fe2a63ef8f03a5792c04e9d14271
Author: Tamar Christina <[email protected]>
Date:   Fri Aug 21 20:51:25 2026 +0100

    middle-end: Add bitmask to default POLY_INT_CST ranges.
    
    When splitting the AArch64 part off from the middle-end patch I got notified of
    a CI failure.
    
    It looks like the fallback/saturating early out doesn't set the bitmask on the
    range when returning VARYING like it did before.
    
    This causes some tests to fail due to the range losing the mask for valid values
    because even when VARYING this doesn't mean that every value is possible.
    
    This adds it back.
    
    gcc/ChangeLog:
    
            * value-query.cc (range_query::get_tree_range): Add bitmask back to
            VARYING case.

Diff:
---
 gcc/value-query.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/value-query.cc b/gcc/value-query.cc
index 8457ae705fe2..831dba9a39ab 100644
--- a/gcc/value-query.cc
+++ b/gcc/value-query.cc
@@ -479,6 +479,8 @@ range_query::get_tree_range (vrange &r, tree expr, gimple *stmt,
 	      if (TYPE_OVERFLOW_WRAPS (type) && bound_ovf)
 		{
 		  r.set_varying (type);
+		  r.update_bitmask (irange_bitmask (wi::zero (precision),
+						    get_nonzero_bits (expr)));
 		  return true;
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.