Date: Tue, 2 Apr 2002 00:20:04 -0800 (PST) From: Loren James Rittle <rittle@latour.rsch.comm.mot.com> To: freebsd-alpha@FreeBSD.org Subject: Re: alpha/36327: trap within cvt() while attempting to printf() an FP number Message-ID: <200204020820.g328K4621542@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR alpha/36327; it has been noted by GNATS.
From: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
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 <float.h>
#include <stdio.h>
#include <ieeefp.h>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204020820.g328K4621542>
