https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125953
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:79496eefdaa77840d59571cd03bccf82d2704046 commit r17-1830-g79496eefdaa77840d59571cd03bccf82d2704046 Author: Richard Biener <[email protected]> Date: Wed Jun 24 08:45:37 2026 +0200 tree-optimization/125953 - ICE with vector pattern stmts range query Vectorizer pattern recog eventually feeds range_of_expr with both pattern def expressions and pattern context stmts. While that's IMO not OK the ranger code has some existing defenses against defs that do not reside in the IL. Just those are incomplete. The following makes them more robust. I will cleanup the vectorizer side of things on trunk. I have documented gimple_ranger::range_of_expr as to how I understand it works (the different range_of_* APIs seem to behave slightly different - I find this confusing). Esp. range_of_expr requires a valid 'r' input range and the return value isn't always reflecting that something was done. PR tree-optimization/125953 * gimple-range.cc (gimple_ranger::range_of_expr): Document. Fall back to global ranges if 'stmt' is not in the IL. * gcc.dg/torture/pr125953.c: New testcase.
