1 /* { dg-require-effective-target vect_int } */ 2 /* PR tree-optimization/67682. */ 3 4 #include "tree-vect.h" 5 6 int __attribute__((__aligned__(8))) a[8]; 7 int __attribute__((__aligned__(8))) b[4]; 8 9 __attribute__ ((noinline)) void test()10test () 11 { 12 a[0] = b[0]; 13 a[1] = b[1]; 14 a[2] = b[2]; 15 a[3] = b[3]; 16 a[4] = 0; 17 a[5] = 0; 18 a[6] = 0; 19 a[7] = 0; 20 } 21 22 int main(int argc,char ** argv)23main (int argc, char **argv) 24 { 25 check_vect (); 26 27 for (int i = 0; i < 8; i++) 28 a[i] = 1; 29 for (int i = 0; i < 4; i++) 30 b[i] = i + 4; 31 __asm__ volatile ("" : : : "memory"); 32 test (a, b); 33 __asm__ volatile ("" : : : "memory"); 34 for (int i = 0; i < 4; i++) 35 if (a[i] != i+4) 36 abort (); 37 for (int i = 4; i < 8; i++) 38 if (a[i] != 0) 39 abort (); 40 return 0; 41 } 42 43 /* { dg-final { scan-tree-dump-times "Basic block will be vectorized using SLP" 1 "slp2" } } */ 44 /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */ 45