| 1 |
/* PR tree-optimization/64277 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O3 -Wall -Werror -fdump-tree-cunroll-details" } */ |
| 4 |
/* { dg-final { scan-tree-dump "loop with 4 iterations completely unrolled" "cunroll" } } */ |
| 5 |
/* { dg-final { scan-tree-dump "loop with 5 iterations completely unrolled" "cunroll" } } */ |
| 6 |
|
| 7 |
#if __SIZEOF_INT__ < 4 |
| 8 |
__extension__ typedef __INT32_TYPE__ int32_t; |
| 9 |
#else |
| 10 |
typedef int int32_t; |
| 11 |
#endif |
| 12 |
|
| 13 |
int32_t f1[10]; |
| 14 |
void test1 (short a[], short m, unsigned short l) |
| 15 |
{ |
| 16 |
int32_t i = l; |
| 17 |
for (i = i + 5; i < m; i++) |
| 18 |
f1[i] = a[i]++; |
| 19 |
} |
| 20 |
|
| 21 |
void test2 (short a[], short m, short l) |
| 22 |
{ |
| 23 |
int32_t i; |
| 24 |
if (m > 5) |
| 25 |
m = 5; |
| 26 |
for (i = m; i > l; i--) |
| 27 |
f1[i] = a[i]++; |
| 28 |
} |