summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/recip_sqrt_mult_1.c
blob: 80b9f679ed53e1e13eb1940eeeadc6404d4c9d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-Ofast -fdump-tree-recip" } */
/* { dg-additional-options "-fcompare-debug" { target { ! powerpc-ibm-aix* } } } */

double res, res2, tmp;
void
foo (double a, double b)
{
  tmp = 1.0 / __builtin_sqrt (a);
  res = tmp * tmp;
  res2 = a * tmp;
}

/* { dg-final { scan-tree-dump "Optimizing reciprocal sqrt multiplications" "recip" } } */
/* { dg-final { scan-tree-dump "Replacing squaring multiplication" "recip" } } */
/* { dg-final { scan-tree-dump "Replacing original division" "recip" } } */