https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61680
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- With -O3 -msse2 -fno-vect-cost-model it fails as well, so this isn't a problem in the AVX support, just that before AVX it wasn't considered profitable to vectorize it.