From 3ffa78014eb78d71951cddbd1ec1b8930011f2be Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Fri, 6 Mar 2015 18:43:24 +0000 Subject: [PATCH] re PR testsuite/63175 (FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c scan-tree-dump-times slp2" basic block vectorized using SLP" 1) 2015-03-05 Martin Sebor * 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. From-SVN: r221248 --- gcc/testsuite/ChangeLog | 8 +++++ .../ppc/costmodel-bb-slp-9a-pr63175.c | 30 +++++++++++++++++++ .../vect/costmodel/ppc/costmodel-bb-slp-9a.c | 24 +++++++-------- 3 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ede3d743336..702e06bad09 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-03-05 Martin Sebor + + * 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-06 Wilco Dijkstra * gcc.dg/tree-ssa/pr45685.c: Move to gcc.target/i386. 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 00000000000..73c0afa02dc --- /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 e1bc1a8e339..45046f4a09b 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 #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" } } */ - -- 2.30.2