aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr67916.c
blob: 88541f9acddea6b1755dd6b4a9979e41f91c4272 (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 tree-optimization/67916 */
/* { dg-do run } */

int a[6], b = 1, d, e;
long long c;
static int f = 1;

void
fn1 (int p1)
{
  b = (b >> 1) & (1 ^ a[(1 ^ p1) & 5]);
}

void
fn2 ()
{
  b = (b >> 1) & (1 ^ a[(b ^ 1) & 1]);
  fn1 (c >> 1 & 5);
  fn1 (c >> 2 & 5);
  fn1 (c >> 4 & 5);
  fn1 (c >> 8 & 5);
}

int
main ()
{
  int i, j;
  for (; d;)
    {
      for (; e;)
	fn2 ();
      f = 0;
    }
  for (i = 0; i < 8; i++)
    {
      if (f)
	i = 9;
      for (j = 0; j < 7; j++)
	fn2 ();
    }

  if (b != 0)
    __builtin_abort ();

  return 0;
}