diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-28 10:07:40 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-28 11:02:38 +0200 |
commit | eed248bb8cc3091e8a9b2f73138c691396752438 (patch) | |
tree | 5f98d9cff23f39e231b98f51dbf2add85341f44f /gcc | |
parent | b343a29dbcbfc5eaca11243ac603a1e5b48630f3 (diff) | |
download | gcc-eed248bb8cc3091e8a9b2f73138c691396752438.zip gcc-eed248bb8cc3091e8a9b2f73138c691396752438.tar.gz gcc-eed248bb8cc3091e8a9b2f73138c691396752438.tar.bz2 |
tree-optimization/102949 - fix base object alignment
This fixes fallout of g:4703182a06b831a9 where we now silently fail
to force alignment of a base object. The fix is to look at the
dr_info of the group leader to be consistent with alignment analysis.
2021-10-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/102949
* tree-vect-stmts.c (ensure_base_align): Look at the
dr_info of a group leader and assert we are looking at
one with analyzed alignment.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vect-stmts.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index bf07e7a..03cc726 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6338,8 +6338,12 @@ vectorizable_operation (vec_info *vinfo, static void ensure_base_align (dr_vec_info *dr_info) { - if (dr_info->misalignment == DR_MISALIGNMENT_UNINITIALIZED) - return; + /* Alignment is only analyzed for the first element of a DR group, + use that to look at base alignment we need to enforce. */ + if (STMT_VINFO_GROUPED_ACCESS (dr_info->stmt)) + dr_info = STMT_VINFO_DR_INFO (DR_GROUP_FIRST_ELEMENT (dr_info->stmt)); + + gcc_assert (dr_info->misalignment != DR_MISALIGNMENT_UNINITIALIZED); if (dr_info->base_misaligned) { |