Re: Need a FORTRAN compiler for Win7 (or XP)



Alois Steindl <Alois.Steindl@xxxxxxxxxxxx> wrote:
Am 17.08.2011 14:33, schrieb Nomen Nescio:

Good compilers generate object code. gcc generates C and then generates
code from that. That is a good way to deal with having to support many
languages, but it's far from optimal from a clean sheet of paper point of
view. It's slow and generates subpar code compared to other, long
established methods.

are you sure that you talk about gcc?
(As far as I remember, f2c did translate fortran 77 to C;
also the NAG F90 compiler behaved that way.)

gfortran uses the back end of the gcc C compiler.

The usual way of writing a compiler is to translate the input
source into an intermediate form representing the operations
that need to be done, (optionally) optimize that code, then
generate the code for the target machine. Those steps are,
roughly, called the front end, middle end, and back end.

Now, since gfortran is based on a C back end there might be
some operations that work differently. One recently in discussion
is that C requires static data to be initialized to zero.
gfortran then, unless one specifically put in a special case,
would also naturally do that. I have also noticed that the
gfortran generated code for the ENTRY statement uses little
routines that then call the actual function (C notation) that
has all the possible arguments. (This can be seen when using
the debugger, and setting breakpoints on an entry point.)
That may or may not be a side effect of the C back end.

Using a common back end allows improvements to apply to all
languages, and saves work. The intermediate code usually uses
mostly language independent operations, though there may be
some hints as to the original source language left.

-- glen

.



Relevant Pages

  • Re: Need a FORTRAN compiler for Win7 (or XP)
    ... (snip regarding gfortran as generating C code) ... f2c did translate fortran 77 to C; ... several other languages. ... I was trying to suggest that gfortran didn't translate to C, ...
    (comp.lang.fortran)
  • Re: Mixing Languages with gfortran and Visual C++
    ... steve wrote: ... c++ and gfortran during execution. ... from the two languages, but even that has more gotchas than most ...
    (comp.lang.fortran)
  • Re: Why C?
    ... > C programs can be as fast as a compiler can make them, ... > programs in other languages. ... > lurking bugs and inappropriate data types in any existing C code. ... With only a different declaration syntax it would be much ...
    (comp.os.linux.development.apps)
  • Re: Why do folks implement statically typed languages?
    ... The languages discussed are extremes. ... It allows the compiler to prove that your data-manipulations are ... an IDE for a dynamically-typed language can ... to IDEs in dynamically-typed languages. ...
    (comp.lang.scheme)
  • Re: arithmetic on a void * pointer
    ... Using norms from the realm of natural languages isn't necessarily ... the sizeof a void pointer is the sizeof the smallest unit of memory. ... It would be nice to think, however, that both compiler writers *and* ... here the Register. ...
    (comp.lang.c)