https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124692
--- 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:b82bc657de7aecf0eefff1a2aa90798cf7fcc7a1 commit r16-8333-gb82bc657de7aecf0eefff1a2aa90798cf7fcc7a1 Author: Richard Biener <[email protected]> Date: Mon Mar 30 14:30:45 2026 +0200 tree-optimization/124692 - update stmt before folding The following makes sure SSA operands are up-to-date before folding. Esp. when replace_uses_by is invoked from SCEV cprop which now has ranger enabled we can otherwise end up ICEing where purpoted SSA names now are constants. This follows what forwprop does. PR tree-optimization/124692 * tree-cfg.cc (replace_uses_by): Call update_stmt after substitution and before folding. * gcc.dg/torture/pr124692.c: New testcase.
