https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107107
--- Comment #10 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:85333b9265720fc4e49397301cb16324d2b89aa7 commit r13-3126-g85333b9265720fc4e49397301cb16324d2b89aa7 Author: Richard Biener <rguent...@suse.de> Date: Thu Oct 6 11:20:16 2022 +0200 tree-optimization/107107 - tail-merging VN wrong-code The following fixes an unintended(?) side-effect of the special MODIFY_EXPR expression entries we add for tail-merging during VN. We shouldn't value-number the virtual operand differently here. PR tree-optimization/107107 * tree-ssa-sccvn.cc (visit_reference_op_store): Do not affect value-numbering when doing the tail merging MODIFY_EXPR lookup. * gcc.dg/pr107107.c: New testcase.