https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106112
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:854ab8be5d9ddfc5b4d57a5c040d1811a89fbe4f commit r12-8582-g854ab8be5d9ddfc5b4d57a5c040d1811a89fbe4f Author: Richard Biener <rguent...@suse.de> Date: Tue Jun 28 13:57:29 2022 +0200 tree-optimization/106112 - fix CSE from wider operation The following fixes a mistake in looking up an extended operand in the CSE of a truncated operation. 2022-06-28 Richard Biener <rguent...@suse.de> PR tree-optimization/106112 * tree-ssa-sccvn.cc (valueized_wider_op): Properly extend a constant operand according to its type. * gcc.dg/torture/pr106112.c: New testcase. (cherry picked from commit 2dbb45d6dc0d20dc159b3d8e27ebb6825074827a)