Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-13.c
blob972e6c69ef9f97391e1141187742a668647252f2
1 /* { dg-do compile } */
2 /* { dg-options "-O -fstrict-aliasing -fno-tree-sra -fdump-tree-fre-details" } */
4 /* Should be optimized, propagating &a into (*p)[i]. */
6 /* For this testcase we need TBAA to work. */
8 struct Foo
10 void *data;
11 int size;
13 void foo(double (*q)[4], struct Foo *tmp1)
15 double a[4];
16 int i;
17 tmp1->data = &a;
18 tmp1->size = 4;
19 for (i=0; i<4; ++i)
21 double (*p)[4] = tmp1->data;
22 (*p)[i] = (*q)[i];
26 /* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data with &a" "fre" } } */
27 /* { dg-final { cleanup-tree-dump "fre" } } */