Debian Codegraph @

gcc/testsuite/gcc.dg/tree-prof/peel-2.c

raw
1 /* { dg-options "-O3 -fdump-tree-cunroll-details -fno-unroll-loops -fpeel-loops -fdump-tree-ch2-details-blocks -fno-tree-loop-distribute-patterns" } */
2 int a[100];
3 int n = 1000000;
4 int zeroc;
5 int
6 main()
7 {
8 a[0]=1;
9 for (int i = 0; i < n; i++)
10 {
11 int j;
12 for (j = 0; a[j]; j++);
13 zeroc+=j;
14 asm __volatile__ ("":::"memory");
15 }
16 return 0;
17 }
18 /* { dg-final-use { scan-tree-dump "Peeled loop 2, 1 times" "cunroll" } } */
19 /* { dg-final-use { scan-tree-dump "Peeled likely exits: likely decreased number of iterations of loop 1" "ch2" } } */
20 /* { dg-final-use { scan-tree-dump "Peeled all exits: decreased number of iterations of loop 2" "ch2" } } */
21 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "ch2" } } */