gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O -fdump-tree-optimized" } */ |
| 3 | |
| 4 | int g(int,int); |
| 5 | int h(int); |
| 6 | int f(int t, int c) |
| 7 | { |
| 8 | int d = 0; |
| 9 | int e = 0; |
| 10 | if (t) |
| 11 | { |
| 12 | d = h(c); |
| 13 | e = t; |
| 14 | } |
| 15 | else d = 0, e = 0; |
| 16 | return g(e,d); |
| 17 | } |
| 18 | |
| 19 | /* The value e should have been replaced with t and there should be only one PHI. */ |
| 20 | /* { dg-final { scan-tree-dump "g .t_\[0-9\]*.D.," "optimized" } } */ |
| 21 | /* { dg-final { scan-tree-dump-times "PHI" 1 "optimized" } } */ |