public inbox for
help / color / mirror / Atom feed
Subject: optimization/10772: Result differences between debug and optmize libs on linux; and with sol/nt on optimize mode
Date: Tue, 13 May 2003 18:26:00 -0000	[thread overview]
Message-ID: <> (raw)

>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
>Release:        GCC 3.2

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).


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;

             reply	other threads:[~2003-05-13 18:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-13 18:26 omarbeo [this message]
2003-05-14  6:26 Dara Hazeghi
2003-05-14 10:48 giovannibajo
2003-05-14 14:36 Christian Ehrhardt
2003-05-14 15:14 bangerth
2003-05-14 15:16 omar beo
2003-05-14 19:26 omar beo
2003-05-14 20:56 Wolfgang Bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).