public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Pop Sébastian" <pop@gauvain.u-strasbg.fr>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c/7857: Different behaviour if compiled with optimization!
Date: Wed, 09 Oct 2002 10:16:00 -0000	[thread overview]
Message-ID: <20021009171602.10354.qmail@sources.redhat.com> (raw)

The following reply was made to PR c/7857; it has been noted by GNATS.

From: =?iso-8859-1?Q?Pop_S=E9bastian?= <pop@gauvain.u-strasbg.fr>
To: jcas@netcabo.pt
Cc: gcc-gnats@gcc.gnu.org, austern@apple.com
Subject: Re: c/7857: Different behaviour if compiled with optimization!
Date: Wed, 9 Oct 2002 19:15:06 +0200

 On Sun, Sep 08, 2002 at 02:36:46PM -0000, jcas@netcabo.pt wrote:
 > /*
 > Compile with -O3 and runs fine
 > without there's a precision error.
 > SQ's value has the correct value with -O3 (+1 than without -O3 for n==46611179)
 > 
 
 Reproduced with 
 gcc version 2.95.4 20011002 (Debian prerelease)
 version gcc 3.3 20021007 (experimental)
 
 
 Compiling the bug report without -O3 gives an error: "Undefined reference to 'sqrt'".
 For completing the link we have to specify the -lm.
 Thus with no optimization, the 'sqrt' function is the one defined in the math library,
 whereas with -O3 the 'sqrt' function is the one defined by GCC... (I think)
 
 I hope that this helps,
 Sebastian.
 
 
 pop@gauvain:~/gcc/main/test$ ../usr/bin/gcc -o pr7857 ./pr7857.c -O3
 pop@gauvain:~/gcc/main/test$ ../usr/bin/gcc -o pr7857 ./pr7857.c
 /tmp/emacs-09607/cc4vzVim.o: dans la fonction `main':
 /tmp/emacs-09607/cc4vzVim.o(.text+0xaf): r\351f\351rence ind\351finie vers `sqrt'
 collect2: ld a retourn\351 1 code d'\351tat d'ex\351cution
 pop@gauvain:~/gcc/main/test$ ../usr/bin/gcc -o pr7857 ./pr7857.c -lm
 pop@gauvain:~/gcc/main/test$


             reply	other threads:[~2002-10-09 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-09 10:16 Pop Sébastian [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-09-08  7:46 jcas

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20021009171602.10354.qmail@sources.redhat.com \
    --to=pop@gauvain.u-strasbg.fr \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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