Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2000 20:50:02 -0700 (PDT)
From:      Kevin Day <toasty@dragondata.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: i386/17914: float-to-double core dump on 3.4R
Message-ID:  <200004110350.UAA44113@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/17914; it has been noted by GNATS.

From: Kevin Day <toasty@dragondata.com>
To: aa8vb@ipass.net
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/17914: float-to-double core dump on 3.4R
Date: Mon, 10 Apr 2000 22:47:51 -0500 (CDT)

 > 	     #include <float.h>
 > 	
 > 	     main()
 > 	     {
 > 	        float  f = FLT_MAX;
 > 	        double d;
 > 	        f = f * 2;
 > 	        d = f;
 > 	     }
 > 	
 > 	Delete the "d=f" line and it doesn't core.  Put it in and it does
 > 	(floating-point exception).
 > 	
 > 	From this it appears there may be a bug in the float-to-double
 > 	promotion when f is Inf (or, at least I'd expect that f is Inf).
 > 
 > 	Note that the core dump does not occur when the Inf is generated,
 >         but only when it is promoted to a double.
 > 
 >         I first noticed this by trying to printf the value of f after f=f*2
 > 	and got the same core-dump behavior (due to float-to-double arg
 > 	promotion).
 
 
 See 'man setfpmask'. The default behavior in 3.4 was to cause a SIGFPE if
 you do anything that causes an 'overflow' to be generated from the FPU. I
 admit this is weird that it's doing it here, but I don't claim to understand
 what happens in a case like this. :)
 
 (4.0 and higher changed their defaults to ignore certain exceptions)
 
 
 Kevin
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004110350.UAA44113>