Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/vect/slp-pr56812.cc @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line diff
--- a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc Thu Oct 25 07:37:49 2018 +0900 @@ -1,22 +1,19 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target vect_float } */ -/* { dg-require-effective-target vect_hw_misalign } */ -/* { dg-additional-options "-O3 -funroll-loops -fvect-cost-model=dynamic" } */ - -class mydata { -public: - mydata() {Set(-1.0);} - void Set (float); - static int upper() {return 8;} - float data[8]; -}; - -void mydata::Set (float x) -{ - for (int i=0; i<upper(); i++) - data[i] = x; -} - -/* For targets without vector loop peeling the loop becomes cheap - enough to be vectorized. */ -/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { xfail { ! vect_peeling_profitable } } } } */ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_float } */ +/* { dg-require-effective-target vect_hw_misalign } */ +/* { dg-additional-options "-O3 -funroll-loops -fvect-cost-model=dynamic -fopt-info-vec" } */ + +class mydata { +public: + mydata() {Set(-1.0);} + void Set (float); + static int upper() {return 8;} + float data[8]; +}; + +void mydata::Set (float x) +{ + /* We want to vectorize this either as loop or basic-block. */ + for (int i=0; i<upper(); i++) /* { dg-optimized "\[^\n\]* vectorized" } */ + data[i] = x; +}