tree-optimization/106131 - wrong code with FRE rewriting
authorRichard Biener <rguenther@suse.de>
Thu, 30 Jun 2022 08:33:40 +0000 (10:33 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 19 Jul 2022 09:27:08 +0000 (11:27 +0200)
commitec9287ba9718871aa64900d6168105802e1ca941
tree82858d5e03351b84cf0a7d3062156681af01c978
parent854ab8be5d9ddfc5b4d57a5c040d1811a89fbe4f
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  <rguenther@suse.de>

PR tree-optimization/106131
* tree-ssa-sccvn.cc (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)
gcc/testsuite/g++.dg/torture/pr106131.C [new file with mode: 0644]
gcc/tree-ssa-sccvn.cc