https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107709
--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> --- we might be able to provide a lightweight ranger based query to determine if an ssa_name is non-null in a block.. in fact.. we may not need anything special. /* Create a new ranger instance and associate it with a function. Each call must be paired with a call to disable_ranger to release resources. If USE_IMM_USES is true, pre-calculate sideffects like non-null uses as required using the immediate use chains. */ extern gimple_ranger *enable_ranger (struct function *m, bool use_imm_uses = true); simply using the on-demand default which sets use_imm_uses to true is probably enough, When a pointer is queried, if it hasn't been done yet, all immediate uses are scanned and if there is an inferred range, those blocks are tagged with an on-exit range on non-zero. simply querying get_range_query->range_of_expr (r, name, stmt) will then walk the dom tree and tell you through r if name is non-zero or not. If we end up needing something more efficient for this purpose, we could harvest that code and produce a module which much more efficiently processes inferred ranges simply looking for whether a specific property is true or not