Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-nb-iter-ub-1.c

raw
1 /* { dg-additional-options "-fdump-tree-cunroll-details" } */
2
3 #include "tree-vect.h"
4
5 int ii[31];
6 char cc[31] =
7 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
8 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 };
9
10 void __attribute__((noinline,noclone))
11 foo (int s)
12 {
13 int i;
14 for (i = 0; i < s; i++)
15 ii[i] = (int) cc[i];
16 }
17
18 int main (int argc, const char **argv)
19 {
20 int i;
21 check_vect ();
22 foo (31);
23 #pragma GCC novector
24 for (i = 0; i < 31; i++)
25 if (ii[i] != i)
26 __builtin_abort ();
27 }
28
29 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { i?86-*-* x86_64-*-* } } } } */
30 /* { dg-final { scan-tree-dump "loop turned into non-loop; it never loops" "cunroll" { target { i?86-*-* x86_64-*-* } } } } */
31 /* { dg-final { scan-tree-dump-not "loop with 2 iterations completely unrolled" "cunroll" { target { i?86-*-* x86_64-*-* } } } } */