https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108353
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:445a48a226ffd530b37bcdc13b6bdca94ba2e122 commit r13-5102-g445a48a226ffd530b37bcdc13b6bdca94ba2e122 Author: Richard Biener <rguent...@suse.de> Date: Wed Jan 11 09:32:36 2023 +0100 tree-optimization/108353 - copyprop iteration order After recent improvements to copyprop to catch more constants it shows that the current iteration order prefering forward progress over iterating doesn't make much sense for an SSA propagator. The following instead first iterates cycles which makes sure to not start with optimistically constant PHIs out of cycles that optimistically do not exit. PR tree-optimization/108353 * tree-ssa-propagate.cc (cfg_blocks_back, ssa_edge_worklist_back): Remove. (add_ssa_edge): Simplify. (add_control_edge): Likewise. (ssa_prop_init): Likewise. (ssa_prop_fini): Likewise. (ssa_propagation_engine::ssa_propagate): Likewise. * gcc.dg/tree-ssa/ssa-copyprop-3.c: New testcase.