OSDN Git Service

2008-07-28 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-13.c
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" } */
3
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.  */
7
8 /* For this testcase we need TBAA to work.  */
9
10 struct Foo
11 {
12   void *data;
13   int size;
14 };
15 void foo(double (*q)[4], struct Foo *tmp1)
16 {
17   double a[4];
18   int i;
19   tmp1->data = &a;
20   tmp1->size = 4;
21   for (i=0; i<4; ++i)
22     {
23       double (*p)[4] = tmp1->data;
24       (*p)[i] = (*q)[i];
25     }
26 }
27
28 /* { dg-final { scan-tree-dump "Inserted .* &a" "fre"  { xfail *-*-* } } } */
29 /* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" { xfail *-*-* } } } */
30 /* { dg-final { cleanup-tree-dump "fre" } } */