aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr112721.c
blob: adf62613266422300c861cd2bfed26f7333b6fc7 (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
/* { dg-do run } */
/* { dg-options "-O1" } */

unsigned * volatile gv;

struct a {
  int b;
};
int c, e;
long d;
unsigned * __attribute__((noinline))
f(unsigned *g) {
  for (; c;)
    e = d;
  return gv ? gv : g;
}
int main() {
  int *h;
  struct a i = {8};
  int *j = &i.b;
  h = (unsigned *) f(j);
  *h = 0;
  if (i.b != 0)
    __builtin_abort ();
  return 0;
}