From 085d03cc4c5bb71f3b5739decc459194a927a00b Mon Sep 17 00:00:00 2001 From: uweigand Date: Tue, 3 Dec 2013 18:57:37 +0000 Subject: [PATCH] libgcc/ChangeLog: 2013-12-03 Adhemerval Zanella * config/rs6000/ibm-ldouble.c (__gcc_qadd): Fix add of normal number and qNaN to not raise an inexact exception. gcc/testsuite/ChangeLog: 2013-12-03 Adhemerval Zanella * gcc.target/powerpc/pr57363.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205645 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/powerpc/pr57363.c | 19 +++++++++++++++++++ libgcc/ChangeLog | 5 +++++ libgcc/config/rs6000/ibm-ldouble.c | 2 ++ 4 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr57363.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c1a0f54..2fea78d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-12-03 Adhemerval Zanella + + * gcc.target/powerpc/pr57363.c: New test. + 2013-12-03 Wei Mi PR rtl-optimization/59020 diff --git a/gcc/testsuite/gcc.target/powerpc/pr57363.c b/gcc/testsuite/gcc.target/powerpc/pr57363.c new file mode 100644 index 0000000..45ea3f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr57363.c @@ -0,0 +1,19 @@ +/* { dg-do run { target { powerpc*-*-linux* } } } */ +/* { dg-options "-mlong-double-128" } */ + +/* Check if adding a qNAN and a normal long double does not generate a + inexact exception. */ + +#define _GNU_SOURCE +#include + +int main(void) +{ + double x = __builtin_nan (""); + long double y = 1.1L; + + feenableexcept (FE_INEXACT); + feclearexcept (FE_ALL_EXCEPT); + x = x + y; + return fetestexcept(FE_INEXACT); +} diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 32705bf..fea1c05 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2013-12-03 Adhemerval Zanella + + * config/rs6000/ibm-ldouble.c (__gcc_qadd): Fix add + of normal number and qNaN to not raise an inexact exception. + 2013-11-28 Uros Bizjak * config/i386/32/sfp-machine.h (__FP_FRAC_ADDI_4): New macro. diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c index 28e02e9..7ca900c 100644 --- a/libgcc/config/rs6000/ibm-ldouble.c +++ b/libgcc/config/rs6000/ibm-ldouble.c @@ -104,6 +104,8 @@ __gcc_qadd (double a, double aa, double c, double cc) if (nonfinite (z)) { + if (fabs (z) != inf()) + return z; z = cc + aa + c + a; if (nonfinite (z)) return z; -- 2.7.4