Re: g++ vs g77 ?


Subject: Re: g++ vs g77 ?
From: Jim Cole (greyleaf@yggdrasill.net)
Date: Fri Feb 25 2000 - 20:59:58 MST


Hi - It has been quite a while since I have done any FORTRAN, g77 or
otherwise, so I may be a bit out of my depth here ;) But a few things
to consider. While gcc is the core component for both g++ and g77, I
believe g77 has its own frontend or backend or some such that is
different. It has its own library for certain functions, or at least
it used to. FORTRAN and C/C++ store multi-dimensional arrays in
different ways. C++ is a much more rich and complex language, so it
probably has at least some amount of extra baggage that gets dragged
along regardless of what you are actually coding. Finally, FORTRAN has
always been *the* language for intense mathematical and scientific
computation. If it couldn't outperform equivalent C++ in this arena
I would be somewhat surprised (and suspicious of the compiler).

Jim

Vanja Bucic's bits of Fri, 25 Feb 2000 translated to:

>Hi,
>I have two programs that were written identically, with same functions,
>structure, variables itd. One was written in Fortran, and one in C++.
>Programs are quite short with only 3-4 functions being called several
>million times. When I compile and run them, the C++ version gets
>executed in 12.3 seconds, while fortran version finishes in 8.3 seconds.
>I was expecting to get very close results, I mean it is the same
>compiler and same machine. I used nothing C++ or fortran specific, just
>'for' loops, basic math(*, / +), and arrays.
>Where does the difference come from? How can I get close results?
>
>compiler : egcs 1.1.2
>machine: PowerPC G3 233
>



This archive was generated by hypermail 2a24 : Wed Mar 01 2000 - 00:07:02 MST