]>
Commit | Line | Data |
---|---|---|
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 | ||
6 | int | |
7 | f1 (int t, int v) | |
8 | { | |
9 | int a = t - 1; | |
10 | int b = a * v; | |
11 | return b + v; | |
12 | } | |
13 | ||
14 | int | |
15 | f2 (int t, int v) | |
16 | { | |
17 | int a = t - 1; | |
18 | int b = a * v; | |
19 | return v + b; | |
20 | } | |
21 | ||
22 | int | |
23 | f3 (int t, int v) | |
24 | { | |
25 | int a = t + 1; | |
26 | int b = a * v; | |
27 | return b - v; | |
28 | } | |
29 | ||
30 | int | |
31 | f4 (int t, int v) | |
32 | { | |
33 | int a = 1 - t; | |
34 | int b = a * v; | |
35 | return v - b; | |
36 | } | |
37 | ||
38 | int | |
39 | f5 (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 | ||
48 | int | |
49 | f6 (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 | ||
58 | int | |
59 | f7 (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 | } |