1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-phiopt1" } */
3
f0(int i)4 int f0(int i)
5 {
6 if (i == 0) return 0;
7 return i/10;
8 }
f1(int i)9 int f1(int i)
10 {
11 return i?i/10:0;
12 }
13
f2(int i)14 int f2(int i)
15 {
16 if (i == 0) return 0;
17 return i%10;
18 }
f3(int i)19 int f3(int i)
20 {
21 return i?i%10:0;
22 }
23
f4(int i)24 int f4(int i)
25 {
26 if (i == 0) return 0;
27 return i<<10;
28 }
f5(int i)29 int f5(int i)
30 {
31 return i?i<<10:0;
32 }
33
34 /* We should if-convert all functions to carry out the operation
35 unconditionally. */
36 /* { dg-final { scan-tree-dump-not "= PHI" "phiopt1" } } */
37