diff options
author | Richard Biener <rguenther@suse.de> | 2021-09-23 10:27:01 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-09-23 11:17:33 +0200 |
commit | c0cc62b32d95caca25a8854e0d2b6f11f5674d30 (patch) | |
tree | 884f5649c42528dcdab58f422f075d5d5c4983b6 /gcc/tree-vect-data-refs.c | |
parent | 9ce500289a69d48cf7b2ea633e4d99565fed5a64 (diff) | |
download | gcc-c0cc62b32d95caca25a8854e0d2b6f11f5674d30.zip gcc-c0cc62b32d95caca25a8854e0d2b6f11f5674d30.tar.gz gcc-c0cc62b32d95caca25a8854e0d2b6f11f5674d30.tar.bz2 |
tree-optimization/102448 - clear copied alignment info from vect
This fixes the previous change which removed setting alignment info
from the vectorizers idea of how a pointer is being used but left
in place the copied info from DR_PTR_INFO without realizing that this
is in fact _not_ the alignment of the access but the alignment of
a base pointer contained in it.
The following makes sure to not use that info.
2021-09-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/102448
* tree-vect-data-refs.c (vect_duplicate_ssa_name_ptr_info):
Clear alignment info copied from DR_PTR_INFO.
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index a57700f..bdff6ea 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -4629,12 +4629,15 @@ vect_get_new_ssa_name (tree type, enum vect_var_kind var_kind, const char *name) return new_vect_var; } -/* Duplicate ptr info and set alignment/misaligment on NAME from DR_INFO. */ +/* Duplicate points-to info on NAME from DR_INFO. */ static void vect_duplicate_ssa_name_ptr_info (tree name, dr_vec_info *dr_info) { duplicate_ssa_name_ptr_info (name, DR_PTR_INFO (dr_info->dr)); + /* DR_PTR_INFO is for a base SSA name, not including constant or + variable offsets in the ref so its alignment info does not apply. */ + mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name)); } /* Function vect_create_addr_base_for_vector_ref. @@ -4738,11 +4741,7 @@ vect_create_addr_base_for_vector_ref (vec_info *vinfo, stmt_vec_info stmt_info, if (DR_PTR_INFO (dr) && TREE_CODE (addr_base) == SSA_NAME && !SSA_NAME_PTR_INFO (addr_base)) - { - vect_duplicate_ssa_name_ptr_info (addr_base, dr_info); - if (offset || byte_offset) - mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (addr_base)); - } + vect_duplicate_ssa_name_ptr_info (addr_base, dr_info); if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "created %T\n", addr_base); |