| 1 |
/* Check that eliminable compare-instructions are eliminated. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-skip-if "" { "*-*-*" } { "-march=v0" } { "" } } */ |
| 4 |
/* { dg-options "-O2" { target march_option } } */ |
| 5 |
/* { dg-options "-O2 -march=v10" { target { ! march_option } } } */ |
| 6 |
/* { dg-final { scan-assembler-not "\tcmp|\ttest" } } */ |
| 7 |
|
| 8 |
#ifndef t |
| 9 |
#define t int |
| 10 |
#endif |
| 11 |
#ifndef t2 |
| 12 |
#define t2 t |
| 13 |
#endif |
| 14 |
#ifndef t3 |
| 15 |
#define t3 t |
| 16 |
#endif |
| 17 |
#ifndef op |
| 18 |
#define op(xx) __builtin_clz(xx) |
| 19 |
#endif |
| 20 |
|
| 21 |
extern t3 x; |
| 22 |
|
| 23 |
t2 f(t a, t2 *b, t2 *d) |
| 24 |
{ |
| 25 |
t2 c = op(a); |
| 26 |
|
| 27 |
*b = c; |
| 28 |
|
| 29 |
if (c != 0) |
| 30 |
*d = c; |
| 31 |
|
| 32 |
return c; |
| 33 |
} |