summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/dfp/pr31385.c
blob: fc024a3e6b829eb319ed287b85c3d79a978cc722 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* { dg-do compile } */
/* { dg-options "-O2" } */

typedef float fp_t __attribute__((mode(SD)));

extern fp_t g(fp_t);

fp_t
bug(fp_t x)
{
    fp_t result;
    int n;
    fp_t f, f3, y, z;

    n = 0;
    y = 1.DF;
    f = g(x);

    if (f < 0.DF)
        f = -f;

    f3 = 2.DF;

    z = (y + y + f / (y * y));
    y = (z + z) / (9.DF) + f3 / (z * z);

    result = y;

    return (result);
}