2014-02-12 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / alias-31.c
blob622df80a9c4520e138ed30670f80f6c36027fc5f
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-tree-sra -fdump-tree-cddce1" } */
4 extern int posix_memalign(void **memptr,
5 __SIZE_TYPE__ alignment, __SIZE_TYPE__ size);
7 int foo (float *p)
9 int res = *p;
10 struct { void *q1; void *q2; } q;
11 if (posix_memalign (&q.q1, 128, 128 * sizeof (int)) != 0)
12 return 0;
13 if (posix_memalign (&q.q2, 128, 128 * sizeof (int)) != 0)
14 return 0;
15 *((int *)q.q1) = 1;
16 *((int *)q.q2) = 2;
17 return res + *p + *((int *)q.q1) + *((int *)q.q2);
20 /* There should be only one load from *p left. All stores and all
21 other loads should be removed. */
23 /* { dg-final { scan-tree-dump-times "\\\*\[^ \]" 1 "cddce1" } } */
24 /* { dg-final { cleanup-tree-dump "cddce1" } } */