aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr79386.c
blob: 21b77597247abb21055cd1757cfd82edb4b53ab8 (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
/* PR rtl-optimization/79386 */

int a, b;

int
foo (int x)
{
  int c;
  int *d, *e;

  if (b == 0)
    {
      c = 0;
      e = &b;
      d = &b;
    }
  else
    {
      int f;

      c = 1;
      for (f = 0; f < 9; ++f)
	c *= 3;
      e = (int *) (__UINTPTR_TYPE__) c;
      d = &x;
    }
  *e = c < 3;
  if (*e != 0)
    {
      int g;

      b += (a != 0) ? a : 1;
      if (g != 0 || x != 0)
	*d = 0;
      if (b >= 0)
	{
	  if (g != 0)
	    g = x;
	  if (*d / g != 0)
	    for (;;)
	      ;
	}
    }

  return b * (a != 0 && *d != 0);
}