Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dse-5.c
blobbeeff355ad2f4319201bb4c2e475c4ab9420bc9c
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 partially 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 *-*-*}} } */