gcc/testsuite/gcc.dg/tree-ssa/pr103281-1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 | /* PR tree-optmization/103281 */ |
| 4 | |
| 5 | void foo(void); |
| 6 | |
| 7 | static unsigned b; |
| 8 | |
| 9 | int main() { |
| 10 | for (; b < 3; b++) { |
| 11 | char c = b; |
| 12 | char a = c ? c : c << 1; |
| 13 | if (!(a < 1 ^ b)) |
| 14 | foo(); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | /* the call to foo should be optimized away. */ |
| 19 | /* { dg-final { scan-tree-dump-not "foo " "optimized" } } */ |