annotate gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
kono
parents:
diff changeset
2 unsigned int a[1000];
kono
parents:
diff changeset
3 unsigned int b = 257;
kono
parents:
diff changeset
4 unsigned int c = 1023;
kono
parents:
diff changeset
5 unsigned int d = 19;
kono
parents:
diff changeset
6 int
kono
parents:
diff changeset
7 main ()
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 int i;
kono
parents:
diff changeset
10 unsigned int n;
kono
parents:
diff changeset
11 for (i = 0; i < 1000; i++)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 a[i]=18;
kono
parents:
diff changeset
14 }
kono
parents:
diff changeset
15 for (i = 0; i < 1000; i++)
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 if (i % 2)
kono
parents:
diff changeset
18 n = b;
kono
parents:
diff changeset
19 else if (i % 3)
kono
parents:
diff changeset
20 n = c;
kono
parents:
diff changeset
21 else
kono
parents:
diff changeset
22 n = d;
kono
parents:
diff changeset
23 a[i] %= n;
kono
parents:
diff changeset
24 }
kono
parents:
diff changeset
25 return 0;
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27 /* autofdo does not do value profiling so far */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 /* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: mod subtract" "profile" } } */
111
kono
parents:
diff changeset
29 /* This is part of code checking that n is greater than the divisor so we are sure that it
kono
parents:
diff changeset
30 didn't get optimized out. */
kono
parents:
diff changeset
31 /* { dg-final-use-not-autofdo { scan-tree-dump "if \\(_\[0-9\]* \\< n_\[0-9\]*" "optimized"} } */
kono
parents:
diff changeset
32 /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */