Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/pr80631-1.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* PR tree-optimization/80631 */ | |
2 | |
3 #include "tree-vect.h" | |
4 | |
5 int v[8] = { 77, 1, 79, 3, 4, 3, 6, 7 }; | |
6 | |
7 __attribute__((noipa)) void | |
8 f1 (void) | |
9 { | |
10 int k, r = -1; | |
11 for (k = 0; k < 8; k++) | |
12 if (v[k] == 77) | |
13 r = k; | |
14 if (r != 0) | |
15 abort (); | |
16 } | |
17 | |
18 __attribute__((noipa)) void | |
19 f2 (void) | |
20 { | |
21 int k, r = 4; | |
22 for (k = 0; k < 8; k++) | |
23 if (v[k] == 79) | |
24 r = k; | |
25 if (r != 2) | |
26 abort (); | |
27 } | |
28 | |
29 __attribute__((noipa)) void | |
30 f3 (void) | |
31 { | |
32 int k, r = -17; | |
33 for (k = 0; k < 8; k++) | |
34 if (v[k] == 78) | |
35 r = k; | |
36 if (r != -17) | |
37 abort (); | |
38 } | |
39 | |
40 __attribute__((noipa)) void | |
41 f4 (void) | |
42 { | |
43 int k, r = 7; | |
44 for (k = 0; k < 8; k++) | |
45 if (v[k] == 78) | |
46 r = k; | |
47 if (r != 7) | |
48 abort (); | |
49 } | |
50 | |
51 __attribute__((noipa)) void | |
52 f5 (void) | |
53 { | |
54 int k, r = -1; | |
55 for (k = 0; k < 8; k++) | |
56 if (v[k] == 3) | |
57 r = k; | |
58 if (r != 5) | |
59 abort (); | |
60 } | |
61 | |
62 int | |
63 main () | |
64 { | |
65 check_vect (); | |
66 f1 (); | |
67 f2 (); | |
68 f3 (); | |
69 f4 (); | |
70 f5 (); | |
71 return 0; | |
72 } | |
73 | |
74 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 5 "vect" { target vect_condition } } } */ | |
75 /* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 10 "vect" { target vect_fold_extract_last } } } */ | |
76 /* { dg-final { scan-tree-dump-times "condition expression based on integer induction." 10 "vect" { target { { ! vect_fold_extract_last } && vect_condition } } } } */ |