https://gcc.gnu.org/g:b37738ed3b6dc731fea7ac7882a903dc47af457f
commit r16-246-gb37738ed3b6dc731fea7ac7882a903dc47af457f Author: Andrew MacLeod <amacl...@redhat.com> Date: Mon Mar 31 11:18:22 2025 -0400 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. Diff: --- 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;