aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/rs6000/darwin-ldouble.c6
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr25960.c17
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a8be97..53e6953 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-03 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/25960
+ * config/rs6000/darwin-ldouble.c (__gcc_qadd): Preserve -0.0 result.
+
2006-02-03 Andreas Krebbel <krebbel1@de.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
@@ -1544,6 +1549,7 @@
2006-01-20 Alan Modra <amodra@bigpond.net.au>
+ PR target/25668
* libgcc2.c (__floatdisf, __floatdidf): Don't use IBM Extended
Double TFmode.
(__floatundisf, __floatundidf): Likewise.
diff --git a/gcc/config/rs6000/darwin-ldouble.c b/gcc/config/rs6000/darwin-ldouble.c
index 11df649..08ff351 100644
--- a/gcc/config/rs6000/darwin-ldouble.c
+++ b/gcc/config/rs6000/darwin-ldouble.c
@@ -117,8 +117,12 @@ __gcc_qadd (double a, double aa, double c, double cc)
{
q = a - z;
zz = q + c + (a - (q + z)) + aa + cc;
- xh = z + zz;
+ /* Keep -0 result. */
+ if (zz == 0.0)
+ return z;
+
+ xh = z + zz;
if (nonfinite (xh))
return xh;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 217aad8..c4d4528 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-02-03 Alan Modra <amodra@bigpond.net.au>
+
+ * gcc.target/powerpc/pr25960.c: New test.
+
2006-02-02 Steven G. Kargl <kargls@comcast>
PR fortran/24958
diff --git a/gcc/testsuite/gcc.target/powerpc/pr25960.c b/gcc/testsuite/gcc.target/powerpc/pr25960.c
new file mode 100644
index 0000000..9ab9a10
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr25960.c
@@ -0,0 +1,17 @@
+/* { dg-do run { target { powerpc*-*-darwin* powerpc*-*-aix* rs6000-*-* powerpc*-*-linux* } } } */
+/* { dg-options "-O2 -mlong-double-128" } */
+
+extern void abort (void);
+
+volatile long double l, m, n;
+
+int
+main (void)
+{
+ l = __builtin_copysignl (0.0L, -1.0L);
+ m = __builtin_copysignl (0.0L, -1.0L);
+ n = l + m;
+ if (__builtin_copysignl (1.0L, n) >= 0.0L)
+ abort ();
+ return 0;
+}