| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Ofast -fdump-tree-recip" } */ |
| 3 |
/* { dg-additional-options "-fcompare-debug" { target { ! powerpc-ibm-aix* } } } */ |
| 4 |
|
| 5 |
/* The main path doesn't have any multiplications. |
| 6 |
Avoid introducing them in the recip pass. */ |
| 7 |
|
| 8 |
double res, res2, tmp; |
| 9 |
void |
| 10 |
foo (double a, double b, int c, int d) |
| 11 |
{ |
| 12 |
tmp = 1.0 / __builtin_sqrt (a); |
| 13 |
if (c) |
| 14 |
res = tmp * tmp; |
| 15 |
|
| 16 |
if (d) |
| 17 |
res2 = a * tmp; |
| 18 |
} |
| 19 |
|
| 20 |
/* { dg-final { scan-tree-dump-not "Optimizing reciprocal sqrt multiplications" "recip" } } */ |
| 21 |
/* { dg-final { scan-tree-dump-not "Replacing squaring multiplication" "recip" } } */ |
| 22 |
/* { dg-final { scan-tree-dump-not "Replacing original division" "recip" } } */ |