This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Add one further testcase for PR80631
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Dec 2017 18:52:51 +0100
- Subject: [committed] Add one further testcase for PR80631
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 <jakub@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