NetBSD Problem Report #41277
From www@NetBSD.org Sat Apr 25 03:29:23 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 3500763C20F
for <gnats-bugs@gnats.netbsd.org>; Sat, 25 Apr 2009 03:29:23 +0000 (UTC)
Message-Id: <20090425032922.A49BC63C166@www.NetBSD.org>
Date: Sat, 25 Apr 2009 03:29:22 +0000 (UTC)
From: lidl@pix.net
Reply-To: lidl@pix.net
To: gnats-bugs@NetBSD.org
Subject: libc/gdtoa/hdtoa.c will not compile on vax with gcc 4.3.3
X-Send-Pr-Version: www-1.0
>Number: 41277
>Category: port-vax
>Synopsis: libc/gdtoa/hdtoa.c will not compile on vax with gcc 4.3.3
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-vax-maintainer
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 25 03:30:00 +0000 2009
>Closed-Date: Sat Mar 05 06:06:44 +0000 2016
>Last-Modified: Sat Mar 05 06:06:44 +0000 2016
>Originator: Kurt Lidl
>Release: netbsd-5
>Organization:
>Environment:
cross-building for a vax, from a solaris x86 machine,
using gcc 4.3.3
>Description:
Since I spent a bunch of time getting gcc 4.3.3 to run
as a cross-compiler in the netbsd tree, I figured I'd
see if it could work for something other than a coldfire.
I picked the vax, since I know its support in gcc is,
um, a little weak.
Anyway:
# compile libc/hdtoa.o
/nbsd/vax-5/tools/bin/vax--netbsdelf-gcc -O1 -fgcse -fstrength-reduce -fgcse-after-reload -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -std=gnu99 -Werror -pipe -fstack-protector -Wstack-protector --param ssp-buffer-size=1 -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT -DHESIOD -DINET6 -DNLS -DYP -I/nbsd/nbsd-5/lib/libc/include -I/nbsd/nbsd-5/lib/libc -I. -I/nbsd/nbsd-5/sys -I/nbsd/nbsd-5/lib/libc/compat/stdlib -I/nbsd/nbsd-5/lib/libc/compat/../stdlib -I/nbsd/nbsd-5/lib/libc/../../common/lib/libc/quad -I/nbsd/nbsd-5/lib/libc/../../common/lib/libc/string -I/nbsd/nbsd-5/lib/libc/../../common/lib/libc/arch/vax/string -D__DBINTERFACE_PRIVATE -I/nbsd/nbsd-5/libexec/ld.elf_so -I/nbsd/nbsd-5/lib/libc/dlfcn -I/nbsd/nbsd-5/lib/libc/gdtoa -DNO_FENV_H -I/nbsd/nbsd-5/lib/libc/arch/vax/gdtoa -DWITH_RUNE -I/nbsd/nbsd-5/lib/
libc -DPOSIX_MISTAKE -DCOMPAT__RES -DUSE_POLL -DPORTMAP -DWIDE_DOUBLE -DALL_STATE -DUSG_COMPAT -D_FORTIFY_SOURCE=2 -nostdinc -isystem /nbsd/vax-5/nbuild/usr/include -c /nbsd/nbsd-5/lib/libc/gdtoa/hdtoa.c -o hdtoa.o
cc1: warnings being treated as errors
/nbsd/nbsd-5/lib/libc/gdtoa/hdtoa.c: In function '__hdtoa':
/nbsd/nbsd-5/lib/libc/gdtoa/hdtoa.c:164: error: floating constant exceeds range of 'double'
>How-To-Repeat:
build libc with gcc 4.3.3
>Fix:
>Release-Note:
>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, port-vax-maintainer@netbsd.org,
gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc:
Subject: Re: port-vax/41277: libc/gdtoa/hdtoa.c will not compile on vax with gcc 4.3.3
Date: Sat, 25 Apr 2009 10:13:15 -0400
On Apr 25, 3:30am, lidl@pix.net (lidl@pix.net) wrote:
-- Subject: port-vax/41277: libc/gdtoa/hdtoa.c will not compile on vax with g
| >Number: 41277
| >Category: port-vax
| >Synopsis: libc/gdtoa/hdtoa.c will not compile on vax with gcc 4.3.3
| >Confidential: no
| >Severity: serious
| >Priority: medium
| >Responsible: port-vax-maintainer
| >State: open
| >Class: sw-bug
| >Submitter-Id: net
| >Arrival-Date: Sat Apr 25 03:30:00 +0000 2009
| >Originator: Kurt Lidl
| >Release: netbsd-5
| >Organization:
| >Environment:
| cross-building for a vax, from a solaris x86 machine,
| using gcc 4.3.3
|
| >Description:
| Since I spent a bunch of time getting gcc 4.3.3 to run
| as a cross-compiler in the netbsd tree, I figured I'd
| see if it could work for something other than a coldfire.
|
| I picked the vax, since I know its support in gcc is,
| um, a little weak.
|
| Anyway:
|
| # compile libc/hdtoa.o
| /nbsd/vax-5/tools/bin/vax--netbsdelf-gcc -O1 -fgcse -fstrength-reduce -fgcse-after-reload -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -std=gnu99 -Werror -pipe -fstack-protector -Wstack-protector --param ssp-buffer-size=1 -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT -DHESIOD -DINET6 -DNLS -DYP -I/nbsd/nbsd-5/lib/libc/include -I/nbsd/nbsd-5/lib/libc -I. -I/nbsd/nbsd-5/sys -I/nbsd/nbsd-5/lib/libc/compat/stdlib -I/nbsd/nbsd-5/lib/libc/compat/../stdlib -I/nbsd/nbsd-5/lib/libc/../../common/lib/libc/quad -I/nbsd/nbsd-5/lib/libc/../../common/lib/libc/string -I/nbsd/nbsd-5/lib/libc/../../common/lib/libc/arch/vax/string -D__DBINTERFACE_PRIVATE -I/nbsd/nbsd-5/libexec/ld.elf_so -I/nbsd/nbsd-5/lib/libc/dlfcn -I/nbsd/nbsd-5/lib/libc/gdtoa -DNO_FENV_H -I/nbsd/nbsd-5/lib/libc/arch/vax/gdtoa -DWITH_RUNE -I/nbsd/nbsd-5/li
b/
| libc -DPOSIX_MISTAKE -DCOMPAT__RES -DUSE_POLL -DPORTMAP -DWIDE_DOUBLE -DALL_STATE -DUSG_COMPAT -D_FORTIFY_SOURCE=2 -nostdinc -isystem /nbsd/vax-5/nbuild/usr/include -c /nbsd/nbsd-5/lib/libc/gdtoa/hdtoa.c -o hdtoa.o
| cc1: warnings being treated as errors
| /nbsd/nbsd-5/lib/libc/gdtoa/hdtoa.c: In function '__hdtoa':
| /nbsd/nbsd-5/lib/libc/gdtoa/hdtoa.c:164: error: floating constant exceeds range of 'double'
|
Perhaps something like this (I am just guessing).
christos
Index: hdtoa.c
===================================================================
RCS file: /cvsroot/src/lib/libc/gdtoa/hdtoa.c,v
retrieving revision 1.6
diff -u -u -r1.6 hdtoa.c
--- hdtoa.c 21 Mar 2008 23:13:48 -0000 1.6
+++ hdtoa.c 25 Apr 2009 14:12:32 -0000
@@ -161,8 +161,15 @@
*decpt = 1;
return (nrv_alloc("0", rve, 1));
case FP_SUBNORMAL:
+#ifdef __vax__
+ /* (DBL_MAX_EXP=127 / 2) + 2 = 65? */
+ u.dblu_d *= 0x1p65;
+ *decpt = u.dblu_dbl.dbl_exp - (65 + DBL_ADJ);
+#endif
+ /* (DBL_MAX_EXP=1024 / 2) + 2 = 514? */
u.dblu_d *= 0x1p514;
*decpt = u.dblu_dbl.dbl_exp - (514 + DBL_ADJ);
+#endif
break;
case FP_INFINITE:
*decpt = INT_MAX;
State-Changed-From-To: open->closed
State-Changed-By: ragge@NetBSD.org
State-Changed-When: Sat, 05 Mar 2016 06:06:44 +0000
State-Changed-Why:
Fixed by Christos some years ago.
(Not in NetBSD 5 though, but it is EOL now).
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.