[Bug tree-optimization/96075] [8/9/10/11 Regression] bogus alignment for negative step grouped access

rsandifo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 6 13:52:15 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96075

--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> So we end up calling get_negative_load_store_type for this group which seems
> to only handle contiguous accesses but this one is single element
> interleaving
> aka contiguous with gap.
> 
> vect_supportable_dr_alignment returns dr_aligned which is seemingly OK for
> 
> #(Data Ref: 
> #  bb: 3 
> #  stmt: _4 = y[_2];
> #  ref: y[_2];
> #  base_object: y;
> #  Access function 0: {1022, +, -2}_1
Are you sure we support this?  I think…

>   /* If this is a backward running DR then first access in the larger
>      vectype actually is N-1 elements before the address in the DR.
>      Adjust misalign accordingly.  */
>   if (tree_int_cst_sgn (step) < 0)
>     { 
>       tree offset = ssize_int (TYPE_VECTOR_SUBPARTS (vectype) - 1);
>       /* DR_STEP(dr) is the same as -TYPE_SIZE of the scalar type,
>          otherwise we wouldn't be here.  */
…really was the assumption for negative steps at one time,
and I'm not sure off-hand when/if that changed.

(Of course, it might be that one of my patches changed it.)


More information about the Gcc-bugs mailing list