https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106131
--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:a8abbf6d15fefe5ac27aa7c21201883b66cc9b01 commit r10-11036-ga8abbf6d15fefe5ac27aa7c21201883b66cc9b01 Author: Richard Biener <rguent...@suse.de> Date: Thu Jun 30 10:33:40 2022 +0200 tree-optimization/106131 - wrong code with FRE rewriting The following makes sure to not use the original TBAA type for looking up a value across an aggregate copy when we had to offset the read. 2022-06-30 Richard Biener <rguent...@suse.de> PR tree-optimization/106131 * tree-ssa-sccvn.c (vn_reference_lookup_3): Force alias-set zero when offsetting the read looking through an aggregate copy. * g++.dg/torture/pr106131.C: New testcase. (cherry picked from commit 9701432ff79926a5dd3303be3417e0bd0c24140b)