]> git.ipfire.org Git - thirdparty/gcc.git/commit
Restore CCP copy propagation
authorRichard Biener <rguenther@suse.de>
Thu, 10 Nov 2022 13:08:35 +0000 (14:08 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 10 Nov 2022 13:11:11 +0000 (14:11 +0100)
commit203b127fccc9abe5373c9e3cc03a476c35b1f594
tree111ef9a845428138f442f827bd7653ef033ae2a0
parentbd044dae51caea3c641f86ec5cb0ebccf7e06de7
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.
gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-42.c [new file with mode: 0644]
gcc/tree-ssa-ccp.cc