From owner-freebsd-stable Sun Apr 9 18:41:13 2000 Delivered-To: freebsd-stable@freebsd.org Received: from rr.com (rdu25-22-143.nc.rr.com [24.25.22.143]) by hub.freebsd.org (Postfix) with ESMTP id 212E937BA40 for ; Sun, 9 Apr 2000 18:41:05 -0700 (PDT) (envelope-from rhh@rr.com) Received: (from rhh@localhost) by rr.com (8.9.3/8.9.3) id VAA02977; Sun, 9 Apr 2000 21:31:34 -0400 (EDT) (envelope-from rhh) Date: Sun, 9 Apr 2000 21:31:34 -0400 From: Randall Hopper To: "Daniel C. Sobral" Cc: stable@FreeBSD.ORG Subject: Re: float-to-double core dump on 3.4R Message-ID: <20000409213134.A2968@ipass.net> References: <20000408193053.A3689@ipass.net> <38F08E92.8E1016C4@newsguy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <38F08E92.8E1016C4@newsguy.com>; from dcs@newsguy.com on Sun, Apr 09, 2000 at 11:07:14PM +0900 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Daniel C. Sobral: |Randall Hopper wrote: |> |> #include |> |> 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