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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So with the const, GCC 8 started to accept the code at -O1+.
If we remove the const, at -O3 fails, BUT with -O3 -flto it works since
r16-4468-g7cd91c7c42eec8.


Here is a testcase to show that:
```

#include "emmintrin.h"
#include "immintrin.h"

double in[1024], out[1024];

void copy_vgatherdpd128(size_t n, const double * restrict a, double * restrict
b)
{
    __m128i vindex = _mm_set_epi32(-1,-1,8,0);
    int scale = 1;
#ifdef _OPENMP
#pragma omp parallel for
#endif
    for (size_t i=0; i<n; i+=2) {
        __m128d t = _mm_i32gather_pd( &(a[i]), vindex, scale );
        _mm_storel_pd( &(b[i  ]), t);
        _mm_storeh_pd( &(b[i+1]), t);
    }
}

int main()
{
  copy_vgatherdpd128(1024, in, out);
}
```

Reply via email to