* [parisc-linux] hppa-linux gcc-3.0.3: -O2 optimization does not handle fp args correctly
@ 2002-02-04 16:38 Randolph Chung
2002-02-04 17:04 ` John David Anglin
0 siblings, 1 reply; 3+ messages in thread
From: Randolph Chung @ 2002-02-04 16:38 UTC (permalink / raw)
To: parisc-linux
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [parisc-linux] hppa-linux gcc-3.0.3: -O2 optimization does not handle fp args correctly
2002-02-04 16:38 [parisc-linux] hppa-linux gcc-3.0.3: -O2 optimization does not handle fp args correctly Randolph Chung
@ 2002-02-04 17:04 ` John David Anglin
2002-02-04 17:07 ` Randolph Chung
0 siblings, 1 reply; 3+ messages in thread
From: John David Anglin @ 2002-02-04 17:04 UTC (permalink / raw)
To: randolph; +Cc: parisc-linux
> legolas[22:24] ~% gcc -O2 -o logtest logtest.c -lm
> legolas[22:24] ~% ./logtest
> float: -1.002099
This looks ok with my new build of 3.1:
dave@gsyprf11:~/gcc_test$ gcc -O2 -o logtest logtest.c -lm
dave@gsyprf11:~/gcc_test$ ./logtest
float: nan
dave@gsyprf11:~/gcc_test$ gcc -O1 -o logtest logtest.c -lm
dave@gsyprf11:~/gcc_test$ ./logtest
float: nan
The problem that needs fixing in the linker is passing floating
arguments to indirect functions. The above program doesn't involve
an indirect call.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [parisc-linux] hppa-linux gcc-3.0.3: -O2 optimization does not handle fp args correctly
2002-02-04 17:04 ` John David Anglin
@ 2002-02-04 17:07 ` Randolph Chung
0 siblings, 0 replies; 3+ messages in thread
From: Randolph Chung @ 2002-02-04 17:07 UTC (permalink / raw)
To: John David Anglin; +Cc: parisc-linux
> The problem that needs fixing in the linker is passing floating
> arguments to indirect functions. The above program doesn't involve
> an indirect call.
hrm... ok. any ideas when this was fixed? we can't ship 3.1 with the
upcoming debian release, so we'll need to backport the fix.
randolph
--
@..@ http://www.TauSq.org/
(----)
( >__< )
^^ ~~ ^^
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-02-04 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-04 16:38 [parisc-linux] hppa-linux gcc-3.0.3: -O2 optimization does not handle fp args correctly Randolph Chung
2002-02-04 17:04 ` John David Anglin
2002-02-04 17:07 ` Randolph Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox