aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr118922-1.c
blob: 27e8c78c0e4e1c679c82144ca5e596c3e54750d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* { dg-do run } */
/* PR tree-optimization/118922 */

/* Phi-opt would convert:
  <bb 5> [local count: 1014686024]:
  if (h_6 != 0)
    goto <bb 7>; [94.50%]
  else
    goto <bb 6>; [5.50%]

  <bb 6> [local count: 114863530]:
  # h_6 = PHI <0(4), 1(5)>

  <bb 7> [local count: 1073741824]:
  # f_8 = PHI <0(5), h_6(6)>
  _9 = f_8 ^ 1;
  a.0_10 = a;
  _11 = _9 + a.0_10;
  if (_11 != -117)
    goto <bb 5>; [94.50%]
  else
    goto <bb 8>; [5.50%]

into:

  <bb 4> [local count: 59055799]:
  c = d_3;

  <bb 5> [local count: 1073741824]:
  # f_8 = PHI <0(5), 0(4)>
  _9 = f_8 ^ 1;
  a.0_10 = a;
  _11 = _9 + a.0_10;
  if (_11 != -117)
    goto <bb 5>; [94.50%]
  else
    goto <bb 6>; [5.50%]

as it thought the middle bb was empty as there was only a phi node there. */


int a = -117, b, c, e;
void g(int h) {
  int f = 0;
  while (!f + a - -117) {
    f = h == 0;
    if (h == 0)
      h = 1;
  }
}
int main() {
  int d = 8;
  for (; e;)
    d = 0;
  c = d;
  g(0);
}