https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103464
--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Andrew Macleod <amacl...@gcc.gnu.org>: https://gcc.gnu.org/g:3760d9d7b5410f16236ed15d02ec1d8a7d16fddb commit r11-9452-g3760d9d7b5410f16236ed15d02ec1d8a7d16fddb Author: Andrew MacLeod <amacl...@redhat.com> Date: Tue Dec 7 12:09:33 2021 -0500 Directly resolve range_of_stmt dependencies. (Port of PR 103231/103464) All ranger API entries eventually call range_of_stmt to ensure there is an initial global value to work with. This can cause very deep call chains when satisfied via the normal API. Instead, push any dependencies onto a stack and evaluate them in a depth first manner, mirroring what would have happened via the normal API calls. PR tree-optimization/103603 gcc/ * gimple-range.cc (gimple_ranger::gimple_ranger): Create stmt stack. (gimple_ranger::~gimple_ranger): New. (gimple_ranger::range_of_stmt): Process dependencies if they have no global cache entry. (gimple_ranger::prefill_name): New. (gimple_ranger::prefill_stmt_dependencies): New. * gimple-range.h (class gimple_ranger): Add prototypes.