gcc/testsuite/gcc.dg/tree-ssa/pr66726-4.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-phiopt1-details" } */ |
| 3 | |
| 4 | #define SAT(x) (x < 0 ? 0 : (x > 255 ? 255 : x)) |
| 5 | |
| 6 | void |
| 7 | foo (unsigned char *p, int i) |
| 8 | { |
| 9 | *p = SAT (i); |
| 10 | } |
| 11 | |
| 12 | /* fold could optimize SAT before phiopt1 so only match on the |
| 13 | MIN/MAX here. */ |
| 14 | /* { dg-final { scan-tree-dump-times "= MIN_EXPR" 1 "phiopt1" } } */ |
| 15 | /* { dg-final { scan-tree-dump-times "= MAX_EXPR" 1 "phiopt1" } } */ |