aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c
blob: 811988f43711e60b6d568a3331951fb462420d1c (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* PR tree-optimization/58277 */

extern void abort (void);
static int a[2];
int b, c, d, *e, f, g, h, **i = &e, k, l = 1, n, o, p;
static int **volatile j = &e;
const int m;
char u;

int
bar ()
{
  u = 0;
  return m;
}

__attribute__((noinline, noclone)) void
baz ()
{
  asm ("");
}

static int
foo ()
{
  int t1;
  g = bar ();
  if (l)
    ;
  else
    for (;; h++)
      {
	*i = 0;
	o = *e = 0;
	if (p)
	  {
	    f = 0;
	    return 0;
	  }
	for (;; k++)
	  {
	    int *t2 = 0;
	    int *const *t3[] = {
	      0, 0, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, &t2, &t2, &t2,
	      &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0,
	      0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, &t2,
	      &t2, &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0,
	      &t2, 0, 0, 0, &t2, 0, &t2, 0, 0, &t2, 0, 0, 0, 0,
	      0, &t2, 0, 0, 0, 0, &t2, &t2, 0, 0, 0, 0, &t2, 0,
	      0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, &t2, 0, 0, 0,
	      &t2, &t2
	    };
	    int *const **t4[] = {&t3[0]};
	    **i = 0;
	    if (**j)
	      break;
	    u = 0;
	  }
	*i = *j;
	t1 = 0;
	for (; t1 < 5; t1++)
	  *i = *j;
      }
  *j = 0;
  return 1;
}

int
main ()
{
  int t5;
  a[0] = 1;
  {
    int *t6[6] = {&d, &d};
    for (n = 1; n; n--)
      if (foo())
	{
	  int *t7[] = {0};
	  d = 0;
	  for (; u < 1; u++)
	    *i = *j;
	  *i = 0;
	  *i = 0;
	  int t8[5] = {0};
	  *i = &t8[0];
	  int *const *t9 = &t6[0];
	  int *const **t10 = &t9;
	  *t10 = &t7[0];
	}
  }
  u = 0;
  for (; b; b++)
    for (t5 = 0; t5 < 10; t5++)
      c = a[a[a[a[a[a[a[a[c]]]]]]]];

  baz ();

  if (!a[a[a[a[a[a[a[a[a[a[a[a[a[a[a[u]]]]]]]]]]]]]]])
    abort ();

  return 0;
}