I was about to ping on this, and then found it in my drafts.. Doh! get_range_global() can invoke tree.cc::nonnull_arg_p() if the item being queried is a pointer and a parameter.  This routine assumes the context is CFUN, and this is not always true. This patch simply adds a function context to the get_range_global query, and defaults it to cfun. If the context passed in is anything different than cfun, then it simply chooses not to invoke nonnull_arg_p(). The check_assume function now directly calls gimple_range_global with the correct function context instead of indirectly calling it through the global_range_query->range_of_expr () method. Thats all it should have been doing in the first place really since its always an ssa name. Bootstraps on x86_64-pc-linux-gnu with no regressions.  OK for trunk? Andrew