tree-optimization/100051 - disambiguate access size vs decl
authorRichard Biener <rguenther@suse.de>
Tue, 13 Apr 2021 08:12:03 +0000 (10:12 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 27 Apr 2021 09:06:33 +0000 (11:06 +0200)
commitd1d01a66012a93cc8cb7dafbe1b5ec453ec96b59
tree4439a797fdaa7981d36b092f7383c582267d4b90
parentdfdc02bf29670c1c7f5f2820b6db11c66c258716
tree-optimization/100051 - disambiguate access size vs decl

This adds disambiguation of the access size vs. the decl size
in the pointer based vs. decl based disambiguator.  We have
a TBAA based check like this already but that's fend off when
seeing alias-sets of zero or when -fno-strict-aliasing is in
effect.  Also the perceived dynamic type could be smaller than
the actual access.

2021-04-13  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100051
* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Add
disambiguator based on access size vs. decl size.

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