From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21878 invoked by alias); 13 May 2003 17:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21819 invoked by uid 71); 13 May 2003 17:56:01 -0000 Date: Tue, 13 May 2003 17:56:00 -0000 Message-ID: <20030513175601.21792.qmail@sources.redhat.com> To: kenner@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Geert Bosch Subject: Re: ada/8606: GNAT floating point optimization bug Reply-To: Geert Bosch X-SW-Source: 2003-05/txt/msg01497.txt.bz2 List-Id: The following reply was made to PR ada/8606; it has been noted by GNATS. From: Geert Bosch To: gcc-prs@gcc.gnu.org, 166255@bugs.debian.org, kalmquist1@hotmail.com, kenner@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: ada/8606: GNAT floating point optimization bug Date: Tue, 13 May 2003 13:46:51 -0400 Indeed the issue here is the standard one of double rounding for 64-bit floating point types. There is nothing Ada-specific about this and these problems are identical in C. The -ffloat-store option may improve repeatability, but has two undesired effects: it degrades performance and it always causes double rounding, which can degrade accuracy. For numerical code that requires exact rounding, only use 32-bit or 80-bit floating point types. When you need an expression to be computed to exactly 32 bits without any excess precision, store it to a volatile variable. If you really need 64-bit types with exact rounding, you'll have to set the rounding mode accordingly, but this will need changes in the Ada run time to prevent it from using 80-bit types. -Geert