This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: autoconf, inter-language linking


On Friday 10 October 2003 5:03 am, Steven G. Johnson wrote:
> Dear g95/gfortran folks [which mailing list should I use?],

fortran@gcc.gnu.org

The sourceforge project was only ever meant as a temporary solution. Now 
that we have webpages and a mailing list on the gcc servers the sourceforge 
project will probaably be abandoned.

> Since my initial Fortran 9x patches recently got committed to autoconf
> CVS and will be in the next autoconf release, I thought I'd take a look
> and see what you guys were up to.
>
> I noticed that you wrote on your web page:
>
> 	"In order to efficiently implement the passing of array sections,
> binary compatibility to Fortran 77 had to be abandoned. If the user
> wishes to link his sources with old Fortran 77 codes, the command line
> option -fg77-calls changes back to the old calling convention used by
> G77."

This is out of date. -fg77-calls is now the default (and only) option. 

> I'm wondering what the technical meaning/consequences of this are,
> especially for inter-language linking (ability to mix languages where
> convenient is one of my main reasons for using autoconf, and freedom of
> language choice is something that I think should be encouraged across the
> gcc front-ends).  A new calling convention will mean lots of headaches,
> as I'm sure you're aware, e.g. in sharing numerical libraries between
> languages & compilers.  (I tried googling and found some old messages
> from g95-develop, but they weren't very clear and were maybe out of
> date.)
>
> Have you looked at the way other modern Fortran compilers work, e.g. IBM
> xlf/xlf90/..., SGI f77/f90/..., HP/Compaq/DEC fort, Intel ifc, etcetera?
> I've never noticed any particular problems in interlanguage calls with
> those compilers, and have happily passed arrays back and forth between
> e.g. f90 and C using the usual Fortran-77 technique (passing pointers via
> appropriately mangled subroutine identifiers).
>
> This makes me concerned that you've adopted a new calling convention when
> it's not really necessary.  "Premature optimization is the root of all
> evil."
>

Well, it was actually easier to initially implement a whole new calling 
convention. The g77 compatability stuff came later. procedures which use 
new language features (ie those not in f77, eg. assumed shape arrays, 
pointers) need a new calling convention.

AFAIK this is the same strategy used by comercial compilers. I suspect if 
you tried mixing f9x code between different commercial compilers it 
wouldn't work.

> (Note that if, e.g. passing discontiguous array sections requires a copy
> for all other compilers, users will tend to realize this and avoid it in
> performance-sensitive circumstances anyway.  One can also assume that
> those vendors were fairly aggressive about performance where it counts.)
>
> Steven
>
> PS. Is 'gfortran' planned to be the eventual name of the executable, or
> is it too early to say?  If you know, I should update autoconf's macros
> to look for this name.

Yes, gfortran is the official name. All uses of the g95 name should already 
have been removed, although I may have missed a few.

Paul


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