Much of this work should be put off until after g77 has all the features necessary for its widespread acceptance as a useful F77 compiler. However, perhaps this work can be done in parallel during the feature-adding work.
libg2cand #include'ing the resulting file in f2c+gcc—that is, inline all run-time-library functions that are at all worth inlining. (Some of this has already been done, such as for integral exponentiation.)
VAR_DECL, make `CHAR_VAR', not a temporary, be the receiver for `CHAR_FUNC'. (This is now done for
libgccso no special linking is required to link Fortran programs using standard language features. This library would speed up lots of things, from I/O (using precompiled formats, doing just one, or, at most, very few, calls for arrays or array sections, and so on) to general computing (array/section implementations of various intrinsics, implementation of commonly performed loops that aren't likely to be optimally compiled otherwise, etc.).
Among the important things the library would do are:
libg2cwould be moved at least to the g77 compile phase, if not to finer grains (such as choosing how list-directed I/O formatting is done by default at
OPENtime, for preconnected units via options or even statements in the main program unit, maybe even on a per-I/O basis with appropriate pragma-like devices).
COMPLEXfunctions return their values in the way gcc would if they were declared
__complex__ float, rather than using the mechanism currently used by
CHARACTERfunctions (whereby the functions are compiled as returning void and their first arg is a pointer to where to store the result). (Don't append underscores to external names for
COMPLEXfunctions in some cases once g77 uses gcc rather than f2c calling conventions.)
doiterreferences where possible. For example, `CALL FOO(I)' cannot modify `I' if within a
DOloop that uses `I' as the iteration variable, and the back end might find that info useful in determining whether it needs to read `I' back into a register after the call. (It normally has to do that, unless it knows `FOO' never modifies its passed-by-reference argument, which is rarely the case for Fortran-77 code.)