PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-14.c
blob4c4aa1bd6d2804709361a3c93da4f12b538c4955
1 /* { dg-do compile } */
2 /* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */
4 /* Should be optimized, propagating &a into (*p)[i]. */
6 struct Foo
8 void *data;
9 double size;
11 void bar(double *);
12 void foo(double (*q)[4])
14 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];
23 /* We want a PHI for the VOP for accessing tmp1.data, so place
24 this store to tmp1 here. */
25 tmp1.size -= 1.0;
27 bar(a);
30 /* { dg-final { scan-tree-dump "Replaced tmp1.data with &a" "fre1" } } */