Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/vect/pr65518.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/vect/pr65518.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,43 @@ +#include "tree-vect.h" + +extern void abort (void); + +typedef struct giga +{ + unsigned int g[16]; +} giga; + +unsigned long __attribute__((noinline,noclone)) +addfst(giga const *gptr, int num) +{ + unsigned int retval = 0; + int i; + for (i = 0; i < num; i++) + retval += gptr[i].g[0]; + return retval; +} + +int main () +{ + struct giga g[8]; + unsigned int n = 1; + int i, j; + check_vect (); + for (i = 0; i < 8; ++i) + for (j = 0; j < 16; ++j) + { + g[i].g[j] = n++; + __asm__ volatile (""); + } + if (addfst (g, 8) != 456) + abort (); + return 0; +} + +/* We don't want to vectorize the single-element interleaving in the way + we currently do that (without ignoring not needed vectors in the + gap between gptr[0].g[0] and gptr[1].g[0]), because that's very + sub-optimal and causes memory explosion (even though the cost model + should reject that in the end). */ + +/* { dg-final { scan-tree-dump-times "vectorized 0 loops in function" 2 "vect" } } */