From owner-cvs-all@FreeBSD.ORG Sun Jan 18 13:57:03 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9F2E16A4CE; Sun, 18 Jan 2004 13:57:03 -0800 (PST) Received: from VARK.homeunix.com (adsl-68-124-78-95.dsl.pltn13.pacbell.net [68.124.78.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id 742C443D53; Sun, 18 Jan 2004 13:57:02 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.10/8.12.10) with ESMTP id i0ILubKu056499; Sun, 18 Jan 2004 13:56:37 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.10/8.12.10/Submit) id i0ILubP3056498; Sun, 18 Jan 2004 13:56:37 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Sun, 18 Jan 2004 13:56:32 -0800 From: David Schultz To: Marcel Moolenaar Message-ID: <20040118215632.GA56462@VARK.homeunix.com> Mail-Followup-To: Marcel Moolenaar , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200401181032.i0IAWoMh012953@repoman.freebsd.org> <20040118103340.GA44149@VARK.homeunix.com> <20040118210356.GA82925@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040118210356.GA82925@dhcp01.pn.xcllnt.net> cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gdtoa Makefile.inc _hdtoa.c src/lib/libc/stdio vfprintf.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2004 21:57:04 -0000 On Sun, Jan 18, 2004, Marcel Moolenaar wrote: > Currently stdtod() is causing a SIGFPE on ia64 for a kernel build. > This started when obrien@ added the following code to kern.post.mk: > > +emu10k1-alsa%diked.h: $S/gnu/dev/sound/pci/emu10k1-alsa.h > + grep -v '#include' ${.OODATE} | ${CC} -E -D__KERNEL__ -dM - \ > + | awk -F"[ (]" '/define/ \ > + { print "#ifndef " $$2 ; print ; print "#endif" }' \ > + >${.TARGET} > +.if !exists(${.OBJDIR}/.depend) > +_kernel-depend: emu10k1-alsa%diked.h > +.endif > > The problem is that awk(1) gets a SIGFPE unconditionally. I haven't > spent too much time on it yet, but I get the following in the gdb(1): > > Program received signal SIGFPE, Arithmetic exception. > 0x40000000000553d2 in strtod (s00=0x600000000001c02d "e-324", > se=0x9fffffffffffe6f0) at gdtoa_strtod.c:938 > 938 dval(rv) *= dval(rv0); I don't think this is strtod's fault. awk crashes for the same reason the following program gets a SIGFPE: das@pluto1:~> cat bar.c int main() { double d = 4.0083367200179456e-292; d *= 0x1.0p-106; } das@pluto1:~> gcc bar.c das@pluto1:~> ./a.out Floating exception (core dumped) The correct result is 4.940656e-324, which is denormalized. Some architectures generate a trap for denormals and expect them to be handled in software, but I didn't think that IA64 was one of them. I'm looking over the IA64 architecture manual now to see if I can figure out what's going on...