| 1 |
/* Check that GCC does not generates Armv8.1-M low over head loop |
| 2 |
instructions. Innermost loop has no fixed number of iterations |
| 3 |
therefore is not optimizable. Outer loops are not optimized. */ |
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */ |
| 6 |
/* { dg-options "-march=armv8.1-m.main+fp -mthumb -O3 --save-temps" } */ |
| 7 |
#include <stdlib.h> |
| 8 |
#include "lob.h" |
| 9 |
|
| 10 |
int a[N]; |
| 11 |
int b[N]; |
| 12 |
int c[N]; |
| 13 |
|
| 14 |
int |
| 15 |
main (void) |
| 16 |
{ |
| 17 |
for (int i = 0; i < N; i++) |
| 18 |
{ |
| 19 |
a[i] = i; |
| 20 |
b[i] = i * 2; |
| 21 |
|
| 22 |
int k = b[i]; |
| 23 |
while (k != 0) |
| 24 |
{ |
| 25 |
if (k % 2 == 0) |
| 26 |
c[i - 1] = k % 2; |
| 27 |
k /= 2; |
| 28 |
} |
| 29 |
c[i] = a[i] - b[i]; |
| 30 |
} |
| 31 |
|
| 32 |
return 0; |
| 33 |
} |
| 34 |
/* { dg-final { scan-assembler-not {dls\s\S*,\s\S*} } } */ |
| 35 |
/* { dg-final { scan-assembler-not {le\slr,\s\S*} } } */ |