Optimise sqrt reciprocal multiplications
[official-gcc.git] / gcc / testsuite / gcc.dg / recip_sqrt_mult_1.c
blob188390a4ecffca1b21f05c4f19abecfb7ebd188f
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -fdump-tree-recip" } */
4 double res, res2, tmp;
5 void
6 foo (double a, double b)
8 tmp = 1.0 / __builtin_sqrt (a);
9 res = tmp * tmp;
10 res2 = a * tmp;
13 /* { dg-final { scan-tree-dump "Optimizing reciprocal sqrt multiplications" "recip" } } */
14 /* { dg-final { scan-tree-dump "Replacing squaring multiplication" "recip" } } */
15 /* { dg-final { scan-tree-dump "Replacing original division" "recip" } } */