From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13776 invoked by alias); 24 Apr 2003 16:06: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 13756 invoked by uid 71); 24 Apr 2003 16:06:01 -0000 Resent-Date: 24 Apr 2003 16:06:01 -0000 Resent-Message-ID: <20030424160601.13754.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Alberto.Ribon@cern.ch Received: (qmail 10234 invoked by uid 48); 24 Apr 2003 15:59:44 -0000 Message-Id: <20030424155944.10233.qmail@sources.redhat.com> Date: Thu, 24 Apr 2003 16:06:00 -0000 From: Alberto.Ribon@cern.ch Reply-To: Alberto.Ribon@cern.ch To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/10482: Optimized and debug binaries of same application give different results. X-SW-Source: 2003-04/txt/msg01041.txt.bz2 List-Id: >Number: 10482 >Category: optimization >Synopsis: Optimized and debug binaries of same application give different results. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Apr 24 16:06:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Alberto.Ribon@cern.ch >Release: gcc 3.2.2 and earlier versions (2.95.2) >Organization: >Environment: Linux Red Hat 7.3 >Description: After building the same C++ application twice, once using debug -g option and once with optimization ( -O option), and running them at the same conditions, the results numerically differ while they should be exactly the same. We verified and are confident that there are no cases of uninitialized variables or numerical instabilities (like nan, division by zero, etc...). We also verified that the same exercise on Sun Solaris system with Forte CC 5.4 compiler (and earlier verions) instead generates the same output in the two cases. We would like to know if this is a known feature of gcc compiler, and what could be the cause in terms of optimizations done with the default level -O. >How-To-Repeat: The problem appears in a rather complicated simulation application for which we don't have an easy test case to provide. >Fix: >Release-Note: >Audit-Trail: >Unformatted: