https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84646
--- Comment #8 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:203b127fccc9abe5373c9e3cc03a476c35b1f594 commit r13-3877-g203b127fccc9abe5373c9e3cc03a476c35b1f594 Author: Richard Biener <rguent...@suse.de> Date: Thu Nov 10 14:08:35 2022 +0100 Restore CCP copy propagation The following restores copy propagation in CCP for the case the lattice was constant before trying to transition to a copy. At some point we changed to use the meet operator to handle integer constant -> integer constant transitions but that screws up the const -> copy lattice transition. PR tree-optimization/84646 * tree-ssa-ccp.cc (set_lattice_value): Make sure we allow a const -> copy transition and avoid using meet in that case. * gcc.dg/tree-ssa/ssa-ccp-42.c: New testcase.