]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/tree-ssa/pr92712-2.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr92712-2.c
CommitLineData
a213ab38
JJ
1/* PR tree-optimization/92712 */
2/* { dg-do compile } */
3/* { dg-options "-O2 -fno-ipa-icf -fdump-tree-optimized" } */
4/* { dg-final { scan-tree-dump-times " = \[tv]_\[0-9]*\\\(D\\\) \\* \[tv]_\[0-9]*\\\(D\\\);" 7 "optimized" } } */
5
6int
7f1 (int t, int v)
8{
9 int a = t - 1;
10 int b = a * v;
11 return b + v;
12}
13
14int
15f2 (int t, int v)
16{
17 int a = t - 1;
18 int b = a * v;
19 return v + b;
20}
21
22int
23f3 (int t, int v)
24{
25 int a = t + 1;
26 int b = a * v;
27 return b - v;
28}
29
30int
31f4 (int t, int v)
32{
33 int a = 1 - t;
34 int b = a * v;
35 return v - b;
36}
37
38int
39f5 (int t, int v)
40{
41 if (v == 0 || v == -1)
42 __builtin_unreachable ();
43 int a = t - 1U;
44 int b = a * v;
45 return b + v;
46}
47
48int
49f6 (int t, int v)
50{
51 if (v == 0 || v == -1)
52 __builtin_unreachable ();
53 int a = t - 1U;
54 int b = a * v;
55 return v + b;
56}
57
58int
59f7 (int t, int v)
60{
61 if (v == 0)
62 __builtin_unreachable ();
63 int a = t + 1U;
64 int b = a * v;
65 return b - v;
66}