https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125854
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Macleod <[email protected]>: https://gcc.gnu.org/g:6df88a49e162a971f324247b184ddeb76b115ecc commit r17-1662-g6df88a49e162a971f324247b184ddeb76b115ecc Author: Andrew MacLeod <[email protected]> Date: Wed Jun 17 16:51:15 2026 -0400 Do not invoke a different range query from within fold_stmt. fold_using_range works on a specified range_query object. IF this object is not the current_range_query (cfun) object, do not invoke the general gimple fold routines as they may call into the current query. PR tree-optimization/125854 gcc/ * gimple-range-fold.cc (fold_using_range::fold_stmt): Check if the range_query matches the current one before invoking fold. gcc/testsuite/ * g++.dg/pr125854.C: New.
