2015-05-04 Sandra Loosemore <sandra@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr60485-2.c
blob767e61d1c1431a88465d7a92200c2bb92bd5485f
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 extern void abort (void);
5 struct S {
6 int *i[4];
7 int *p1;
8 int *p2;
9 int *p3;
10 int *p4;
11 int **x;
13 int **b;
14 int main()
16 int i = 1;
17 struct S s;
18 s.p3 = &i;
19 int **p;
20 if (b)
21 p = b;
22 else
23 p = &s.i[2];
24 p += 4;
25 /* prevert fowrprop from creating an offsetted sd constraint and
26 preserve the pointer offsetting constraint. */
27 s.x = p;
28 p = s.x;
29 if (!b)
31 int *z = *p;
32 /* z should point to i (and non-local/escaped). */
33 *z = 0;
35 if (i != 0)
36 abort ();
37 return i;