From: Andrew MacLeod Date: Mon, 31 Mar 2025 15:18:22 +0000 (-0400) Subject: Use the current cache when creating inferred ranges. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b37738ed3b6dc731fea7ac7882a903dc47af457f;p=thirdparty%2Fgcc.git 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 --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index 818b801468a..ecf03319cd4 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;