| 1 |
/* PR tree-optimization/79390 */ |
| 2 |
/* { dg-do compile { target lp64 } } */ |
| 3 |
/* { dg-options "-O2 -march=haswell -mtune=haswell -mfpmath=sse" } */ |
| 4 |
/* Make sure we emit a conditional move in this loop. */ |
| 5 |
|
| 6 |
extern double A[32]; |
| 7 |
|
| 8 |
int |
| 9 |
foo (void) |
| 10 |
{ |
| 11 |
double t = A[0]; |
| 12 |
int jp = 0; |
| 13 |
int i; |
| 14 |
|
| 15 |
for (i = 0; i < 32; i++) |
| 16 |
{ |
| 17 |
double ab = A[i]; |
| 18 |
if (ab > t) |
| 19 |
{ |
| 20 |
jp = i; |
| 21 |
t = ab; |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
return jp; |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler "\[ \\t\]cmov\[a-z.]+\[ \\t\]" } } */ |