]>
Commit | Line | Data |
---|---|---|
227858d1 | 1 | /* { dg-do compile } */ |
2090d6a0 | 2 | /* { dg-options "-O2 -fdump-tree-vrp1" } */ |
227858d1 | 3 | |
830976a1 | 4 | int |
227858d1 DN |
5 | foo (int *p, int i) |
6 | { | |
7 | int x; | |
8 | ||
9 | if (i > 10) | |
10 | { | |
11 | if (p) | |
12 | { | |
13 | x = *p; | |
14 | p = 0; | |
15 | } | |
16 | } | |
17 | else | |
18 | p = 0; | |
19 | ||
20 | /* This should be folded to if (1), but only if we insert an | |
21 | assertion on the ELSE edge from the inner 'if (p)'. */ | |
22 | if (p == 0) | |
23 | return x + 1; | |
24 | ||
25 | return i; | |
26 | } | |
27 | ||
2090d6a0 | 28 | /* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */ |