Consider the following Fortran code, which uses various extensions (including some to Fortran 90):
SUBROUTINE X(A) CHARACTER*(*) A COMPLEX CFUNC INTEGER*2 CLOCKS(200) INTEGER IFUNC CALL SYSTEM_CLOCK (CLOCKS (IFUNC (CFUNC ('('//A//')'))))
The above poses the following challenges to any Fortran compiler
that uses run-time interfaces, and a run-time library, roughly similar
to those used by
SYSTEM_CLOCKexpects to set an
INTEGER*4variable via its
COUNTargument, the compiler must make available to it a temporary variable of that type.
SYSTEM_CLOCKlibrary routine returns, the compiler must ensure that the temporary variable it wrote is copied into the appropriate element of the
CLOCKSarray. (This assumes the compiler doesn't just reject the code, which it should if it is compiling under some kind of a "strict" option.)
CLOCKSarray, (putting aside the fact that the index, in this particular case, need not be computed until after the
SYSTEM_CLOCKlibrary routine returns), the compiler must ensure that the
IFUNCfunction is called.
That requires evaluating its argument,
which requires, for
-ff2c is in force),
reserving a temporary variable of type
for use as a repository for the return value
being computed by
CFUNC, is argument must be evaluated, which requires allocating, at run time, a temporary large enough to hold the result of the concatenation, as well as actually performing the concatenation.
CFUNCshould, ideally, be deallocated (or, at least, left to the GBE to dispose of, as it sees fit) as soon as
CFUNCreturns, which means before
IFUNCis called (as it might need a lot of dynamically allocated memory).
g77 currently doesn't support all of the above,
but, so that it might someday, it has evolved to handle
at least some of the above requirements.
Meeting the above requirements is made more challenging by conforming to the requirements of the GBEL/GBE combination.