https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99117
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jsm28 at gcc dot gnu.org
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #13)
> So the valarray behavior boils down to
>
> struct _Array { int * __restrict m_data; };
>
> void foo (struct _Array dest, int *src, int n)
> {
> for (int i = 0; i < n; ++i)
> dest.m_data[i] = src[i];
> }
>
> which we treat similarly:
>
> _8 = MEM[(int *)_3 clique 1 base 0];
> MEM[(int *)_7 clique 1 base 1] = _8;
>
> and thus we'd vectorize "bogously" for example if src == dest.m_data + 1
I'd argue that passing such src to the function is invalid (for C, sure, C++
doesn't have restrict).
Because src is not based on dest.m_data in that case.
So, the big question is what passes that pointer that aliases it.