gcc/testsuite/gcc.dg/pr108625.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-forwprop1 -fdump-tree-optimized" } */ |
| 3 | |
| 4 | unsigned char foo(int x) |
| 5 | { |
| 6 | int t = -x; |
| 7 | unsigned char t1 = t; |
| 8 | unsigned char t2 = t; |
| 9 | /* We may not rewrite this as (unsigned char)(t - x). */ |
| 10 | return t1 + t2; |
| 11 | } |
| 12 | |
| 13 | /* { dg-final { scan-tree-dump-times "x_" 1 "forwprop1" } } */ |
| 14 | /* { dg-final { scan-tree-dump-times "x_" 1 "optimized" } } */ |