Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdlib Simplify the code and avoid a compiler issue...



details:   https://anonhg.NetBSD.org/src/rev/a8aa4a2f20ad
branches:  trunk
changeset: 580457:a8aa4a2f20ad
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Apr 24 19:33:52 2005 +0000

description:
Simplify the code and avoid a compiler issue with -O6 on sparc64:
Error: Illegal operands: There are only 32 single precision f registers; [0-31]

diffstat:

 lib/libc/stdlib/strtod.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r 8bf8c7c6fa54 -r a8aa4a2f20ad lib/libc/stdlib/strtod.c
--- a/lib/libc/stdlib/strtod.c  Sun Apr 24 18:18:52 2005 +0000
+++ b/lib/libc/stdlib/strtod.c  Sun Apr 24 19:33:52 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strtod.c,v 1.46 2005/04/15 22:46:21 kleink Exp $       */
+/*     $NetBSD: strtod.c,v 1.47 2005/04/24 19:33:52 christos Exp $     */
 
 /****************************************************************
  *
@@ -93,7 +93,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strtod.c,v 1.46 2005/04/15 22:46:21 kleink Exp $");
+__RCSID("$NetBSD: strtod.c,v 1.47 2005/04/24 19:33:52 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -1742,9 +1742,8 @@
                         * example: 1.2e-307 .
                         */
                        if (y <= (P-1)*Exp_msk1 && aadj >= 1.) {
-                               aadj1 = (double)(int)(aadj + 0.5);
-                               if (!dsign)
-                                       aadj1 = -aadj1;
+                               int tmpadj = (int)(aadj + 0.5);
+                               aadj1 = (double)(dsign ? tmpadj : -tmpadj);
                                }
                        adj = aadj1 * ulp(value(rv));
                        value(rv) += adj;



Home | Main Index | Thread Index | Old Index