blob: 32cb5e048dea745394e8f182f3c664e81c355c74 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# DP: Fix PR libgcc/57363, taken from the trunk.
libgcc/
2013-12-03 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* config/rs6000/ibm-ldouble.c (__gcc_qadd): Fix add
of normal number and qNaN to not raise an inexact exception.
gcc/testsuite/
2013-12-03 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* gcc.target/powerpc/pr57363.c: New test.
--- a/src/libgcc/config/rs6000/ibm-ldouble.c
+++ a/src/libgcc/config/rs6000/ibm-ldouble.c
@@ -104,6 +104,8 @@
if (nonfinite (z))
{
+ if (fabs (z) != inf())
+ return z;
z = cc + aa + c + a;
if (nonfinite (z))
return z;
--- a/src/gcc/testsuite/gcc.target/powerpc/pr57363.c
+++ a/src/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 <fenv.h>
+
+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);
+}
|