Debian Codegraph @

gcc/testsuite/gcc.dg/torture/pr118922-1.c

raw
1 /* { dg-do run } */
2 /* PR tree-optimization/118922 */
3
4 /* Phi-opt would convert:
5 <bb 5> [local count: 1014686024]:
6 if (h_6 != 0)
7 goto <bb 7>; [94.50%]
8 else
9 goto <bb 6>; [5.50%]
10
11 <bb 6> [local count: 114863530]:
12 # h_6 = PHI <0(4), 1(5)>
13
14 <bb 7> [local count: 1073741824]:
15 # f_8 = PHI <0(5), h_6(6)>
16 _9 = f_8 ^ 1;
17 a.0_10 = a;
18 _11 = _9 + a.0_10;
19 if (_11 != -117)
20 goto <bb 5>; [94.50%]
21 else
22 goto <bb 8>; [5.50%]
23
24 into:
25
26 <bb 4> [local count: 59055799]:
27 c = d_3;
28
29 <bb 5> [local count: 1073741824]:
30 # f_8 = PHI <0(5), 0(4)>
31 _9 = f_8 ^ 1;
32 a.0_10 = a;
33 _11 = _9 + a.0_10;
34 if (_11 != -117)
35 goto <bb 5>; [94.50%]
36 else
37 goto <bb 6>; [5.50%]
38
39 as it thought the middle bb was empty as there was only a phi node there. */
40
41
42 int a = -117, b, c, e;
43 void g(int h) {
44 int f = 0;
45 while (!f + a - -117) {
46 f = h == 0;
47 if (h == 0)
48 h = 1;
49 }
50 }
51 int main() {
52 int d = 8;
53 for (; e;)
54 d = 0;
55 c = d;
56 g(0);
57 }