Using and Porting GNU Fortran (original) (raw)
6 News About GNU Fortran
GCC 3.4.x is the last edition of GCC to contain g77 - from GCC 3.5 onwards, use gfortran
Changes made to recent versions of GNU Fortran are listed below, with the most recent version first.
The changes are generally listed in order:
- Code-generation and run-time-library bug-fixes
- Compiler and run-time-library crashes involving valid code that have been fixed
- New features
- Fixes and enhancements to existing features
- New diagnostics
- Internal improvements
- Miscellany
This order is not strict—for example, some items involve a combination of these elements.
Note that two variants of g77 are tracked below. The egcs variant is described vis-a-vis previous versions of egcs and/or an official FSF version, as appropriate. Note that all such variants are obsolete as of July 1999 - the information is retained here only for its historical value.
Therefore, egcs versions sometimes have multiple listings to help clarify how they differ from other versions, though this can make getting a complete picture of what a particular egcs version contains somewhat more difficult.
For information on bugs in the GCC-3.4.3 version of g77, see Known Bugs In GNU Fortran.
The following information was last updated on 2004-06-17:
In GCC 3.4 versus GCC 3.3:
- Problem Reports fixed (in chronological order of submission):
8485
g77 doesn't accept INTEGER*8 constant in PARAMETER multiplication.11918
(libf2c) isatty does not call f_init.12317
Incorrect documentation for Fortran debugging features. - Roger Sayle (roger@eyesopen.com) fixed the remaining problems with regard to the support of INTEGER*8, INTEGER*2 and INTEGER*1 as a fallout of fixing PR 8485.
In GCC 3.3 versus GCC 3.2:
- Problem Reports fixed (in chronological order of submission):
1832
-list directed i/o overflow hangs, -fbounds-check doesn't detect3924
g77 generates code which is rejected by GAS if COFF debugging info is requested6286
Broken links on web pages6367
(libf2c) multiple repeat counts confuse namelist read into array6491
Logical operations error on logicals when using -fugly-logint6742
Generation of C++ Prototype for FORTRAN and extern "C"7113
Failure of g77.f-torture/execute/f90-intrinsic-bit.f -Os on irix6.57236
(libf2c) OPEN(...,RECL=nnn,...) without ACCESS='DIRECT' should assume a direct access file7278
g77 "bug"; the executable misbehave (use of options -O2 -fno-automatic gave wrong results)7384
(libf2c) DATE_AND_TIME milliseconds field inactive on Windows7388
Incorrect output with 0-based array of characters8587
Double complex zero ** double precision number -> NaN instead of zero9038
-ffixed-line-length-none -x f77-cpp-input gives: Warning: unknown register name line-length-none9263
ICE caused by invalid PARAMETER in implied DO loop10197
Direct access files not unformatted by default10726
Documentation for function IDATE Intrinsic (UNIX) is wrong [fixed in 3.3.1]. - Richard Henderson (rth@redhat.com) analyzed and improved the handling of (no-)aliasing information for dummy arguments and improved the optimization of induction variables in unrolled loops.
In GCC 3.2 versus GCC 3.1:
- Problem Reports fixed (in chronological order of submission):
7681
ICE in compensate_edge, at reg-stack.c:25918308
gcc-3.x does not compile files with suffix .r (RATFOR) [Fixed in 3.2.1]9258
[3.2/3.3/3.4 regression] ICE in compensate_edge, at reg-stack.c:2589
In GCC 3.1 (formerly known as g77-0.5.27) versus GCC 3.0:
- Problem Reports fixed (in chronological order of submission):
947
Data statement initialization with subscript of kind INTEGER*23743
Reference to intrinsic `ISHFT' invalid3807
Function BESJN(integer,double) problems3957
g77 -pipe -xf77-cpp-input sends output to stdout4279
g77 -h" gives bogus output4730
ICE on valid input using CALL EXIT(%VAL(...))4752
g77 -v -c -xf77-version /dev/null -xnone causes ice4885
BACKSPACE example that doesn't work as of gcc/g77-3.0.x5122
g77 rejects accepted use of INTEGER*2 as type of DATA statement loop index5397
ICE on compiling source with 540 000 000 REAL array5473
ICE on BESJN(integer*8,real)5837
bug in loop unrolling6106
sparc-sun-solaris2.7 gcc-3.1 extra g77 testsuite failures w/-m646138
Incorrect acces of integer*1 variables on PA6304
Failure of LAPACK test dtest on irix6.5 with -mabi=64 -O2 - g77 now has its man page generated from the texinfo documentation, to guarantee that it remains up to date.
- g77 used to reject the following program on 32-bit targets:
PROGRAM PROG
DIMENSION A(140 000 000)
END
with the message:
prog.f: In program prog': prog.f:2: DIMENSION A(140 000 000) ^ Array a' at (^) is too large to handle
because 140 000 000 REALs is larger than the largest bit-extent that can be expressed in 32 bits. However, bit-sizes never play a role after offsets have been converted to byte addresses. Therefore this check has been removed, and the limit is now 2 Gbyte of memory (around 530 000 000 REALs). Note: On GNU/Linux systems one has to compile and link programs that occupy more than 1 Gbyte statically, i.e. g77 -static ....
- Based on work done by Juergen Pfeifer (juergen.pfeifer@gmx.net) libf2c is now a shared library. One can still link in all objects with the program by specifying the -static option.
- Robert Anderson (rwa@alumni.princeton.edu) thought up a two line change that enables g77 to compile such code as:
SUBROUTINE SUB(A, N)
DIMENSION N(2)
DIMENSION A(N(1),N(2))
A(1,1) = 1.
END
Note the use of array elements in the bounds of the adjustable array A.
- George Helffrich (george@geo.titech.ac.jp) implemented a change in substring index checking (when specifying -fbounds-check) that permits the use of zero length substrings of the form
string(1:0). - Based on code developed by Pedro Vazquez (vazquez@penelope.iqm.unicamp.br), the
libf2clibrary is now able to read and write files larger than 2 Gbyte on 32-bit target machines, if the operating system supports this.
In 0.5.26, GCC 3.0 versus GCC 2.95:
- When a REWIND was issued after a WRITE statement on an unformatted file, the implicit truncation was performed by copying the truncated file to /tmp and copying the result back. This has been fixed by using the
ftruncateOS function. Thanks go to the GAMESS developers for bringing this to our attention. - Using options -g, -ggdb or -gdwarf[-2] (where appropriate for your target) now also enables debugging information for COMMON BLOCK and EQUIVALENCE items to be emitted. Thanks go to Andrew Vaught (andy@xena.eas.asu.edu) and George Helffrich (george@geology.bristol.ac.uk) for fixing this longstanding problem.
- It is not necessary anymore to use the option -femulate-complexto compile Fortran code using COMPLEX arithmetic, even on 64-bit machines (like the Alpha). This will improve code generation.
- INTRINSIC arithmetic functions are now treated as routines that do not depend on anything but their argument(s). This enables further instruction scheduling, because it is known that they cannot read or modify arbitrary locations.
- Upgrade to
libf2cas of 2000-12-05.
This fixes a bug where a namelist containing initialization of LOGICAL items and a variable starting with T or F would be read incorrectly. - The
TtyNamintrinsics now set Name to all spaces (at run time) if the system has nottynameimplementation available. - Upgrade to
libf2cas of 1999-06-28.
This fixes a bug whereby input to aNAMELISTread involving a repeat count, such as K(5)=10*3, was not properly handled bylibf2c. The first item was written to K(5), but the remaining nine were written elsewhere (still within the array), not necessarily starting at K(6).
In 0.5.25, GCC 2.95 (EGCS 1.2) versus EGCS 1.1.2:
- g77 no longer generates bad code for assignments, or other conversions, of
REALorCOMPLEXconstant expressions to typeINTEGER(KIND=2)(often referred to asINTEGER*8).
For example, INTEGER*8 J; J = 4E10 now works as documented. - g77 no longer truncates
INTEGER(KIND=2)(usuallyINTEGER*8) subscript expressions when evaluating array references on systems with pointers widers thanINTEGER(KIND=1)(such as Alphas). - g77 no longer generates bad code for an assignment to a
COMPLEXvariable or array that partially overlaps one or more of the sources of the same assignment (a very rare construction). It now assigns through a temporary, in cases where such partial overlap is deemed possible. libg2c(libf2c) no longer loses track of the file being worked on during aBACKSPACEoperation.libg2c(libf2c) fixes a bug whereby input to aNAMELISTread involving a repeat count, such as K(5)=10*3, was not properly handled bylibf2c. The first item was written to K(5), but the remaining nine were written elsewhere (still within the array), not necessarily starting at K(6).- Automatic arrays now seem to be working on HP-UX systems.
- The
Dateintrinsic now returns the correct result on big-endian systems. - Fix g77 so it no longer crashes when compiling I/O statements using keywords that define
INTEGERvalues, such as IOSTAT=j, where j is other than defaultINTEGER(such asINTEGER*2). Instead, it issues a diagnostic. - Fix g77 so it properly handles DATA A/rpt*val/, where rpt is not default
INTEGER, such asINTEGER*2, instead of producing a spurious diagnostic. Also fix DATA (A(I),I=1,N), where N is not defaultINTEGERto work instead of crashing g77. - The -ax option is now obeyed when compiling Fortran programs. (It is passed to the f771 driver.)
- The new -fbounds-check option causes g77 to compile run-time bounds checks of array subscripts, as well as of substring start and end points.
libg2cnow supports building as multilibbed library, which provides better support for systems that require options such as -mieeeto work properly.- Source file names with the suffixes .FOR and .FPPnow are recognized by g77as if they ended in .for and .fpp, respectively.
- The order of arguments to the subroutine forms of the
CTime,DTime,ETime, andTtyNamintrinsics has been swapped. The argument serving as the returned value for the corresponding function forms now is the second argument, making these consistent with the other subroutine forms oflibU77intrinsics. - g77 now warns about a reference to an intrinsic that has an interface that is not Year 2000 (Y2K) compliant. Also,
libg2chas been changed to increase the likelihood of catching references to the implementations of these intrinsics using theEXTERNALmechanism (which would avoid the new warnings).
See Year 2000 (Y2K) Problems, for more information. - g77 now warns about a reference to a function when the corresponding subsequent function program unit disagrees with the reference concerning the type of the function.
- -fno-emulate-complex is now the default option. This should result in improved performance of code that uses the
COMPLEXdata type. - The -malign-double option now reliably aligns all double-precision variables and arrays on Intel x86 targets.
- Even without the -malign-double option,g77 reliably aligns local double-precision variables that are not in
EQUIVALENCEareas and notSAVE'd. - g77 now open-codes (“inlines”) division of
COMPLEXoperands instead of generating a run-time call to thelibf2croutinesc_divorz_div, unless the -Os option is specified. - g77 no longer generates code to maintain
errno, a C-language concept, when performing operations such as theSqRtintrinsic. - g77 developers can temporarily use the -fflatten-arrays option to compare how the compiler handles code generation using C-like constructs as compared to the Fortran-like method constructs normally used.
- A substantial portion of the g77 front end's code-generation component was rewritten. It now generates code using facilities more robustly supported by the gcc back end. One effect of this rewrite is that some codes no longer produce a spurious “label lab used before containing binding contour” message.
- Support for the -fugly option has been removed.
- Improve documentation and indexing, including information on Year 2000 (Y2K) compliance, and providing more information on internals of the front end.
- Upgrade to
libf2cas of 1999-05-10.
In 0.5.24 versus 0.5.23:
There is no g77 version 0.5.24 at this time, or planned. 0.5.24 is the version number designated for bug fixes and, perhaps, some new features added, to 0.5.23. Version 0.5.23 requires gcc 2.8.1, as 0.5.24 was planned to require.
Due to EGCS becoming GCC(which is now an acronym for “GNU Compiler Collection”), and EGCS 1.2 becoming officially designated GCC 2.95, there seems to be no need for an actual 0.5.24 release.
To reduce the confusion already resulting from use of 0.5.24 to designate g77 versions within EGCS versions 1.0 and 1.1, as well as in versions of g77 documentation and notices during that period, “mainline” g77 version numbering resumes at 0.5.25 with GCC 2.95 (EGCS 1.2), skipping over 0.5.24 as a placeholder version number.
To repeat, there is no g77 0.5.24, but there is now a 0.5.25. Please remain calm and return to your keypunch units.
In EGCS 1.1.2 versus EGCS 1.1.1:
- Fix the
IDateintrinsic (VXT) (inlibg2c) so the returned year is in the documented, non-Y2K-compliant range of 0-99, instead of being returned as 100 in the year 2000.
See IDate Intrinsic (VXT), for more information. - Fix the
Date_and_Timeintrinsic (inlibg2c) to return the milliseconds value properly in Values(8). - Fix the
LStatintrinsic (inlibg2c) to return device-ID information properly in SArray(7). - Improve documentation.
In EGCS 1.1.1 versus EGCS 1.1:
- Fix
libg2cso it performs an implicitENDFILEoperation (as appropriate) whenever aREWINDis done.
(This bug was introduced in 0.5.23 andegcs1.1 ing77's version oflibf2c.) - Fix
libg2cso it no longer crashes with a spurious diagnostic upon doing any I/O following a direct formatted write.
(This bug was introduced in 0.5.23 andegcs1.1 ing77's version oflibf2c.) - Fix g77 so it no longer crashes compiling references to the
Randintrinsic on some systems. - Fix g77 portion of installation process so it works better on some systems (those with shells requiring else true clauses on
ifconstructs for the completion code to be set properly).
In EGCS 1.1 versus EGCS 1.0.3:
- Fix bugs in the
libU77intrinsicHostNmthat wrote one byte beyond the end of itsCHARACTERargument, and in thelibU77intrinsicsGMTimeandLTimethat overwrote their arguments. - Assumed arrays with negative bounds (such as REAL A(-1:*)) no longer elicit spurious diagnostics from g77, even on systems with pointers having different sizes than integers.
This bug is not known to have existed in any recent version of gcc. It was introduced in an early release ofegcs. - Valid combinations of
EXTERNAL, passing that external as a dummy argument without explicitly giving it a type, and, in a subsequent program unit, referencing that external as an external function with a different type no longer crash g77. CASE DEFAULTno longer crashes g77.- The -Wunused option no longer issues a spurious warning about the “master” procedure generated byg77 for procedures containing
ENTRYstatements. - Support FORMAT(I<expr>) when expr is a compile-time constant
INTEGERexpression. - Fix g77 -g option so procedures that use
ENTRYcan be stepped through, line by line, in gdb. - Allow any
REALargument to intrinsicsSecondandCPU_Time. - Use
tempnam, if available, to open scratch files (as in OPEN(STATUS='SCRATCH')) so that theTMPDIRenvironment variable, if present, is used. - g77's version of
libf2cseparates out the setting of global state (such as command-line arguments and signal handling) from main.o into distinct, new library archive members.
This should make it easier to write portable applications that have their own (non-Fortran)main()routine properly set up thelibf2cenvironment, even whenlibf2c(nowlibg2c) is a shared library. - g77 no longer installs the f77 command and f77.1 man page in the /usr or /usr/local hierarchy, even if the f77-install-ok file exists in the source or build directory. See the installation documentation for more information.
- g77 no longer installs the libf2c.a library and f2c.h include file in the /usr or /usr/local hierarchy, even if the f2c-install-ok or f2c-exists-ok files exist in the source or build directory. See the installation documentation for more information.
- The libf2c.a library produced by g77 has been renamed to libg2c.a. It is installed only in the gcc “private” directory hierarchy, gcc-lib. This allows system administrators and users to choose which version of the
libf2clibrary fromnetlibthey wish to use on a case-by-case basis. See the installation documentation for more information. - The f2c.h include (header) file produced by g77has been renamed to g2c.h. It is installed only in the gcc “private” directory hierarchy, gcc-lib. This allows system administrators and users to choose which version of the include file from
netlibthey wish to use on a case-by-case basis. See the installation documentation for more information. - The g77 command now expects the run-time library to be named
libg2c.ainstead oflibf2c.a, to ensure that a version other than the one built and installed as part of the same g77 version is picked up. - During the configuration and build process,g77 creates subdirectories it needs only as it needs them. Other cleaning up of the configuration and build process has been performed as well.
install-infonow used to update the directory of Info documentation to contain an entry for g77(during installation).- Some diagnostics have been changed from warnings to errors, to prevent inadvertent use of the resulting, probably buggy, programs. These mostly include diagnostics about use of unsupported features in the
OPEN,INQUIRE,READ, andWRITEstatements, and about truncations of various sorts of constants. - Improve compilation of
FORMATexpressions so that a null byte is appended to the last operand if it is a constant. This provides a cleaner run-time diagnostic as provided bylibf2cfor statements like PRINT '(I1', 42. - Improve documentation and indexing.
- The upgrade to
libf2cas of 1998-06-18 should fix a variety of problems, including those involving some uses of theTformat specifier, and perhaps some build (porting) problems as well.
In EGCS 1.1 versus g77 0.5.23:
- Fix a code-generation bug that afflicted Intel x86 targets when -O2 was specified compiling, for example, an old version of the
DNRM2routine.
The x87 coprocessor stack was being mismanaged in cases involving assignedGOTOandASSIGN. - g77 no longer produces incorrect code and initial values for
EQUIVALENCEandCOMMONaggregates that, due to “unnatural” ordering of members vis-a-vis their types, require initial padding. - Fix g77 crash compiling code containing the construct CMPLX(0.) or similar.
- g77 no longer crashes when compiling code containing specification statements such asINTEGER(KIND=7) PTR.
- g77 no longer crashes when compiling code such as J = SIGNAL(1, 2).
- g77 now treats %LOC(expr) andLOC(expr) as “ordinary” expressions when they are used as arguments in procedure calls. This change applies only to global (filewide) analysis, making it consistent with how g77 actually generates code for these cases.
Previously, g77 treated these expressions as denoting special “pointer” arguments for the purposes of filewide analysis. - Fix g77 crash (or apparently infinite run-time) when compiling certain complicated expressions involving
COMPLEXarithmetic (especially multiplication). - Align static double-precision variables and arrays on Intel x86 targets regardless of whether -malign-double is specified.
Generally, this affects only local variables and arrays having theSAVEattribute or given initial values viaDATA. - The g77 driver now ensures that -lg2cis specified in the link phase prior to any occurrence of -lm. This prevents accidentally linking to a routine in the SunOS4 -lm library when the generated code wants to link to the one in
libf2c(libg2c). - g77 emits more debugging information when-g is used.
This new information allows, for example,which __g77_length_a to be used in gdbto determine the type of the phantom length argument supplied withCHARACTERvariables.
This information pertains to internally-generated type, variable, and other information, not to the longstanding deficiencies vis-a-visCOMMONandEQUIVALENCE. - The F90
Date_and_Timeintrinsic now is supported. - The F90
System_Clockintrinsic allows the optional arguments (except for theCountargument) to be omitted. - Upgrade to
libf2cas of 1998-06-18. - Improve documentation and indexing.
In 0.5.23 versus 0.5.22:
- This release contains several regressions against version 0.5.22 of g77, due to using the “vanilla” gcc back end instead of patching it to fix a few bugs and improve performance in a few cases.
Features that have been dropped from this version of g77 due to their being implemented via g77-specific patches to the gccback end in previous releases include:- Support for
__restrict__keyword, the options -fargument-alias, -fargument-noalias, and -fargument-noalias-global, and the corresponding alias-analysis code.
(egcshas the alias-analysis code, but not the__restrict__keyword.egcsg77 users benefit from the alias-analysis code despite the lack of the__restrict__keyword, which is a C-language construct.) - Support for the GNU compiler options-fmove-all-movables,-freduce-all-givs, and -frerun-loop-opt.
(egcssupports these options. g77 users ofegcsbenefit from them even if they are not explicitly specified, because the defaults are optimized for g77 users.) - Support for the -W option warning about integer division by zero.
- The Intel x86-specific option -malign-doubleapplying to stack-allocated data as well as statically-allocate data.
Note that the gcc/f/gbe/ subdirectory has been removed from this distribution as a result of g77 no longer including patches for the gcc back end.
- Support for
- Fix bugs in the
libU77intrinsicHostNmthat wrote one byte beyond the end of itsCHARACTERargument, and in thelibU77intrinsicsGMTimeandLTimethat overwrote their arguments. - Support gcc version 2.8, and remove support for prior versions of gcc.
- Remove support for the --driver option, as g77 now does all the driving, just like gcc.
CASE DEFAULTno longer crashes g77.- Valid combinations of
EXTERNAL, passing that external as a dummy argument without explicitly giving it a type, and, in a subsequent program unit, referencing that external as an external function with a different type no longer crash g77. - g77 no longer installs the f77 command and f77.1 man page in the /usr or /usr/local hierarchy, even if the f77-install-ok file exists in the source or build directory. See the installation documentation for more information.
- g77 no longer installs the libf2c.a library and f2c.h include file in the /usr or /usr/local hierarchy, even if the f2c-install-ok or f2c-exists-ok files exist in the source or build directory. See the installation documentation for more information.
- The libf2c.a library produced by g77 has been renamed to libg2c.a. It is installed only in the gcc “private” directory hierarchy, gcc-lib. This allows system administrators and users to choose which version of the
libf2clibrary fromnetlibthey wish to use on a case-by-case basis. See the installation documentation for more information. - The f2c.h include (header) file produced by g77has been renamed to g2c.h. It is installed only in the gcc “private” directory hierarchy, gcc-lib. This allows system administrators and users to choose which version of the include file from
netlibthey wish to use on a case-by-case basis. See the installation documentation for more information. - The g77 command now expects the run-time library to be named
libg2c.ainstead oflibf2c.a, to ensure that a version other than the one built and installed as part of the same g77 version is picked up. - The -Wunused option no longer issues a spurious warning about the “master” procedure generated byg77 for procedures containing
ENTRYstatements. - g77's version of
libf2cseparates out the setting of global state (such as command-line arguments and signal handling) from main.o into distinct, new library archive members.
This should make it easier to write portable applications that have their own (non-Fortran)main()routine properly set up thelibf2cenvironment, even whenlibf2c(nowlibg2c) is a shared library. - During the configuration and build process,g77 creates subdirectories it needs only as it needs them, thus avoiding unnecessary creation of, for example,stage1/f/runtime when doing a non-bootstrap build. Other cleaning up of the configuration and build process has been performed as well.
install-infonow used to update the directory of Info documentation to contain an entry for g77(during installation).- Some diagnostics have been changed from warnings to errors, to prevent inadvertent use of the resulting, probably buggy, programs. These mostly include diagnostics about use of unsupported features in the
OPEN,INQUIRE,READ, andWRITEstatements, and about truncations of various sorts of constants. - Improve documentation and indexing.
- Upgrade to
libf2cas of 1998-04-20.
This should fix a variety of problems, including those involving some uses of theTformat specifier, and perhaps some build (porting) problems as well.
In 0.5.22 versus 0.5.21:
- Fix code generation for iterative
DOloops that have one or more references to the iteration variable, or to aliases of it, in their control expressions. For example, DO 10 J=2,J now is compiled correctly. - Fix a code-generation bug that afflicted Intel x86 targets when -O2 was specified compiling, for example, an old version of the
DNRM2routine.
The x87 coprocessor stack was being mismanaged in cases involving assignedGOTOandASSIGN. - Fix
DTimeintrinsic so as not to truncate results to integer values (on some systems). - Fix
Signalintrinsic so it offers portable support for 64-bit systems (such as Digital Alphas running GNU/Linux). - Fix run-time crash involving
NAMELISTon 64-bit machines such as Alphas. - Fix g77 version of
libf2cso it no longer produces a spurious I/O recursion diagnostic at run time when an I/O operation (such as READ *,I) is interrupted in a manner that causes the program to be terminated via thef_exitroutine (such as via C-c). - Fix g77 crash triggered by
CASEstatement with an omitted lower or upper bound. - Fix g77 crash compiling references to
CPU_Timeintrinsic. - Fix g77 crash (or apparently infinite run-time) when compiling certain complicated expressions involving
COMPLEXarithmetic (especially multiplication). - Fix g77 crash on statements such asPRINT *, (REAL(Z(I)),I=1,2), whereZ is
DOUBLE COMPLEX. - Fix a g++ crash.
- Support FORMAT(I<expr>) when expr is a compile-time constant
INTEGERexpression. - Fix g77 -g option so procedures that use
ENTRYcan be stepped through, line by line, in gdb. - Fix a profiling-related bug in gcc back end for Intel x86 architecture.
- Allow any
REALargument to intrinsicsSecondandCPU_Time. - Allow any numeric argument to intrinsics
Int2andInt8. - Use
tempnam, if available, to open scratch files (as in OPEN(STATUS='SCRATCH')) so that theTMPDIRenvironment variable, if present, is used. - Rename the gcc keyword
restrictto__restrict__, to avoid rejecting valid, existing, C programs. Support forrestrictis now more like support forcomplex. - Fix -fpedantic to not reject procedure invocations such as I=J() and CALL FOO().
- Fix -fugly-comma to affect invocations of only external procedures. Restore rejection of gratuitous trailing omitted arguments to intrinsics, as in I=MAX(3,4,,).
- Fix compiler so it accepts -fgnu-intrinsics-* and-fbadu77-intrinsics-* options.
- Improve diagnostic messages from
libf2cso it is more likely that the printing of the active format string is limited to the string, with no trailing garbage being printed.
(Unlike f2c, g77 did not append a null byte to its compiled form of every format string specified via aFORMATstatement. However, f2c would exhibit the problem anyway for a statement like PRINT '(I)garbage', 1by printing (I)garbage as the format string.) - Improve compilation of
FORMATexpressions so that a null byte is appended to the last operand if it is a constant. This provides a cleaner run-time diagnostic as provided bylibf2cfor statements like PRINT '(I1', 42. - Fix various crashes involving code with diagnosed errors.
- Fix cross-compilation bug when configuring
libf2c. - Improve diagnostics.
- Improve documentation and indexing.
- Upgrade to
libf2cas of 1997-09-23. This fixes a formatted-I/O bug that afflicted 64-bit systems with 32-bit integers (such as Digital Alpha running GNU/Linux).
In EGCS 1.0.2 versus EGCS 1.0.1:
- Fix g77 crash triggered by
CASEstatement with an omitted lower or upper bound. - Fix g77 crash on statements such asPRINT *, (REAL(Z(I)),I=1,2), whereZ is
DOUBLE COMPLEX. - Fix -fPIC (such as compiling for ELF targets) on the Intel x86 architecture target so invalid assembler code is no longer produced.
- Fix -fpedantic to not reject procedure invocations such as I=J() and CALL FOO().
- Fix -fugly-comma to affect invocations of only external procedures. Restore rejection of gratuitous trailing omitted arguments to intrinsics, as in I=MAX(3,4,,).
- Fix compiler so it accepts -fgnu-intrinsics-* and-fbadu77-intrinsics-* options.
In EGCS 1.0.1 versus EGCS 1.0:
- Fix run-time crash involving
NAMELISTon 64-bit machines such as Alphas.
In EGCS 1.0 versus g77 0.5.21:
- Version 1.0 of
egcscontains several regressions against version 0.5.21 of g77, due to using the “vanilla” gcc back end instead of patching it to fix a few bugs and improve performance in a few cases.
Features that have been dropped from this version of g77 due to their being implemented via g77-specific patches to the gccback end in previous releases include:- Support for the C-language
restrictkeyword. - Support for the -W option warning about integer division by zero.
- The Intel x86-specific option -malign-doubleapplying to stack-allocated data as well as statically-allocate data.
Note that the gcc/f/gbe/ subdirectory has been removed from this distribution as a result of g77being fully integrated with theegcsvariant of the gcc back end.
- Support for the C-language
- Fix code generation for iterative
DOloops that have one or more references to the iteration variable, or to aliases of it, in their control expressions. For example, DO 10 J=2,J now is compiled correctly. - Fix
DTimeintrinsic so as not to truncate results to integer values (on some systems). - Some Fortran code, miscompiled by g77 built on gcc version 2.8.1 on m68k-next-nextstep3 configurations when using the -O2 option, is now compiled correctly. It is believed that a C function known to miscompile on that configuration when using the -O2 -funroll-loops options also is now compiled correctly.
- Remove support for non-
egcsversions of gcc. - Remove support for the --driver option, as g77 now does all the driving, just like gcc.
- Allow any numeric argument to intrinsics
Int2andInt8. - Improve diagnostic messages from
libf2cso it is more likely that the printing of the active format string is limited to the string, with no trailing garbage being printed.
(Unlike f2c, g77 did not append a null byte to its compiled form of every format string specified via aFORMATstatement. However,f2cwould exhibit the problem anyway for a statement like PRINT '(I)garbage', 1by printing (I)garbage as the format string.) - Upgrade to
libf2cas of 1997-09-23. This fixes a formatted-I/O bug that afflicted 64-bit systems with 32-bit integers (such as Digital Alpha running GNU/Linux).
In 0.5.21:
- Fix a code-generation bug introduced by 0.5.20 caused by loop unrolling (by specifying-funroll-loops or similar). This bug afflicted all code compiled by version 2.7.2.2.f.2 of gcc (C, C++, Fortran, and so on).
- Fix a code-generation bug manifested when combining local
EQUIVALENCEwith aDATAstatement that follows the first executable statement (or is treated as an executable-context statement as a result of using the -fpedanticoption). - Fix a compiler crash that occurred when an integer division by a constant zero is detected. Instead, when the -W option is specified, the gcc back end issues a warning about such a case. This bug afflicted all code compiled by version 2.7.2.2.f.2 of gcc (C, C++, Fortran, and so on).
- Fix a compiler crash that occurred in some cases of procedure inlining. (Such cases became more frequent in 0.5.20.)
- Fix a compiler crash resulting from using
DATAor similar to initialize aCOMPLEXvariable or array to zero. - Fix compiler crashes involving use of
AND,OR, orXORintrinsics. - Fix compiler bug triggered when using a
COMMONorEQUIVALENCEvariable as the target of anASSIGNor assigned-GOTOstatement. - Fix compiler crashes due to using the name of a some non-standard intrinsics (such as
FTellorFPutC) as such and as the name of a procedure or common block. Such dual use of a name in a program is allowed by the standard. - Place automatic arrays on the stack, even if
SAVEor the -fno-automatic option is in effect. This avoids a compiler crash in some cases. - The -malign-double option now reliably aligns
DOUBLE PRECISIONoptimally on Pentium and Pentium Pro architectures (586 and 686 in gcc). - New option -Wno-globals disables warnings about “suspicious” use of a name both as a global name and as the implicit name of an intrinsic, and warnings about disagreements over the number or natures of arguments passed to global procedures, or the natures of the procedures themselves.
The default is to issue such warnings, which are new as of this version of g77. - New option -fno-globals disables diagnostics about potentially fatal disagreements analysis problems, such as disagreements over the number or natures of arguments passed to global procedures, or the natures of those procedures themselves.
The default is to issue such diagnostics and flag the compilation as unsuccessful. With this option, the diagnostics are issued as warnings, or, if -Wno-globals is specified, are not issued at all.
This option also disables inlining of global procedures, to avoid compiler crashes resulting from coding errors that these diagnostics normally would identify. - Diagnose cases where a reference to a procedure disagrees with the type of that procedure, or where disagreements about the number or nature of arguments exist. This avoids a compiler crash.
- Fix parsing bug whereby g77 rejected a second initialization specification immediately following the first's closing / without an intervening comma in a
DATAstatement, and the second specification was an implied-DO list. - Improve performance of the gcc back end so certain complicated expressions involving
COMPLEXarithmetic (especially multiplication) don't appear to take forever to compile. - Fix a couple of profiling-related bugs in gccback end.
- Integrate GNU Ada's (GNAT's) changes to the back end, which consist almost entirely of bug fixes. These fixes are circa version 3.10p of GNAT.
- Include some other gcc fixes that seem useful ing77's version of gcc. (See gcc/ChangeLog for details—compare it to that file in the vanilla
gcc-2.7.2.3.tar.gzdistribution.) - Fix
libU77routines that accept file and other names to strip trailing blanks from them, for consistency with other implementations. Blanks may be forcibly appended to such names by appending a single null character (CHAR(0)) to the significant trailing blanks. - Fix
CHMODintrinsic to work with file names that have embedded blanks, commas, and so on. - Fix
SIGNALintrinsic so it accepts an optional thirdStatusargument. - Fix
IDATE()intrinsic subroutine (VXT form) so it accepts arguments in the correct order. Documentation fixed accordingly, and forGMTIME()andLTIME()as well. - Make many changes to
libU77intrinsics to support existing code more directly.
Such changes include allowing both subroutine and function forms of many routines, changingMCLOCK()andTIME()to returnINTEGER(KIND=1)values, introducingMCLOCK8()andTIME8()to returnINTEGER(KIND=2)values, and placing functions that are intended to perform side effects in a new intrinsic group,badu77. - Improve
libU77so it is more portable. - Add options -fbadu77-intrinsics-delete,-fbadu77-intrinsics-hide, and so on.
- Fix crashes involving diagnosed or invalid code.
- g77 and gcc now do a somewhat better job detecting and diagnosing arrays that are too large to handle before these cause diagnostics during the assembler or linker phase, a compiler crash, or generation of incorrect code.
- Make some fixes to alias analysis code.
- Add support for
restrictkeyword in gccfront end. - Support gcc version 2.7.2.3 (modified by g77 into version 2.7.2.3.f.1), and remove support for prior versions of gcc.
- Incorporate GNAT's patches to the gcc back end into g77's, so GNAT users do not need to apply GNAT's patches to build both GNAT and g77from the same source tree.
- Modify make rules and related code so that generation of Info documentation doesn't require compilation using gcc. Now, any ANSI C compiler should be adequate to produce the g77 documentation (in particular, the tables of intrinsics) from scratch.
- Add
INT2andINT8intrinsics. - Add
CPU_TIMEintrinsic. - Add
ALARMintrinsic. CTIMEintrinsic now accepts anyINTEGERargument, not justINTEGER(KIND=2).- Warn when explicit type declaration disagrees with the type of an intrinsic invocation.
- Support *f771 entry in gcc specs file.
- Fix typo in make rule g77-cross, used only for cross-compiling.
- Fix
libf2cbuild procedure to re-archive library if previous attempt to archive was interrupted. - Change gcc to unroll loops only during the last invocation (of as many as two invocations) of loop optimization.
- Improve handling of -fno-f2c so that code that attempts to pass an intrinsic as an actual argument, such as CALL FOO(ABS), is rejected due to the fact that the run-time-library routine is, effectively, compiled with -ff2c in effect.
- Fix g77 driver to recognize -fsyntax-onlyas an option that inhibits linking, just like -c or-S, and to recognize and properly handle the-nostdlib, -M, -MM, -nodefaultlibs, and -Xlinker options.
- Upgrade to
libf2cas of 1997-08-16. - Modify
libf2cto consistently and clearly diagnose recursive I/O (at run time). - g77 driver now prints version information (such as produced by g77 -v) to
stderrinstead ofstdout. - The .r suffix now designates a Ratfor source file, to be preprocessed via the ratfor command, available separately.
- Fix some aspects of how gcc determines what kind of system is being configured and what kinds are supported. For example, GNU Linux/Alpha ELF systems now are directly supported.
- Improve diagnostics.
- Improve documentation and indexing.
- Include all pertinent files for
libf2cthat come fromnetlib.bell-labs.com; give any such files that aren't quite accurate in g77's version oflibf2cthe suffix .netlib. - Reserve
INTEGER(KIND=0)for future use.
In 0.5.20:
- The -fno-typeless-boz option is now the default.
This option specifies that non-decimal-radix constants using the prefixed-radix form (such as Z'1234') are to be interpreted asINTEGER(KIND=1)constants. Specify -ftypeless-boz to cause such constants to be interpreted as typeless.
(Version 0.5.19 introduced -fno-typeless-boz and its inverse.)
See Options Controlling Fortran Dialect, for information on the -ftypeless-boz option. - Options -ff90-intrinsics-enable and-fvxt-intrinsics-enable now are the defaults.
Some programs might use names that clash with intrinsic names defined (and now enabled) by these options or by the newlibU77intrinsics. Users of such programs might need to compile them differently (using, for example, -ff90-intrinsics-disable) or, better yet, insert appropriateEXTERNALstatements specifying that these names are not intended to be names of intrinsics. - The
ALWAYS_FLUSHmacro is no longer defined when buildinglibf2c, which should result in improved I/O performance, especially over NFS.
Note: If you have code that depends on the behavior oflibf2cwhen built withALWAYS_FLUSHdefined, you will have to modifylibf2caccordingly before building it from this and future versions of g77.
See Output Assumed To Flush, for more information. - Dave Love's implementation of
libU77has been added to the version oflibf2cdistributed with and built as part of g77. g77 now knows about the routines in this library as intrinsics. - New option -fvxt specifies that the source file is written in VXT Fortran, instead of GNU Fortran.
See VXT Fortran, for more information on the constructs recognized when the -fvxt option is specified. - The -fvxt-not-f90 option has been deleted, along with its inverse, -ff90-not-vxt.
If you used one of these deleted options, you should re-read the pertinent documentation to determine which options, if any, are appropriate for compiling your code with this version of g77.
See Other Dialects, for more information. - The -fugly option now issues a warning, as it likely will be removed in a future version.
(Enabling all the -fugly-* options is unlikely to be feasible, or sensible, in the future, so users should learn to specify only those-fugly-* options they really need for a particular source file.) - The -fugly-assumed option, introduced in version 0.5.19, has been changed to better accommodate old and new code.
See Ugly Assumed-Size Arrays, for more information. - Make a number of fixes to the g77 front end and the gcc back end to better support Alpha (AXP) machines. This includes providing at least one bug-fix to thegcc back end for Alphas.
- Related to supporting Alpha (AXP) machines, the
LOC()intrinsic and%LOC()construct now return values ofINTEGER(KIND=0)type, as defined by the GNU Fortran language.
This type is wide enough (holds the same number of bits) as the character-pointer type on the machine.
On most machines, this won't make a difference, whereas, on Alphas and other systems with 64-bit pointers, theINTEGER(KIND=0)type is equivalent toINTEGER(KIND=2)(often referred to asINTEGER*8) instead of the more commonINTEGER(KIND=1)(often referred to asINTEGER*4). - Emulate
COMPLEXarithmetic in the g77 front end, to avoid bugs incomplexsupport in thegcc back end. New option -fno-emulate-complexcauses g77 to revert the 0.5.19 behavior. - Fix bug whereby REAL A(1), for example, caused a compiler crash if -fugly-assumed was in effect and A was a local (automatic) array. That case is no longer affected by the new handling of -fugly-assumed.
- Fix g77 command driver so that g77 -o foo.fno longer deletes foo.f before issuing other diagnostics, and so the -x option is properly handled.
- Enable inlining of subroutines and functions by the gccback end. This works as it does for gcc itself—program units may be inlined for invocations that follow them in the same program unit, as long as the appropriate compile-time options are specified.
- Dummy arguments are no longer assumed to potentially alias (overlap) other dummy arguments or
COMMONareas when any of these are defined (assigned to) by Fortran code.
This can result in faster and/or smaller programs when compiling with optimization enabled, though on some systems this effect is observed only when -fforce-addralso is specified.
New options -falias-check, -fargument-alias,-fargument-noalias, and -fno-argument-noalias-global control the way g77 handles potential aliasing.
See Aliasing Assumed To Work, for detailed information on why the new defaults might result in some programs no longer working the way they did when compiled by previous versions of g77. - The
CONJG()andDCONJG()intrinsics now are compiled in-line. - The bug-fix for 0.5.19.1 has been re-done. The g77 compiler has been changed back to assume
libf2chas no aliasing problems in its implementations of theCOMPLEX(andDOUBLE COMPLEX) intrinsics. Thelibf2chas been changed to have no such problems.
As a result, 0.5.20 is expected to offer improved performance over 0.5.19.1, perhaps as good as 0.5.19 in most or all cases, due to this change alone.
Note: This change requires version 0.5.20 oflibf2c, at least, when linking code produced by any versions of g77 other than 0.5.19.1. Use g77 -v to determine the version numbers of thelibF77,libI77, andlibU77components of thelibf2clibrary. (If these version numbers are not printed—in particular, if the linker complains about unresolved references to names like g77__fvers__—that strongly suggests your installation has an obsolete version oflibf2c.) - New option -fugly-assign specifies that the same memory locations are to be used to hold the values assigned by both statements I = 3 andASSIGN 10 TO I, for example. (Normally, g77 uses a separate memory location to hold assigned statement labels.)
See Ugly Assigned Labels, for more information. FORMATandENTRYstatements now are allowed to precedeIMPLICIT NONEstatements.- Produce diagnostic for unsupported
SELECT CASEonCHARACTERtype, instead of crashing, at compile time. - Fix crashes involving diagnosed or invalid code.
- Change approach to building
libf2carchive (libf2c.a) so that members are added to it only when truly necessary, so the user that installs an already-built g77 doesn't need to have write access to the build tree (whereas the user doing the build might not have access to install new software on the system). - Support gcc version 2.7.2.2 (modified by g77 into version 2.7.2.2.f.2), and remove support for prior versions of gcc.
- Upgrade to
libf2cas of 1997-02-08, and fix up some of the build procedures. - Improve general build procedures for g77, fixing minor bugs (such as deletion of any file named f771 in the parent directory of
gcc/). - Enable full support of
INTEGER(KIND=2)(often referred to asINTEGER*8) available inlibf2cand f2c.h so that f2c users may make full use of its features via the g77version of f2c.h and theINTEGER(KIND=2)support routines in the g77 version oflibf2c. - Improve g77 driver and
libf2cso that g77 -vyields version information on the library. - The
SNGLandFLOATintrinsics now are specific intrinsics, instead of synonyms for the generic intrinsicREAL. - New intrinsics have been added. These are
REALPART,IMAGPART,COMPLEX,LONG, andSHORT. - A new group of intrinsics,
gnu, has been added to contain the newREALPART,IMAGPART, andCOMPLEXintrinsics. An old group,dcp, has been removed. - Complain about industry-wide ambiguous referencesREAL(expr) and AIMAG(expr), where expr is
DOUBLE COMPLEX(or any complex type other thanCOMPLEX), unless-ff90 option specifies Fortran 90 interpretation or new -fugly-complex option, in conjunction with-fnot-f90, specifies f2c interpretation. - Make improvements to diagnostics.
- Speed up compiler a bit.
- Improvements to documentation and indexing, including a new chapter containing information on one, later more, diagnostics that users are directed to pull up automatically via a message in the diagnostic itself.
(Hence the menu itemMfor the nodeDiagnosticsin the top-level menu of the Info documentation.)
In previous versions:
Information on previous versions is archived in gcc/gcc/f/news.texifollowing the test of the DOC-OLDNEWS macro.