gcc/testsuite/gcc.dg/tree-ssa/vrp59.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fno-tree-ccp -fno-tree-forwprop -fdump-tree-vrp1" } */ |
| 3 | |
| 4 | int f(int x) |
| 5 | { |
| 6 | if (x >= 0 && x <= 3) |
| 7 | { |
| 8 | x = x ^ 3; |
| 9 | x = x & 3; |
| 10 | } |
| 11 | return x; |
| 12 | } |
| 13 | |
| 14 | int g(int x) |
| 15 | { |
| 16 | if (x >= 0 && x <= 3) |
| 17 | { |
| 18 | x = x ^ 2; |
| 19 | x = x & 3; |
| 20 | } |
| 21 | return x; |
| 22 | } |
| 23 | |
| 24 | int h(int x) |
| 25 | { |
| 26 | if (x >= 0 && x <= 3) |
| 27 | { |
| 28 | x = x ^ 1; |
| 29 | x = x & 3; |
| 30 | } |
| 31 | return x; |
| 32 | } |
| 33 | |
| 34 | /* { dg-final { scan-tree-dump-not " & 3;" "vrp1" } } */ |