https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100253
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue is we're getting a dataref pointer like
&MEM <__int128 unsigned> [(char * {ref-all})&s + 25B]
and the first access has DR_MISALIGNMENT of 9 and the target alignment is 16.
So we have
align == 16
misalign == 9
then we do
data_ref = fold_build2 (MEM_REF, vectype,
dataref_ptr,
dataref_offset
? dataref_offset
: build_int_cst (ref_type, 0));
if (aligned_access_p (first_dr_info))
;
else if (DR_MISALIGNMENT (first_dr_info) == -1)
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
align * BITS_PER_UNIT);
else
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
TYPE_ALIGN (elem_type));
but since DR_MISALIGNMENT is not -1 we assume element alignment
(since DR_MISALIGNMENT is the misalign in elements and at least at
some point wasn't arbitrary ... unless I misremember). Since
the vector type is vector(1) __int128 unsigned we get an aligned
access. Note how we're using 'align' in the == -1 case but that's
the target alignment ...
The load code has the same issue. I'm testing a simplification.