aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr64853.c
blob: 620f99d2bf958779152af7ab98d3e7faf3242fea (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
/* { dg-do run } */

struct S
{
  int f1;
};

static struct S a = { 1 };
char b;
static unsigned char *c = &b;
int d, e, f;

int
fn1 (int p)
{
  return 0 ? 0 : p - 1;
}

static int
fn2 (struct S p)
{
  int g = 200;
  for (e = 4; e; e = fn1 (e))
    {
      for (; d; d++)
	;
      *c &= p.f1 & g;
      g = --*c;
      if (f)
	return 0;
    }
  return 0;
}

int
main ()
{
  fn2 (a);

  if (b != 0) 
    __builtin_abort (); 

  return 0;
}