From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24271 invoked by alias); 3 Jun 2002 11:46:06 -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 24248 invoked by uid 71); 3 Jun 2002 11:46:05 -0000 Date: Mon, 03 Jun 2002 04:46:00 -0000 Message-ID: <20020603114605.24243.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/msg00057.txt.bz2 List-Id: The following reply was made to PR c++/6914; it has been noted by GNATS. From: Michael Veksler To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, veksler@il.ibm.com, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/6914: -O2 and -O give different results for the same valid FP code Date: Mon, 03 Jun 2002 14:47:32 +0300 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6914 I managed to simplify this example, to a trivial C code. Please change category to C -------------- simplified example ---------- double f(); int main() { double a = 1.0 / f(); double b = 1.0 / f(); if(a < b) return 1; return 0; } double f() { return 3; } ----------- end example ---------- The exit status of the resulting executable should be 0, but when compiled with -O2 it is 1.