From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29922 invoked by alias); 3 Jun 2002 16:26:01 -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 29908 invoked by uid 71); 3 Jun 2002 16:26:01 -0000 Date: Mon, 03 Jun 2002 09:26:00 -0000 Message-ID: <20020603162601.29907.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Franz Sirl Subject: Re: c++/6914: -O2 and -O give different results for the same valid FP code Reply-To: Franz Sirl X-SW-Source: 2002-06/txt/msg00073.txt.bz2 List-Id: The following reply was made to PR c++/6914; it has been noted by GNATS. From: Franz Sirl To: "Michael Veksler" Cc: tprince@computer.org,gcc-gnats@gcc.gnu.org,gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Subject: Re: c++/6914: -O2 and -O give different results for the same valid FP code Date: Mon, 03 Jun 2002 18:16:21 +0200 At 17:49 03.06.2002, Michael Veksler wrote: >Tim Prince wrote: >+ Among the remedies available would be >+ a) set 53-bit rounding mode >+ b) choose -msse2, for appropriate targets > >After rereading the gcc manual, I found "-ffloat-store" which is the best >remedy. It is described in: >http://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Optimize-Options.html#Optimize%20Options > >It says "For most programs, the excess precision does only good". This >statement is wrong. It is unbearable to have a perfectly valid >code behave differently with -O2 and -O0 on the same platform. The default >should be changed to -ffloat-store. Of course, when passing >-funsafe-math-optimizations, gcc may also set -fno-float-store. > >If the decision will be to keep the current behavior, documentation should >be updated. It should be more clear that -float-store is critical for IEEE >conformance on targets like x86. Also, the bugs section should contain >this as a known bug (and bug it is -- gcc does not conform to the IEEE >standard on x86). Because GCC does not mess with the settings of the CPU, which is certainly _not_ GCC's job. Checkout glibc's documentation and look at stuff like fpu_control.h and fenv.h. Franz.