https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108520
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Macleod <amacl...@gcc.gnu.org>: https://gcc.gnu.org/g:99f3ad2e5b117ee79a6dcf97288261e2fa32ab4c commit r13-5806-g99f3ad2e5b117ee79a6dcf97288261e2fa32ab4c Author: Andrew MacLeod <amacl...@redhat.com> Date: Mon Feb 6 13:07:01 2023 -0500 Add function context for querying global ranges. When processing arguments for assume functions, call get_global_range directly and utilize a function context pointer to avoid any assumptions about using cfun. PR tree-optimization/108520 gcc/ * gimple-range-infer.cc (check_assume_func): Invoke gimple_range_global directly instead using global_range_query. * value-query.cc (get_range_global): Add function context and avoid calling nonnull_arg_p if not cfun. (gimple_range_global): Add function context pointer. * value-query.h (imple_range_global): Add function context. gcc/testsuite/ * g++.dg/pr108520.C: New.