Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20040319-1.c
blob839cc3ab271badb46bbe177bfb186c83c27e720c
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 /* Test derived from PR 14643. When a function has no addressable
5 variables but 2 or more pointers have conflicting memory tags, they
6 were not being processed by the type based alias analyzer,
7 resulting in optimizations removing a non-redundant load. */
9 extern void abort (void);
11 struct bar { int count; int *arr;};
13 void foo (struct bar *b)
15 b->count = 0;
16 *(b->arr) = 2;
17 if (b->count == 0) /* b->count can't be assumed to be 0 here. */
18 abort ();
21 int
22 main ()
24 struct bar x;
25 x.arr = &x.count;
26 foo (&x);
27 return 0;