From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15230 invoked by alias); 3 Jun 2002 15:56: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 15216 invoked by uid 71); 3 Jun 2002 15:56:01 -0000 Date: Mon, 03 Jun 2002 08:56:00 -0000 Message-ID: <20020603155601.15215.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Michael Veksler" Subject: Re: c++/6914: -O2 and -O give different results for the same valid FP code Reply-To: "Michael Veksler" X-SW-Source: 2002-06/txt/msg00072.txt.bz2 List-Id: The following reply was made to PR c++/6914; it has been noted by GNATS. From: "Michael Veksler" To: tprince@computer.org Cc: 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, 3 Jun 2002 18:49:24 +0300 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).