Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-require-effective-target vect_condition } */ | |
2 /* { dg-additional-options "-fdump-tree-vect-details" } */ | |
3 | |
4 #include "tree-vect.h" | |
5 | |
6 #define N 128 | |
7 | |
8 __attribute__((noinline, noclone)) void | |
9 foo (int *a, int stride) | |
10 { | |
11 int i; | |
12 | |
13 for (i = 0; i < N/stride; i++, a += stride) | |
14 { | |
15 a[0] = a[0] ? 1 : 5; | |
16 a[1] = a[1] ? 2 : 6; | |
17 a[2] = a[2] ? 3 : 7; | |
18 a[3] = a[3] ? 4 : 8; | |
19 } | |
20 } | |
21 | |
22 | |
23 int a[N]; | |
24 int main () | |
25 { | |
26 int i; | |
27 | |
28 check_vect (); | |
29 | |
30 for (i = 0; i < N; i++) | |
31 a[i] = i; | |
32 | |
33 foo (a, 4); | |
34 | |
35 for (i = 1; i < N; i++) | |
36 if (a[i] != i%4 + 1) | |
37 abort (); | |
38 | |
39 if (a[0] != 5) | |
40 abort (); | |
41 | |
42 return 0; | |
43 } | |
44 | |
45 /* Basic blocks of if-converted loops are vectorized from within the loop | |
46 vectorizer pass. In this case it is really a deficiency in loop | |
47 vectorization data dependence analysis that causes us to require | |
48 basic block vectorization in the first place. */ | |
49 | |
50 /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "vect" { target vect_element_align } } } */ | |
51 |