aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-06-12 14:09:45 +0200
committerRichard Biener <rguenther@suse.de>2023-06-12 15:19:24 +0200
commit8d3eb3ad5388d2f523e4a6f886c4b3364f77f51f (patch)
tree4a79fbae04bb4bc71d829ee557e7f9ac5a2be4b9 /gcc
parentbc45e18d433f879a02e369d027829f90f9e85724 (diff)
downloadgcc-8d3eb3ad5388d2f523e4a6f886c4b3364f77f51f.zip
gcc-8d3eb3ad5388d2f523e4a6f886c4b3364f77f51f.tar.gz
gcc-8d3eb3ad5388d2f523e4a6f886c4b3364f77f51f.tar.bz2
Fix disambiguation against .MASK_STORE
Alias analysis was treating .MASK_STORE as storing a full vector which means we disambiguate against decls of smaller than vector size. That's of course wrong and a similar issue was fixed for DSE already. The following makes sure we set the size of the access to unknown and only constrain max_size. This fixes runtime execution FAILs of gfortran.dg/matmul_2.f90, gfortran.dg/matmul_6.f90 and gfortran.dg/pr91577.f90 when using AVX512 with full masked loop vectorization on Zen4. * tree-ssa-alias.cc (call_may_clobber_ref_p_1): For .MASK_STORE and friend set the size of the access to unknown.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-ssa-alias.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc
index 79ed956..b5476e8 100644
--- a/gcc/tree-ssa-alias.cc
+++ b/gcc/tree-ssa-alias.cc
@@ -3072,6 +3072,9 @@ call_may_clobber_ref_p_1 (gcall *call, ao_ref *ref, bool tbaa_p)
ao_ref lhs_ref;
ao_ref_init_from_ptr_and_size (&lhs_ref, gimple_call_arg (call, 0),
TYPE_SIZE_UNIT (TREE_TYPE (rhs)));
+ /* We cannot make this a known-size access since otherwise
+ we disambiguate against stores to decls that are smaller. */
+ lhs_ref.size = -1;
lhs_ref.ref_alias_set = lhs_ref.base_alias_set
= tbaa_p ? get_deref_alias_set
(TREE_TYPE (gimple_call_arg (call, 1))) : 0;