This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: F77 FP screwup (i386 cross-compiler -> vax)
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Matt Thomas <matt at 3am-software dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Aug 2002 00:13:53 +0200
- Subject: Re: F77 FP screwup (i386 cross-compiler -> vax)
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <5.1.1.6.2.20020827114539.037e8e88@3am-software.com>
Matt Thomas wrote:
I've been trying to figure out why the g77 testsuite has so
many failures for a VAX target when my host is running
NetBSD/i386. Briefly, it comes down to g771 emitting
incorrect floating point numbers.
Given the following two small programs:
foo = acos(0.54030231)
end
And
x(void) { acos(0.54030231); }
I would expect them to generate approx. the same code.
Well, one reason why they won't generate exactly the same code is that a
floating point constant in C is type double, whereas a floating point
constant in Fortran (without D0 appended to it) is a REAL (i.e., type
float).
That said, the differences you notice are simply due to the fact that
g77 isn't very good at separating host and target arithmetic (to put it
mildly).
Before I dig into the f77 sources, I was hoping this might trigger
someone who knows f77 to fix it for me. :)
No, on the contrary, be my guest :-)
In the mean time, I'll add this example to the "Known Bugs" list.
Thanks,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)