]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/120358 - bogus PTA with structure access
authorRichard Biener <rguenther@suse.de>
Mon, 7 Jul 2025 13:13:38 +0000 (15:13 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 8 Jul 2025 07:42:40 +0000 (09:42 +0200)
commitaa5ae523e84a97bf3a582ea0fa73d959afa9b9c7
tree597aad3fcc3295e10852867413d300b2507b8a6e
parent2fd6f42c17a8040dbd3460ca34d93695dacf8575
tree-optimization/120358 - bogus PTA with structure access

When we compute the constraint for something like
MEM[(const struct QStringView &)&tok2 + 32] we go and compute
what (const struct QStringView &)&tok2 + 32 points to and then
add subvariables to its dereference that possibly fall in the
range of the access according to the original refs size.  In
doing that we disregarded that the subvariable the starting
address points to might not be aligned to it and thus the
access might start at any point within that variable.  The following
conservatively adjusts the pruning of adjacent sub-variables to
honor this.

PR tree-optimization/120358
* tree-ssa-structalias.cc (get_constraint_for_1): Adjust
pruning of sub-variables according to the imprecise
known start offset.
gcc/tree-ssa-structalias.cc