summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr42237.c
blob: 58db8660ca3b33cefa0cf66986eac59d7b615a0a (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
struct A
{
  int p;
};

struct B
{
  struct A n;
  struct A m;
  int x;
  int y;
  int z;
};

extern int g1, g2;

static void __attribute__((noinline)) foo (struct B *b)
{
  int t;

  t = b->n.p;
  g1 = t;
  b->n.p = t+1;
  g2 = b->m.p;

  b->m = b->n;
}

void bar (struct B *b)
{
  foo (b);
}