Hi! When backporting the PR80631 fix to 7.x, I've noticed there is no runtime FAIL in any of the tests, only the scan-tree-dump test failures.
So, I've committed following test that FAILs on x86_64-linux without the patch and succeeds with it. 2017-12-15 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/80631 * gcc.target/i386/avx2-pr80631.c: New test. --- gcc/testsuite/gcc.target/i386/avx2-pr80631.c.jj 2017-12-15 18:29:56.714301404 +0100 +++ gcc/testsuite/gcc.target/i386/avx2-pr80631.c 2017-12-15 18:29:37.000000000 +0100 @@ -0,0 +1,23 @@ +/* PR tree-optimization/80631 */ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -mavx2 -fno-vect-cost-model" } */ +/* { dg-require-effective-target avx2 } */ + +#include "avx2-check.h" + +#define N 8 + +static void +avx2_test (void) +{ + int v[N], k; + for(k = 0; k < N; k++) + v[k] = k; + v[0] = 77; + int found_index = -1; + for (k = 0; k < N; k++) + if (v[k] == 77) + found_index = k; + if (found_index != 0) + abort (); +} Jakub