[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

g77 -> gfortran transition and AMD64 g77 bugs



Dear list,

[CC'ed to debian-science since I imagine that's where most of the
FORTRAN users are.  Please follow up to -devel.]

With the latest g++ ABI transition soon to be finished, I have to ask
whether a similar transition is planned for g77 to gfortran.  It appears
that the ABI of code generated with the two compilers is different.
Both compilers have a -ff2c / -fno-f2c option pair controlling whether
the code is ABI-compatible to that generated by f2c.  But in g77, the
default is -ff2c, while it is the opposite for gfortran.

>From the info manual for gfortran:

     _Caution:_ It is not a good idea to mix Fortran code compiled with
     `-ff2c' with code compiled with the default `-fno-f2c' calling
     conventions as, calling `COMPLEX' or default `REAL' functions
     between program parts which were compiled with different calling
     conventions will break at execution time.

     _Caution:_ This will break code which passes intrinsic functions
     of type default `REAL' or `COMPLEX' as actual arguments, as the
     library implementations use the `-fno-f2c' calling conventions.

Gfortran claims not to be completely ready for use as a g77 replacement
yet (and someone who has attempted to compile Cernlib with it reports a
large number of problems yet).  But eventually that day will come... we
should have some transition plan in mind by then.


In addition, (speaking as Cernlib Debian maintainer) I have a specific
question about g77 in Debian.  There are two g77 bugs that can cause
significant problems in mixed FORTRAN/C applications on AMD64 machines:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15397
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17541

Could someone tell me whether it is likely that both will eventually be
fixed in the g77-3.4 available in Debian?  If so, in what timeframe?
The latter is fixed upstream, but the former is apparently unfixed.  It
can apparently be worked around with the -fno-f2c flag.  But this (from
the first half of my email) will be incompatible with any current
FORTRAN libraries in Debian.

regards,

-- 
Kevin B. McCarty <kmccarty@princeton.edu>   Physics Department
WWW: http://www.princeton.edu/~kmccarty/    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544



Reply to: