merge with trunk @ 139506
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-13.c
blob3253afe2927a4dcdbf2935fe53114fe946c8888c
1 /* { dg-do compile } */
2 /* { dg-options "-O -fstrict-aliasing -fno-tree-sra --param max-aliased-vops=0 --param max-fields-for-field-sensitive=0 -fdump-tree-fre-details" } */
4 /* Should be optimized, propagating &a into (*p)[i] with parameters
5 --param max-aliased-vops=0 --param max-fields-for-field-sensitive=0
6 which means max 1 VOP per stmt and no SFTs. */
8 /* For this testcase we need TBAA to work. */
10 struct Foo
12 void *data;
13 int size;
15 void foo(double (*q)[4], struct Foo *tmp1)
17 double a[4];
18 int i;
19 tmp1->data = &a;
20 tmp1->size = 4;
21 for (i=0; i<4; ++i)
23 double (*p)[4] = tmp1->data;
24 (*p)[i] = (*q)[i];
28 /* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
29 /* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" } } */
30 /* { dg-final { cleanup-tree-dump "fre" } } */