From owner-freebsd-alpha Tue Apr 2 0:20:14 2002 Delivered-To: freebsd-alpha@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E00FD37B41C for ; Tue, 2 Apr 2002 00:20:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g328K4621542; Tue, 2 Apr 2002 00:20:04 -0800 (PST) (envelope-from gnats) Date: Tue, 2 Apr 2002 00:20:04 -0800 (PST) Message-Id: <200204020820.g328K4621542@freefall.freebsd.org> To: freebsd-alpha@FreeBSD.org Cc: From: Loren James Rittle Subject: Re: alpha/36327: trap within cvt() while attempting to printf() an FP number Reply-To: Loren James Rittle Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR alpha/36327; it has been noted by GNATS. From: Loren James Rittle To: gallatin@cs.duke.edu Cc: ljrittle@freebsd.org, freebsd-gnats-submit@freebsd.org Subject: Re: alpha/36327: trap within cvt() while attempting to printf() an FP number Date: Tue, 2 Apr 2002 02:13:21 -0600 (CST) > I beleive this only works for floating point operations which have > software completion enabled. Eg, -mieee. OK. > Have you tried adding -mieee to CFLAGS? Yes, I see that I failed to report it, but I did try the test case with -mieee and without it. As far as I can see, the mechanism documented to disable underflow traps is not working on alpha*-*-freebsd4.2 or alpha*-*-freebsd5.0 OR there is a bug in the handling of some FP numbers in cvt() which causes a non-maskable FP trap. Sorry I should have posted a complete example. Here is one that fails: ; cat tq.c #include #include #include main() { double d = DBL_MIN; fpsetmask(0); printf (" = %.17g;\n", d); printf (" = %.17g;\n", d/10); printf (" = %.17g;\n", (DBL_MIN/10)*10); printf (" = %.17g;\n", (DBL_MIN/10)); } ; /usr/bin/gcc -mieee tq.c ; a.out = 2.2250738585072014e-308; floating point exception--core dumped Exact same output when compiled without -mieee. In any event, it is not the code for d/10 that traps. It is code inside cvt() which is called from vfprintf(). Two issues: Should a library routine ever internally trap; no matter what the mask setting? Shouldn't there be some way to disable the trap? Regards, Loren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message