}
}
unsigned align;
- if (alignment_support_scheme == dr_aligned)
- align = known_alignment (DR_TARGET_ALIGNMENT (first_dr_info));
- else
- align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info));
+ /* ??? We'd want to use
+ if (alignment_support_scheme == dr_aligned)
+ align = known_alignment (DR_TARGET_ALIGNMENT (first_dr_info));
+ since doing that is what we assume we can in the above checks.
+ But this interferes with groups with gaps where for example
+ VF == 2 makes the group in the unrolled loop aligned but the
+ fact that we advance with step between the two subgroups
+ makes the access to the second unaligned. See PR119586.
+ We have to anticipate that here or adjust code generation to
+ avoid the misaligned loads by means of permutations. */
+ align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info));
/* Alignment is at most the access size if we do multiple stores. */
if (nstores > 1)
align = MIN (tree_to_uhwi (TYPE_SIZE_UNIT (ltype)), align);
}
}
unsigned align;
- if (alignment_support_scheme == dr_aligned)
- align = known_alignment (DR_TARGET_ALIGNMENT (first_dr_info));
- else
- align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info));
+ /* ??? The above is still wrong, see vectorizable_store. */
+ align = dr_alignment (vect_dr_behavior (vinfo, first_dr_info));
/* Alignment is at most the access size if we do multiple loads. */
if (nloads > 1)
align = MIN (tree_to_uhwi (TYPE_SIZE_UNIT (ltype)), align);