]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/111019 - invariant motion and aliasing
authorRichard Biener <rguenther@suse.de>
Thu, 17 Aug 2023 13:21:33 +0000 (15:21 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 27 Nov 2023 10:27:34 +0000 (11:27 +0100)
commitb66fd93a60d429f97ca5fdfb9a88f291c605d002
treec23bf07c7b5dc7b1e8aa23535f72d9f4b5e3703b
parent56d6989705189970b842ba1bdb1759d432b0d9e7
tree-optimization/111019 - invariant motion and aliasing

The following fixes a bad choice in representing things to the alias
oracle by LIM which while correct in pieces is inconsistent with itself.
When canonicalizing a ref to a bare deref instead of leaving the base
object and the extracted offset the same and just substituting an
alternate ref the following replaces the base and the offset as well,
avoiding the confusion that otherwise will arise in
aliasing_matching_component_refs_p.

PR tree-optimization/111019
* tree-ssa-loop-im.cc (gather_mem_refs_stmt): When canonicalizing
also scrap base and offset in case the ref is indirect.

* g++.dg/torture/pr111019.C: New testcase.

(cherry picked from commit 745ec2135aabfbe2c0fb7780309837d17e8986d4)
gcc/testsuite/g++.dg/torture/pr111019.C [new file with mode: 0644]
gcc/tree-ssa-loop-im.cc