aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-12-19 09:58:03 +0100
committerRichard Biener <rguenther@suse.de>2023-12-19 13:31:30 +0100
commitaa2a48984c3d8c7a6a6da10d924e030b141b44cd (patch)
tree30a3f68084bc53d86ace049a2b0d414d56d2bf21 /gcc
parent7e1c440bc84c02e67b1cf338579a3274cdc337e0 (diff)
downloadgcc-aa2a48984c3d8c7a6a6da10d924e030b141b44cd.zip
gcc-aa2a48984c3d8c7a6a6da10d924e030b141b44cd.tar.gz
gcc-aa2a48984c3d8c7a6a6da10d924e030b141b44cd.tar.bz2
tree-optimization/113073 - amend PR112736 fix
The PR112736 testcase fails on RISC-V because the aligned exception uses the wrong check. The alignment support scheme can be dr_aligned even when the access isn't aligned to the vector size but some targets are happy with element alignment. The following fixes that. PR tree-optimization/113073 * tree-vect-stmts.cc (vectorizable_load): Properly ensure to exempt only vector-size aligned overreads.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-stmts.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index fc6923c..e9ff728 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -11476,7 +11476,9 @@ vectorizable_load (vec_info *vinfo,
- (group_size * vf - gap), nunits))
/* DR will be unused. */
ltype = NULL_TREE;
- else if (alignment_support_scheme == dr_aligned)
+ else if (known_ge (vect_align,
+ tree_to_poly_uint64
+ (TYPE_SIZE_UNIT (vectype))))
/* Aligned access to excess elements is OK if
at least one element is accessed in the
scalar loop. */