From b37738ed3b6dc731fea7ac7882a903dc47af457f Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 31 Mar 2025 11:18:22 -0400 Subject: [PATCH] Use the current cache when creating inferred ranges. Infer range processing was adjusted to allow a query to be specified, but during VRP folding, ranger was not providing a query. This results in contextual ranges being missed. Pass the cache in as the query which provide a read-only query of the current state. * gimple-range-cache.cc (ranger_cache::apply_inferred_ranges): Pass 'this' as the range-query to the inferred range constructor. --- gcc/gimple-range-cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index 818b801468a0..ecf03319cd4e 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -1861,7 +1861,7 @@ ranger_cache::apply_inferred_ranges (gimple *s) bool update = true; basic_block bb = gimple_bb (s); - gimple_infer_range infer(s); + gimple_infer_range infer(s, this); if (infer.num () == 0) return; -- 2.47.3