summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr42952.c
blob: db8782af3b9eb3d5f1a4d4a5a156b90ebfb1d01e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do run } */
/* { dg-options "-fno-tree-ccp -fno-tree-fre" } */

extern void abort (void);

static int g[1];

static int * const p = &g[0];
static int * const q = &g[0];

int main(void)
{
  g[0] = 1;
  *p = 0;
  *p = *q;
  if (g[0] != 0)
    abort ();
  return 0;
}