gcc/testsuite/gcc.dg/tree-ssa/pr84859.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -ftree-cselim -Warray-bounds -fdump-tree-phiopt2" } */ |
| 3 | |
| 4 | void |
| 5 | h (const void *p, unsigned n) |
| 6 | { |
| 7 | unsigned char a[8]; |
| 8 | if (n > sizeof a) |
| 9 | return; |
| 10 | |
| 11 | for (; n > 0; n -= *a) |
| 12 | { |
| 13 | if (n > 255) |
| 14 | *a = 255; |
| 15 | else |
| 16 | *a = n; |
| 17 | |
| 18 | __builtin_memcpy (a, p, *a); /* { dg-bogus "bounds" } */ |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | /* { dg-final { scan-tree-dump "MIN_EXPR" "phiopt2" } } */ |