PR tree-optimization/80631
* gcc.target/i386/avx2-pr80631.c: New test.
From-SVN: r255701
2017-12-15 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/80631
+ * gcc.target/i386/avx2-pr80631.c: New test.
+
* g++.dg/plugin/attribute_plugin.c (user_attr): Swap
affects_type_identity and handler fields, add NULL for exclude.
--- /dev/null
+/* 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 ();
+}