2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-15.c
blobc8f2d2c5ab1a05cb5d792101c0f7fa86e4048aa4
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 for (i=0; i<4; ++i)
20 double (*p)[4] = tmp1.data;
21 (*p)[i] = (*q)[i];
22 /* We want a PHI for the VOP for accessing tmp1.data, so place
23 this store to tmp1 here. */
24 tmp1.size -= 1.0;
26 bar(a);
29 /* { dg-final { scan-tree-dump "Replaced" "fre1" } } */