Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / tree-ssa / ssa-dse-5.c
blob537a5e57b8484b13a6de101b88f7ba46bdb35235
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 int x;
6 int
7 f1 (int i, int j, int k)
8 {
9 int *p = k ? &i : &j;
10 i = 3;
11 *p = 5;
12 x = j;
15 /* The assignment "i = 3" is partialy dead. Our DSE pass doesn't handle
16 detection of partially dead assignments.
18 There's two outputs which would indicate that the optimization was
19 performed.
21 If we used block copying to detect and eliminate the partially dead
22 store, then we should see an assignment "i = 5" somewhere in the
23 dump file.
25 Another approach would be to redirect the path from the true arm
26 of the first conditional so that it reaches the statement *p = 5
27 rather than i = 3. */
29 /* { dg-final { scan-tree-dump-times "i = 5" 1 "optimized" { xfail *-*-* }} } */
30 /* { dg-final { scan-tree-dump-times "<L.*>:;\[\n\t \]*\\*p = 5" 1 "optimized" { xfail *-*-*}} } */
32 /* { dg-final { cleanup-tree-dump "optimized" } } */