From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27686 invoked by alias); 13 May 2003 18:26: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 27550 invoked by uid 71); 13 May 2003 18:26:00 -0000 Resent-Date: 13 May 2003 18:26:00 -0000 Resent-Message-ID: <20030513182600.27549.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, omarbeo@hotmail.com Received: (qmail 10785 invoked by uid 48); 13 May 2003 18:17:36 -0000 Message-Id: <20030513181736.10784.qmail@sources.redhat.com> Date: Tue, 13 May 2003 18:26:00 -0000 From: omarbeo@hotmail.com Reply-To: omarbeo@hotmail.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/10772: Result differences between debug and optmize libs on linux; and with sol/nt on optimize mode X-SW-Source: 2003-05/txt/msg01509.txt.bz2 List-Id: >Number: 10772 >Category: optimization >Synopsis: Result differences between debug and optmize libs on linux; and with sol/nt on optimize mode >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue May 13 18:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: omarbeo@hotmail.com >Release: GCC 3.2 >Organization: >Environment: >Description: Hi, I'm seeing differences between nt/sol and linux when i run my application; i'm not sure if this a bug or not. the interresting thing is that linux-64 optmize and linux-32 debug results will match the nt/sol results. Here the code: double get_p() { ... }; // multiple oprations: multiplication, division,.. int get_p() { ... } double a; int res; a = ( (double) get_p() . get_g()); res = (int) a; i run this test on nt, unix, and linux platforms. nt and unix (sol) match, while linux data don't (off by 1 unit). when i run this test using linux debug libs, the results maches those of nt/sol! So i'm not sure why this is happening? This could be caused by us not rounding the numbers; but then why linux results differ based on how we build the libs ( optimize and debug). Thanks, salim >How-To-Repeat: >Fix: I'm attaching the Assemly code generated on linux in debug and optmize mode. I found a workaround which will make linux match the two other platforms as follow: static bool turn_off = false .. a = ( (double) get_p() . get_g()); if (turn_off) printf("", a) res = (int) a; >Release-Note: >Audit-Trail: >Unformatted: