]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/111715 - improve TBAA for access paths with pun
authorRichard Biener <rguenther@suse.de>
Mon, 9 Oct 2023 11:05:10 +0000 (13:05 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 9 Oct 2023 13:17:11 +0000 (15:17 +0200)
commit11b8cf1685bb40af5b86653e492e350983025957
treee36f31f6385cf45d32d0ec74a519dedc357c70b0
parent841668aa02a05deca06e68a5931408d970f5c8b2
tree-optimization/111715 - improve TBAA for access paths with pun

The following improves basic TBAA for access paths formed by
C++ abstraction where we are able to combine a path from an
address-taking operation with a path based on that access using
a pun to avoid memory access semantics on the address-taking part.

The trick is to identify the point the semantic memory access path
starts which allows us to use the alias set of the outermost access
instead of only that of the base of this path.

PR tree-optimization/111715
* alias.cc (reference_alias_ptr_type_1): When we have
a type-punning ref at the base search for the access
path part that's still semantically valid.

* gcc.dg/tree-ssa/ssa-fre-102.c: New testcase.
gcc/alias.cc
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-102.c [new file with mode: 0644]