]>
Commit | Line | Data |
---|---|---|
404d6be4 | 1 | /* { dg-do compile } */ |
dd277d48 | 2 | /* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details" } */ |
404d6be4 | 3 | |
dd277d48 | 4 | /* Should be optimized, propagating &a into (*p)[i]. */ |
404d6be4 | 5 | |
6 | struct Foo | |
7 | { | |
8 | void *data; | |
9 | double size; | |
10 | }; | |
11 | void foo(double (*q)[4]) | |
12 | { | |
13 | struct Foo tmp1; | |
14 | double a[4]; | |
15 | int i; | |
16 | tmp1.data = &a; | |
17 | tmp1.size = 4; | |
18 | for (i=0; i<4; ++i) | |
19 | { | |
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; | |
25 | } | |
26 | } | |
27 | ||
f2dcca90 | 28 | /* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */ |
29 | /* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" } } */ | |
404d6be4 | 30 | /* { dg-final { cleanup-tree-dump "fre" } } */ |