https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125599
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Richard Sandiford <[email protected]>: https://gcc.gnu.org/g:9f6e172f7402f1a020b6e3fd3f611f4dfa81af95 commit r17-1366-g9f6e172f7402f1a020b6e3fd3f611f4dfa81af95 Author: Richard Sandiford <[email protected]> Date: Fri Jun 5 09:18:34 2026 +0100 backprop: Calculate transitive closures of replacements [PR125599] This PR had the equivalent of: L1: x = PHI(1, z) y = -x ... L2: z = PHI(x, y) where z could be simplified to: z = PHI(x, x) i.e. to x. Changing z triggered a need to replace x with a new SSA name, but z was left being replaced with x, rather than x's replacement. Since the replacement values are (of course) restricted to using dominating definitions, a single RPO pass is enough to calculate the transitive closure of replacement values. gcc/ PR tree-optimization/125599 * gimple-ssa-backprop.cc (backprop::execute): Calculate the transitive closure of replacement values. gcc/testsuite/ PR tree-optimization/125599 * g++.dg/torture/pr125599.C: New test.
