From: Richard Biener Date: Thu, 23 Sep 2021 08:27:01 +0000 (+0200) Subject: tree-optimization/102448 - clear copied alignment info from vect X-Git-Tag: basepoints/gcc-13~4474 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0cc62b32d95caca25a8854e0d2b6f11f5674d30;p=thirdparty%2Fgcc.git 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 PR tree-optimization/102448 * tree-vect-data-refs.c (vect_duplicate_ssa_name_ptr_info): Clear alignment info copied from DR_PTR_INFO. --- diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index a57700f2c1b4..bdff6ea54ac0 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);