diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/dfp/pr31385.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/dfp/pr31385.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/dfp/pr31385.c b/gcc/testsuite/c-c++-common/dfp/pr31385.c new file mode 100644 index 000000000..fc024a3e6 --- /dev/null +++ b/gcc/testsuite/c-c++-common/dfp/pr31385.c @@ -0,0 +1,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); +} |