This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: F77 FP screwup (i386 cross-compiler -> vax)


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]