This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR63175 - [4.9/5 regression] FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c scan-tree-dump-times slp2" basic block vectorized using SLP" 1
- From: Martin Sebor <msebor at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: David Edelsohn <dje dot gcc at gmail dot com>, Jeff Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 05 Mar 2015 16:44:26 -0700
- Subject: Re: [PATCH] PR63175 - [4.9/5 regression] FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c scan-tree-dump-times slp2" basic block vectorized using SLP" 1
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnykb26fR_S7TK5JGPNS2ASq5q5Ji0eicX-+OPjkGDR7F-Q at mail dot gmail dot com> <54EBF248 dot 4050302 at redhat dot com> <54ECD152 dot 9060401 at redhat dot com> <CAGWvnynZWmBd5YTg3KbAAmvwBMAGfPe2gPVqeML8dxoKqJ1gwQ at mail dot gmail dot com> <54F08F7D dot 3040802 at redhat dot com> <54F111AB dot 5070202 at redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1503021457200 dot 28824 at zhemvz dot fhfr dot qr> <54F48FA2 dot 9000908 at redhat dot com>
Attached is a scaled down version of the test for the bug.
It fixes the scan-tree-dump-times string to match what GCC
5 prints and moves the result checking out of the test
function and into main to prevent it from getting optimized
away (as observed in comment #8 on the bug).
The patch also adds a regression test for the bug to scan
the assembly for the absence of ordinary loads and stores.
Tested on ppc64le-linux.
Does it look okay to everyone?
Martin
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2e77ba4..27f41fd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2015-03-05 Martin Sebor <msebor@redhat.com>
+
+ * PR testsuite/63175
+ * gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c (main1): Move
+ checking of results into main to prevent it from getting optimized
+ away.
+ * gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c: New test.
+
2015-03-04 Ian Lance Taylor <iant@google.com>
* go.test/go-test.exp (go-gc-tests): Skip nilptr test on s390*.
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c
new file mode 100644
index 0000000..73c0afa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c
@@ -0,0 +1,30 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-do compile } */
+
+#define N 16
+
+const unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+unsigned int out[N];
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ const unsigned int *pin = &in[1];
+ unsigned int *pout = &out[0];
+
+ /* Misaligned load. */
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+
+ return 0;
+}
+
+/* Verify that the assembly contains vector instructions alone
+ with no word loads (lw, lwu, lwz, lwzu, or their indexed forms)
+ or word stores (stw, stwu, stwx, stwux, or their indexed forms). */
+
+/* { dg-final { scan-assembler "\t\(lxv|lvsr|stxv\)" } } */
+/* { dg-final { scan-assembler-not "\tlwz?u?x? " } } */
+/* { dg-final { scan-assembler-not "\tstwu?x? " } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c
index e1bc1a8..45046f4 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c
@@ -1,6 +1,5 @@
/* { dg-require-effective-target vect_int } */
-#include <stdarg.h>
#include "../../tree-vect.h"
#define N 16
@@ -9,12 +8,10 @@ unsigned int out[N];
unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
__attribute__ ((noinline)) int
-main1 (unsigned int x, unsigned int y)
+main1 (void)
{
- int i;
unsigned int *pin = &in[1];
unsigned int *pout = &out[0];
- unsigned int a0, a1, a2, a3;
/* Misaligned load. */
*pout++ = *pin++;
@@ -22,13 +19,6 @@ main1 (unsigned int x, unsigned int y)
*pout++ = *pin++;
*pout++ = *pin++;
- /* Check results. */
- if (out[0] != in[1]
- || out[1] != in[2]
- || out[2] != in[3]
- || out[3] != in[4])
- abort();
-
return 0;
}
@@ -36,11 +26,17 @@ int main (void)
{
check_vect ();
- main1 (2, 3);
+ main1 ();
+
+ /* Check results. */
+ if (out[0] != in[1]
+ || out[1] != in[2]
+ || out[2] != in[3]
+ || out[3] != in[4])
+ abort();
return 0;
}
-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp2" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "slp2" } } */
-