Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: parisc-linux@parisc-linux.org
Subject: [parisc-linux] hppa-linux gcc-3.0.3: -O2 optimization does not handle fp args correctly
Date: Mon, 4 Feb 2002 08:38:42 -0800	[thread overview]
Message-ID: <20020204163842.GF624@tausq.org> (raw)

I was going to file this bug against gcc, but it looks like it's
just another instance of the fp relocation bug that has been
reported earlier..... Dave, Alan, any suggestions on how we should fix
this? 

The following program gives inconsistent output with -O1 vs -O2:

legolas[22:24] ~% gcc -O1 -o logtest logtest.c -lm
legolas[22:24] ~% ./logtest
float: nan
legolas[22:24] ~% gcc -O2 -o logtest logtest.c -lm
legolas[22:24] ~% ./logtest
float: -1.002099

The bug was first observed in the testsuite for 'mawk'. A simpler
testcase that illustrates the problem is:

#include <stdio.h>
#include <math.h>

void print_data(double d)
{
	fprintf(stderr, "float: %f\n", d);
}

int main(int argc, char **argv)
{
	double d = log(-8.0);
	print_data(d);
	return 0;
}

randolph
-- 
Debian Developer <tausq@debian.org>
http://www.TauSq.org/

             reply	other threads:[~2002-02-04 16:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-04 16:38 Randolph Chung [this message]
2002-02-04 17:04 ` [parisc-linux] hppa-linux gcc-3.0.3: -O2 optimization does not handle fp args correctly John David Anglin
2002-02-04 17:07   ` Randolph Chung

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=20020204163842.GF624@tausq.org \
    --to=randolph@tausq.org \
    --cc=parisc-linux@parisc-linux.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