Date: Sun, 9 Apr 2000 21:31:34 -0400 From: Randall Hopper <aa8vb@ipass.net> To: "Daniel C. Sobral" <dcs@newsguy.com> Cc: stable@FreeBSD.ORG Subject: Re: float-to-double core dump on 3.4R Message-ID: <20000409213134.A2968@ipass.net> In-Reply-To: <38F08E92.8E1016C4@newsguy.com>; from dcs@newsguy.com on Sun, Apr 09, 2000 at 11:07:14PM %2B0900 References: <20000408193053.A3689@ipass.net> <38F08E92.8E1016C4@newsguy.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Daniel C. Sobral: |Randall Hopper wrote: |> |> #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). |> |> Any comments? If not, I'll file the PR. | |Sure. If you delete the last line, the compiler will optimize away f = f |* 2, I bet. Try with -O0 (that's oh-zero :). Thanks for the suggestion. Turns out it -O0 doesn't yield different behavior (doesn't core dump without the last line, as before). That's consistent with seeing the core dump on the d=f line. Randall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000409213134.A2968>