On Mon, 27 Jul 2026, H.J. Lu wrote:
> On Mon, Jul 27, 2026 at 6:15 PM Tamar Christina <[email protected]>
> wrote:
> >
> > The 07/27/2026 08:21, H.J. Lu wrote:
> > > When the size of record or array is smaller than the target alignment,
> > > don't over align them and set DR_TARGET_ALIGNMENT to the reduced target
> > > alignment. If the natural alignment isn't lower than the reduced target
> > > alignment, set base_misaligned to false.
> > >
> >
> > Definitely need Richi's input here, but I think changing DR_TARGET_ALIGNMENT
> > overloads this value which is used for more than the alignment of the object
> > but also used for this like peeling and versioning and runtime checks, so
> > changing it to something that's less than
> > targetm.vectorize.preferred_vector_alignment
>
> We ask the backend for preferred vector parameters without
> checking the data size. We shouldn't even try 32-byte vector
> on a 20-byte data. Can we pass the data size to the backend
> when asking for preferred vector parameters?
The issue is we are calling ensure_base_align when only costing.
I'm testing a patch and will take your set of testcases.
Richard.
> > could cause problems.
> >
> > I think your original patch was more correct, i.e. just refuse to change the
> > alignment in vect_compute_data_ref_alignment and so leave it unaligned.
> >
> > Was there a specific reason you went with this approach instead?
> >
>
> I got GCC testsuite regressions with the other approach using
>
> make check RUNTESTFLAGS="--target_board='unix{-m32\
> -march=x86-64-v4,-march=x86-64-v4}'"
>
>
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Jochen Jaser, Andrew McDonald, Abhinav Puri; (HRB 36809, AG Nuernberg)