1 This file lists recent changes to the GNU Fortran compiler. Copyright
2 (C) 1995, 1996 Free Software Foundation, Inc. You may copy,
3 distribute, and modify it freely as long as you preserve this copyright
4 notice and permission notice.
9 Changes made to recent versions of GNU Fortran are listed below,
10 with the most recent version first.
12 The changes are generally listed in order:
14 1. Code-generation and run-time-library bugs
16 2. Compiler and run-time-library crashes involving valid code
20 4. Fixes and enhancements to existing features
24 6. Internal improvements
28 This order is not strict--for example, some items involve a
29 combination of these elements.
34 * Fix code generation for iterative `DO' loops that have one or more
35 references to the iteration variable, or to aliases of it, in
36 their control expressions. For example, `DO 10 J=2,J' now is
39 * Fix a code-generation bug that afflicted Intel x86 targets when
40 `-O2' was specified compiling, for example, an old version of the
43 The x87 coprocessor stack was being mismanaged in cases involving
44 assigned `GOTO' and `ASSIGN'.
46 * Fix `DTime' intrinsic so as not to truncate results to integer
47 values (on some systems).
49 * Fix `SIGNAL' intrinsic so it offers portable support for 64-bit
50 systems (such as Digital Alphas running GNU/Linux).
52 * Fix run-time crash involving `NAMELIST' on 64-bit machines such as
55 * Fix `g77' version of `libf2c' so it no longer produces a spurious
56 `I/O recursion' diagnostic at run time when an I/O operation (such
57 as `READ *,I') is interrupted in a manner that causes the program
58 to be terminated via the `f_exit' routine (such as via `C-c').
60 * Fix `g77' crash triggered by `CASE' statement with an omitted
63 * Fix `g77' crash compiling references to `CPU_Time' intrinsic.
65 * Fix `g77' crash (or apparently infinite run-time) when compiling
66 certain complicated expressions involving `COMPLEX' arithmetic
67 (especially multiplication).
69 * Fix `g77' crash on statements such as `PRINT *,
70 (REAL(Z(I)),I=1,2)', where `Z' is `DOUBLE COMPLEX'.
74 * Support `FORMAT(I<EXPR>)' when EXPR is a compile-time constant
77 * Fix `g77' `-g' option so procedures that use `ENTRY' can be
78 stepped through, line by line, in `gdb'.
80 * Fix a profiling-related bug in `gcc' back end for Intel x86
83 * Allow any `REAL' argument to intrinsics `Second' and `CPU_Time'.
85 * Allow any numeric argument to intrinsics `Int2' and `Int8'.
87 * Use `tempnam', if available, to open scratch files (as in
88 `OPEN(STATUS='SCRATCH')' so that the `TMPDIR' environment variable,
91 * Rename the `gcc' keyword `restrict' to `__restrict__', to avoid
92 rejecting valid, existing, C programs. Support for `restrict' is
93 now more like support for `complex'.
95 * Fix `-fpedantic' to not reject procedure invocations such as
96 `I=J()' and `CALL FOO()'.
98 * Fix `-fugly-comma' to affect invocations of only external
99 procedures. Restore rejection of gratuitous trailing omitted
100 arguments to intrinsics, as in `I=MAX(3,4,,)'.
102 * Fix compiler so it accepts `-fgnu-intrinsics-*' and
103 `-fbadu77-intrinsics-*' options.
105 * Improve diagnostic messages from `libf2c' so it is more likely
106 that the printing of the active format string is limited to the
107 string, with no trailing garbage being printed.
109 (Unlike `f2c', `g77' did not append a null byte to its compiled
110 form of every format string specified via a `FORMAT' statement.
111 However, `f2c' would exhibit the problem anyway for a statement
112 like `PRINT '(I)garbage', 1' by printing `(I)garbage' as the
115 * Improve compilation of FORMAT expressions so that a null byte is
116 appended to the last operand if it is a constant. This provides a
117 cleaner run-time diagnostic as provided by `libf2c' for statements
118 like `PRINT '(I1', 42'.
120 * Fix various crashes involving code with diagnosed errors.
122 * Fix cross-compilation bug when configuring `libf2c'.
124 * Improve diagnostics.
126 * Improve documentation and indexing.
128 * Upgrade to `libf2c' as of 1997-09-23. This fixes a formatted-I/O
129 bug that afflicted 64-bit systems with 32-bit integers (such as
130 Digital Alpha running GNU/Linux).
135 * Fix a code-generation bug introduced by 0.5.20 caused by loop
136 unrolling (by specifying `-funroll-loops' or similar). This bug
137 afflicted all code compiled by version 2.7.2.2.f.2 of `gcc' (C,
138 C++, Fortran, and so on).
140 * Fix a code-generation bug manifested when combining local
141 `EQUIVALENCE' with a `DATA' statement that follows the first
142 executable statement (or is treated as an executable-context
143 statement as a result of using the `-fpedantic' option).
145 * Fix a compiler crash that occured when an integer division by a
146 constant zero is detected. Instead, when the `-W' option is
147 specified, the `gcc' back end issues a warning about such a case.
148 This bug afflicted all code compiled by version 2.7.2.2.f.2 of
149 `gcc' (C, C++, Fortran, and so on).
151 * Fix a compiler crash that occurred in some cases of procedure
152 inlining. (Such cases became more frequent in 0.5.20.)
154 * Fix a compiler crash resulting from using `DATA' or similar to
155 initialize a `COMPLEX' variable or array to zero.
157 * Fix compiler crashes involving use of `AND', `OR', or `XOR'
160 * Fix compiler bug triggered when using a `COMMON' or `EQUIVALENCE'
161 variable as the target of an `ASSIGN' or assigned-`GOTO' statement.
163 * Fix compiler crashes due to using the name of a some non-standard
164 intrinsics (such as `FTELL' or `FPUTC') as such and as the name of
165 a procedure or common block. Such dual use of a name in a program
166 is allowed by the standard.
168 * Place automatic arrays on the stack, even if `SAVE' or the
169 `-fno-automatic' option is in effect. This avoids a compiler
172 * The `-malign-double' option now reliably aligns `DOUBLE PRECISION'
173 optimally on Pentium and Pentium Pro architectures (586 and 686 in
176 * New option `-Wno-globals' disables warnings about "suspicious" use
177 of a name both as a global name and as the implicit name of an
178 intrinsic, and warnings about disagreements over the number or
179 natures of arguments passed to global procedures, or the natures
180 of the procedures themselves.
182 The default is to issue such warnings, which are new as of this
185 * New option `-fno-globals' disables diagnostics about potentially
186 fatal disagreements analysis problems, such as disagreements over
187 the number or natures of arguments passed to global procedures, or
188 the natures of those procedures themselves.
190 The default is to issue such diagnostics and flag the compilation
191 as unsuccessful. With this option, the diagnostics are issued as
192 warnings, or, if `-Wno-globals' is specified, are not issued at
195 This option also disables inlining of global procedures, to avoid
196 compiler crashes resulting from coding errors that these
197 diagnostics normally would identify.
199 * Diagnose cases where a reference to a procedure disagrees with the
200 type of that procedure, or where disagreements about the number or
201 nature of arguments exist. This avoids a compiler crash.
203 * Fix parsing bug whereby `g77' rejected a second initialization
204 specification immediately following the first's closing `/' without
205 an intervening comma in a `DATA' statement, and the second
206 specification was an implied-DO list.
208 * Improve performance of the `gcc' back end so certain complicated
209 expressions involving `COMPLEX' arithmetic (especially
210 multiplication) don't appear to take forever to compile.
212 * Fix a couple of profiling-related bugs in `gcc' back end.
214 * Integrate GNU Ada's (GNAT's) changes to the back end, which
215 consist almost entirely of bug fixes. These fixes are circa
216 version 3.10p of GNAT.
218 * Include some other `gcc' fixes that seem useful in `g77''s version
219 of `gcc'. (See `gcc/ChangeLog' for details--compare it to that
220 file in the vanilla `gcc-2.7.2.3.tar.gz' distribution.)
222 * Fix `libU77' routines that accept file and other names to strip
223 trailing blanks from them, for consistency with other
224 implementations. Blanks may be forcibly appended to such names by
225 appending a single null character (`CHAR(0)') to the significant
228 * Fix `CHMOD' intrinsic to work with file names that have embedded
229 blanks, commas, and so on.
231 * Fix `SIGNAL' intrinsic so it accepts an optional third `Status'
234 * Fix `IDATE()' intrinsic subroutine (VXT form) so it accepts
235 arguments in the correct order. Documentation fixed accordingly,
236 and for `GMTIME()' and `LTIME()' as well.
238 * Make many changes to `libU77' intrinsics to support existing code
241 Such changes include allowing both subroutine and function forms
242 of many routines, changing `MCLOCK()' and `TIME()' to return
243 `INTEGER(KIND=1)' values, introducing `MCLOCK8()' and `TIME8()' to
244 return `INTEGER(KIND=2)' values, and placing functions that are
245 intended to perform side effects in a new intrinsic group,
248 * Improve `libU77' so it is more portable.
250 * Add options `-fbadu77-intrinsics-delete',
251 `-fbadu77-intrinsics-hide', and so on.
253 * Fix crashes involving diagnosed or invalid code.
255 * `g77' and `gcc' now do a somewhat better job detecting and
256 diagnosing arrays that are too large to handle before these cause
257 diagnostics during the assembler or linker phase, a compiler
258 crash, or generation of incorrect code.
260 * Make some fixes to alias analysis code.
262 * Add support for `restrict' keyword in `gcc' front end.
264 * Support `gcc' version 2.7.2.3 (modified by `g77' into version
265 2.7.2.3.f.1), and remove support for prior versions of `gcc'.
267 * Incorporate GNAT's patches to the `gcc' back end into `g77''s, so
268 GNAT users do not need to apply GNAT's patches to build both GNAT
269 and `g77' from the same source tree.
271 * Modify `make' rules and related code so that generation of Info
272 documentation doesn't require compilation using `gcc'. Now, any
273 ANSI C compiler should be adequate to produce the `g77'
274 documentation (in particular, the tables of intrinsics) from
277 * Add `INT2' and `INT8' intrinsics.
279 * Add `CPU_TIME' intrinsic.
281 * Add `ALARM' intrinsic.
283 * `CTIME' intrinsic now accepts any `INTEGER' argument, not just
286 * Warn when explicit type declaration disagrees with the type of an
287 intrinsic invocation.
289 * Support `*f771' entry in `gcc' `specs' file.
291 * Fix typo in `make' rule `g77-cross', used only for cross-compiling.
293 * Fix `libf2c' build procedure to re-archive library if previous
294 attempt to archive was interrupted.
296 * Change `gcc' to unroll loops only during the last invocation (of
297 as many as two invocations) of loop optimization.
299 * Improve handling of `-fno-f2c' so that code that attempts to pass
300 an intrinsic as an actual argument, such as `CALL FOO(ABS)', is
301 rejected due to the fact that the run-time-library routine is,
302 effectively, compiled with `-ff2c' in effect.
304 * Fix `g77' driver to recognize `-fsyntax-only' as an option that
305 inhibits linking, just like `-c' or `-S', and to recognize and
306 properly handle the `-nostdlib', `-M', `-MM', `-nodefaultlibs',
307 and `-Xlinker' options.
309 * Upgrade to `libf2c' as of 1997-08-16.
311 * Modify `libf2c' to consistently and clearly diagnose recursive I/O
314 * `g77' driver now prints version information (such as produced by
315 `g77 -v') to `stderr' instead of `stdout'.
317 * The `.r' suffix now designates a Ratfor source file, to be
318 preprocessed via the `ratfor' command, available separately.
320 * Fix some aspects of how `gcc' determines what kind of system is
321 being configured and what kinds are supported. For example, GNU
322 Linux/Alpha ELF systems now are directly supported.
324 * Improve diagnostics.
326 * Improve documentation and indexing.
328 * Include all pertinent files for `libf2c' that come from
329 `netlib.bell-labs.com'; give any such files that aren't quite
330 accurate in `g77''s version of `libf2c' the suffix `.netlib'.
332 * Reserve `INTEGER(KIND=0)' for future use.
337 * The `-fno-typeless-boz' option is now the default.
339 This option specifies that non-decimal-radix constants using the
340 prefixed-radix form (such as `Z'1234'') are to be interpreted as
341 `INTEGER' constants. Specify `-ftypeless-boz' to cause such
342 constants to be interpreted as typeless.
344 (Version 0.5.19 introduced `-fno-typeless-boz' and its inverse.)
346 * Options `-ff90-intrinsics-enable' and `-fvxt-intrinsics-enable'
347 now are the defaults.
349 Some programs might use names that clash with intrinsic names
350 defined (and now enabled) by these options or by the new `libU77'
351 intrinsics. Users of such programs might need to compile them
352 differently (using, for example, `-ff90-intrinsics-disable') or,
353 better yet, insert appropriate `EXTERNAL' statements specifying
354 that these names are not intended to be names of intrinsics.
356 * The `ALWAYS_FLUSH' macro is no longer defined when building
357 `libf2c', which should result in improved I/O performance,
360 *Note:* If you have code that depends on the behavior of `libf2c'
361 when built with `ALWAYS_FLUSH' defined, you will have to modify
362 `libf2c' accordingly before building it from this and future
365 * Dave Love's implementation of `libU77' has been added to the
366 version of `libf2c' distributed with and built as part of `g77'.
367 `g77' now knows about the routines in this library as intrinsics.
369 * New option `-fvxt' specifies that the source file is written in
370 VXT Fortran, instead of GNU Fortran.
372 * The `-fvxt-not-f90' option has been deleted, along with its
373 inverse, `-ff90-not-vxt'.
375 If you used one of these deleted options, you should re-read the
376 pertinent documentation to determine which options, if any, are
377 appropriate for compiling your code with this version of `g77'.
379 * The `-fugly' option now issues a warning, as it likely will be
380 removed in a future version.
382 (Enabling all the `-fugly-*' options is unlikely to be feasible,
383 or sensible, in the future, so users should learn to specify only
384 those `-fugly-*' options they really need for a particular source
387 * The `-fugly-assumed' option, introduced in version 0.5.19, has
388 been changed to better accommodate old and new code.
390 * Make a number of fixes to the `g77' front end and the `gcc' back
391 end to better support Alpha (AXP) machines. This includes
392 providing at least one bug-fix to the `gcc' back end for Alphas.
394 * Related to supporting Alpha (AXP) machines, the `LOC()' intrinsic
395 and `%LOC()' construct now return values of integer type that is
396 the same width (holds the same number of bits) as the pointer type
399 On most machines, this won't make a difference, whereas on Alphas,
400 the type these constructs return is `INTEGER*8' instead of the
401 more common `INTEGER*4'.
403 * Emulate `COMPLEX' arithmetic in the `g77' front end, to avoid bugs
404 in `complex' support in the `gcc' back end. New option
405 `-fno-emulate-complex' causes `g77' to revert the 0.5.19 behavior.
407 * Fix bug whereby `REAL A(1)', for example, caused a compiler crash
408 if `-fugly-assumed' was in effect and A was a local (automatic)
409 array. That case is no longer affected by the new handling of
412 * Fix `g77' command driver so that `g77 -o foo.f' no longer deletes
413 `foo.f' before issuing other diagnostics, and so the `-x' option
416 * Enable inlining of subroutines and functions by the `gcc' back end.
417 This works as it does for `gcc' itself--program units may be
418 inlined for invocations that follow them in the same program unit,
419 as long as the appropriate compile-time options are specified.
421 * Dummy arguments are no longer assumed to potentially alias
422 (overlap) other dummy arguments or `COMMON' areas when any of
423 these are defined (assigned to) by Fortran code.
425 This can result in faster and/or smaller programs when compiling
426 with optimization enabled, though on some systems this effect is
427 observed only when `-fforce-addr' also is specified.
429 New options `-falias-check', `-fargument-alias',
430 `-fargument-noalias', and `-fno-argument-noalias-global' control
431 the way `g77' handles potential aliasing.
433 * The `CONJG()' and `DCONJG()' intrinsics now are compiled in-line.
435 * The bug-fix for 0.5.19.1 has been re-done. The `g77' compiler has
436 been changed back to assume `libf2c' has no aliasing problems in
437 its implementations of the `COMPLEX' (and `DOUBLE COMPLEX')
438 intrinsics. The `libf2c' has been changed to have no such
441 As a result, 0.5.20 is expected to offer improved performance over
442 0.5.19.1, perhaps as good as 0.5.19 in most or all cases, due to
445 *Note:* This change requires version 0.5.20 of `libf2c', at least,
446 when linking code produced by any versions of `g77' other than
447 0.5.19.1. Use `g77 -v' to determine the version numbers of the
448 `libF77', `libI77', and `libU77' components of the `libf2c'
449 library. (If these version numbers are not printed--in
450 particular, if the linker complains about unresolved references to
451 names like `g77__fvers__'--that strongly suggests your
452 installation has an obsolete version of `libf2c'.)
454 * New option `-fugly-assign' specifies that the same memory
455 locations are to be used to hold the values assigned by both
456 statements `I = 3' and `ASSIGN 10 TO I', for example. (Normally,
457 `g77' uses a separate memory location to hold assigned statement
460 * `FORMAT' and `ENTRY' statements now are allowed to precede
461 `IMPLICIT NONE' statements.
463 * Produce diagnostic for unsupported `SELECT CASE' on `CHARACTER'
464 type, instead of crashing, at compile time.
466 * Fix crashes involving diagnosed or invalid code.
468 * Change approach to building `libf2c' archive (`libf2c.a') so that
469 members are added to it only when truly necessary, so the user
470 that installs an already-built `g77' doesn't need to have write
471 access to the build tree (whereas the user doing the build might
472 not have access to install new software on the system).
474 * Support `gcc' version 2.7.2.2 (modified by `g77' into version
475 2.7.2.2.f.2), and remove support for prior versions of `gcc'.
477 * Upgrade to `libf2c' as of 1997-02-08, and fix up some of the build
480 * Improve general build procedures for `g77', fixing minor bugs
481 (such as deletion of any file named `f771' in the parent directory
484 * Enable full support of `INTEGER*8' available in `libf2c' and
485 `f2c.h' so that `f2c' users may make full use of its features via
486 the `g77' version of `f2c.h' and the `INTEGER*8' support routines
487 in the `g77' version of `libf2c'.
489 * Improve `g77' driver and `libf2c' so that `g77 -v' yields version
490 information on the library.
492 * The `SNGL' and `FLOAT' intrinsics now are specific intrinsics,
493 instead of synonyms for the generic intrinsic `REAL'.
495 * New intrinsics have been added. These are `REALPART', `IMAGPART',
496 `COMPLEX', `LONG', and `SHORT'.
498 * A new group of intrinsics, `gnu', has been added to contain the
499 new `REALPART', `IMAGPART', and `COMPLEX' intrinsics. An old
500 group, `dcp', has been removed.
502 * Complain about industry-wide ambiguous references `REAL(EXPR)' and
503 `AIMAG(EXPR)', where EXPR is `DOUBLE COMPLEX' (or any complex type
504 other than `COMPLEX'), unless `-ff90' option specifies Fortran 90
505 interpretation or new `-fugly-complex' option, in conjunction with
506 `-fnot-f90', specifies `f2c' interpretation.
508 * Make improvements to diagnostics.
510 * Speed up compiler a bit.
512 * Improvements to documentation and indexing, including a new
513 chapter containing information on one, later more, diagnostics
514 that users are directed to pull up automatically via a message in
515 the diagnostic itself.
517 (Hence the menu item `M' for the node `Diagnostics' in the
518 top-level menu of the Info documentation.)
523 * Code-generation bugs afflicting operations on complex data have
526 These bugs occurred when assigning the result of an operation to a
527 complex variable (or array element) that also served as an input
530 The operations affected by this bug were: `CONJG()', `DCONJG()',
531 `CCOS()', `CDCOS()', `CLOG()', `CDLOG()', `CSIN()', `CDSIN()',
532 `CSQRT()', `CDSQRT()', complex division, and raising a `DOUBLE
533 COMPLEX' operand to an `INTEGER' power. (The related generic and
534 `Z'-prefixed intrinsics, such as `ZSIN()', also were affected.)
536 For example, `C = CSQRT(C)', `Z = Z/C', and `Z = Z**I' (where `C'
537 is `COMPLEX' and `Z' is `DOUBLE COMPLEX') have been fixed.
542 * Fix `FORMAT' statement parsing so negative values for specifiers
543 such as `P' (e.g. `FORMAT(-1PF8.1)') are correctly processed as
546 * Fix `SIGNAL' intrinsic so it once again accepts a procedure as its
549 * A temporary kludge option provides bare-bones information on
550 `COMMON' and `EQUIVALENCE' members at debug time.
552 * New `-fonetrip' option specifies FORTRAN-66-style one-trip `DO'
555 * New `-fno-silent' option causes names of program units to be
556 printed as they are compiled, in a fashion similar to UNIX `f77'
559 * New `-fugly-assumed' option specifies that arrays dimensioned via
560 `DIMENSION X(1)', for example, are to be treated as assumed-size.
562 * New `-fno-typeless-boz' option specifies that non-decimal-radix
563 constants using the prefixed-radix form (such as `Z'1234'') are to
564 be interpreted as `INTEGER' constants.
566 * New `-ff66' option is a "shorthand" option that specifies
567 behaviors considered appropriate for FORTRAN 66 programs.
569 * New `-ff77' option is a "shorthand" option that specifies
570 behaviors considered appropriate for UNIX `f77' programs.
572 * New `-fugly-comma' and `-fugly-logint' options provided to perform
573 some of what `-fugly' used to do. `-fugly' and `-fno-ugly' are
574 now "shorthand" options, in that they do nothing more than enable
575 (or disable) other `-fugly-*' options.
577 * Fix parsing of assignment statements involving targets that are
578 substrings of elements of `CHARACTER' arrays having names such as
579 `READ', `WRITE', `GOTO', and `REALFUNCTIONFOO'.
581 * Fix crashes involving diagnosed code.
583 * Fix handling of local `EQUIVALENCE' areas so certain cases of
584 valid Fortran programs are not misdiagnosed as improperly
585 extending the area backwards.
587 * Support `gcc' version 2.7.2.1.
589 * Upgrade to `libf2c' as of 1996-09-26, and fix up some of the build
592 * Change code generation for list-directed I/O so it allows for new
593 versions of `libf2c' that might return non-zero status codes for
594 some operations previously assumed to always return zero.
596 This change not only affects how `IOSTAT=' variables are set by
597 list-directed I/O, it also affects whether `END=' and `ERR='
598 labels are reached by these operations.
600 * Add intrinsic support for new `FTELL' and `FSEEK' procedures in
603 * Modify `fseek_()' in `libf2c' to be more portable (though, in
604 practice, there might be no systems where this matters) and to
605 catch invalid `whence' arguments.
607 * Some useless warnings from the `-Wunused' option have been
610 * Fix a problem building the `f771' executable on AIX systems by
611 linking with the `-bbigtoc' option.
613 * Abort configuration if `gcc' has not been patched using the patch
614 file provided in the `gcc/f/gbe/' subdirectory.
616 * Add options `--help' and `--version' to the `g77' command, to
617 conform to GNU coding guidelines. Also add printing of `g77'
618 version number when the `--verbose' (`-v') option is used.
620 * Change internally generated name for local `EQUIVALENCE' areas to
621 one based on the alphabetically sorted first name in the list of
622 names for entities placed at the beginning of the areas.
624 * Improvements to documentation and indexing.
629 * Add some rudimentary support for `INTEGER*1', `INTEGER*2',
630 `INTEGER*8', and their `LOGICAL' equivalents. (This support works
631 on most, maybe all, `gcc' targets.)
633 Thanks to Scott Snyder (<snyder@d0sgif.fnal.gov>) for providing
636 Among the missing elements from the support for these features are
637 full intrinsic support and constants.
639 * Add some rudimentary support for the `BYTE' and `WORD'
640 type-declaration statements. `BYTE' corresponds to `INTEGER*1',
641 while `WORD' corresponds to `INTEGER*2'.
643 Thanks to Scott Snyder (<snyder@d0sgif.fnal.gov>) for providing
646 * The compiler code handling intrinsics has been largely rewritten
647 to accommodate the new types. No new intrinsics or arguments for
648 existing intrinsics have been added, so there is, at this point,
649 no intrinsic to convert to `INTEGER*8', for example.
651 * Support automatic arrays in procedures.
653 * Reduce space/time requirements for handling large *sparsely*
654 initialized aggregate arrays. This improvement applies to only a
655 subset of the general problem to be addressed in 0.6.
657 * Treat initial values of zero as if they weren't specified (in DATA
658 and type-declaration statements). The initial values will be set
659 to zero anyway, but the amount of compile time processing them
660 will be reduced, in some cases significantly (though, again, this
661 is only a subset of the general problem to be addressed in 0.6).
663 A new option, `-fzeros', is introduced to enable the traditional
664 treatment of zeros as any other value.
666 * With `-ff90' in force, `g77' incorrectly interpreted `REAL(Z)' as
667 returning a `REAL' result, instead of as a `DOUBLE PRECISION'
668 result. (Here, `Z' is `DOUBLE COMPLEX'.)
670 With `-fno-f90' in force, the interpretation remains unchanged,
671 since this appears to be how at least some F77 code using the
672 `DOUBLE COMPLEX' extension expected it to work.
674 Essentially, `REAL(Z)' in F90 is the same as `DBLE(Z)', while in
675 extended F77, it appears to be the same as `REAL(REAL(Z))'.
677 * An expression involving exponentiation, where both operands were
678 type `INTEGER' and the right-hand operand was negative, was
679 erroneously evaluated.
681 * Fix bugs involving `DATA' implied-`DO' constructs (these involved
682 an errant diagnostic and a crash, both on good code, one involving
683 subsequent statement-function definition).
685 * Close `INCLUDE' files after processing them, so compiling source
686 files with lots of `INCLUDE' statements does not result in being
687 unable to open `INCLUDE' files after all the available file
688 descriptors are used up.
690 * Speed up compiling, especially of larger programs, and perhaps
691 slightly reduce memory utilization while compiling (this is *not*
692 the improvement planned for 0.6 involving large aggregate
693 areas)--these improvements result from simply turning off some
694 low-level code to do self-checking that hasn't been triggered in a
697 * Introduce three new options that implement optimizations in the
698 `gcc' back end (GBE). These options are `-fmove-all-movables',
699 `-freduce-all-givs', and `-frerun-loop-opt', which are enabled, by
700 default, for Fortran compilations. These optimizations are
701 intended to help toon Fortran programs.
703 * Patch the GBE to do a better job optimizing certain kinds of
704 references to array elements.
706 * Due to patches to the GBE, the version number of `gcc' also is
707 patched to make it easier to manage installations, especially
708 useful if it turns out a `g77' change to the GBE has a bug.
710 The `g77'-modified version number is the `gcc' version number with
711 the string `.f.N' appended, where `f' identifies the version as
712 enhanced for Fortran, and N is `1' for the first Fortran patch for
713 that version of `gcc', `2' for the second, and so on.
715 So, this introduces version 2.7.2.f.1 of `gcc'.
717 * Make several improvements and fixes to diagnostics, including the
718 removal of two that were inappropriate or inadequate.
720 * Warning about two successive arithmetic operators, produced by
721 `-Wsurprising', now produced *only* when both operators are,
722 indeed, arithmetic (not relational/boolean).
724 * `-Wsurprising' now warns about the remaining cases of using
725 non-integral variables for implied-`DO' loops, instead of these
726 being rejected unless `-fpedantic' or `-fugly' specified.
728 * Allow `SAVE' of a local variable or array, even after it has been
729 given an initial value via `DATA', for example.
731 * Introduce an Info version of `g77' documentation, which supercedes
732 `gcc/f/CREDITS', `gcc/f/DOC', and `gcc/f/PROJECTS'. These files
733 will be removed in a future release. The files `gcc/f/BUGS',
734 `gcc/f/INSTALL', and `gcc/f/NEWS' now are automatically built from
735 the texinfo source when distributions are made.
737 This effort was inspired by a first pass at translating
738 `g77-0.5.16/f/DOC' that was contributed to Craig by David Ronis
739 (<ronis@onsager.chem.mcgill.ca>).
741 * New `-fno-second-underscore' option to specify that, when
742 `-funderscoring' is in effect, a second underscore is not to be
743 appended to Fortran names already containing an underscore.
745 * Change the way iterative `DO' loops work to follow the F90
746 standard. In particular, calculation of the iteration count is
747 still done by converting the start, end, and increment parameters
748 to the type of the `DO' variable, but the result of the
749 calculation is always converted to the default `INTEGER' type.
751 (This should have no effect on existing code compiled by `g77',
752 but code written to assume that use of a *wider* type for the `DO'
753 variable will result in an iteration count being fully calculated
754 using that wider type (wider than default `INTEGER') must be
757 * Support `gcc' version 2.7.2.
759 * Upgrade to `libf2c' as of 1996-03-23, and fix up some of the build
762 Note that the email addresses related to `f2c' have changed--the
763 distribution site now is named `netlib.bell-labs.com', and the
764 maintainer's new address is <dmg@bell-labs.com>.
769 * *Fix serious bug* in `g77 -v' command that can cause removal of a
770 system's `/dev/null' special file if run by user `root'.
772 *All users* of version 0.5.16 should ensure that they have not
773 removed `/dev/null' or replaced it with an ordinary file (e.g. by
774 comparing the output of `ls -l /dev/null' with `ls -l /dev/zero'.
775 If the output isn't basically the same, contact your system
776 administrator about restoring `/dev/null' to its proper status).
778 This bug is particularly insidious because removing `/dev/null' as
779 a special file can go undetected for quite a while, aside from
780 various applications and programs exhibiting sudden, strange
783 I sincerely apologize for not realizing the implications of the
784 fact that when `g77 -v' runs the `ld' command with `-o /dev/null'
785 that `ld' tries to *remove* the executable it is supposed to build
786 (especially if it reports unresolved references, which it should
789 * Fix crash on `CHARACTER*(*) FOO' in a main or block data program
792 * Fix crash that can occur when diagnostics given outside of any
793 program unit (such as when input file contains `@foo').
795 * Fix crashes, infinite loops (hangs), and such involving diagnosed
798 * Fix `ASSIGN''ed variables so they can be `SAVE''d or dummy
799 arguments, and issue clearer error message in cases where target
800 of `ASSIGN' or `ASSIGN'ed `GOTO'/`FORMAT' is too small (which
801 should never happen).
803 * Make `libf2c' build procedures work on more systems again by
804 eliminating unnecessary invocations of `ld -r -x' and `mv'.
806 * Fix omission of `-funix-intrinsics-...' options in list of
807 permitted options to compiler.
809 * Fix failure to always diagnose missing type declaration for
812 * Fix compile-time performance problem (which could sometimes crash
813 the compiler, cause a hang, or whatever, due to a bug in the back
814 end) involving exponentiation with a large `INTEGER' constant for
815 the right-hand operator (e.g. `I**32767').
817 * Fix build procedures so cross-compiling `g77' (the `fini' utility
818 in particular) is properly built using the host compiler.
820 * Add new `-Wsurprising' option to warn about constructs that are
821 interpreted by the Fortran standard (and `g77') in ways that are
822 surprising to many programmers.
824 * Add `ERF()' and `ERFC()' as generic intrinsics mapping to existing
825 `ERF'/`DERF' and `ERFC'/`DERFC' specific intrinsics.
827 *Note:* You should specify `INTRINSIC ERF,ERFC' in any code where
828 you might use these as generic intrinsics, to improve likelihood
829 of diagnostics (instead of subtle run-time bugs) when using a
830 compiler that doesn't support these as intrinsics (e.g. `f2c').
832 * Remove from `-fno-pedantic' the diagnostic about `DO' with
833 non-`INTEGER' index variable; issue that under `-Wsurprising'
836 * Clarify some diagnostics that say things like "ignored" when that's
839 * Clarify diagnostic on use of `.EQ.'/`.NE.' on `LOGICAL' operands.
841 * Minor improvements to code generation for various operations on
844 * Minor improvement to code generation for some `DO' loops on some
847 * Support `gcc' version 2.7.1.
849 * Upgrade to `libf2c' as of 1995-11-15.
854 * Fix a code-generation bug involving complicated `EQUIVALENCE'
855 statements not involving `COMMON'.
857 * Fix code-generation bugs involving invoking "gratis" library
858 procedures in `libf2c' from code compiled with `-fno-f2c' by
859 making these procedures known to `g77' as intrinsics (not affected
860 by -fno-f2c). This is known to fix code invoking `ERF()',
861 `ERFC()', `DERF()', and `DERFC()'.
863 * Update `libf2c' to include netlib patches through 1995-08-16, and
864 `#define' `WANT_LEAD_0' to 1 to make `g77'-compiled code more
865 consistent with other Fortran implementations by outputting
866 leading zeros in formatted and list-directed output.
868 * Fix a code-generation bug involving adjustable dummy arrays with
869 high bounds whose primaries are changed during procedure
870 execution, and which might well improve code-generation
871 performance for such arrays compared to `f2c' plus `gcc' (but
872 apparently only when using `gcc-2.7.0' or later).
874 * Fix a code-generation bug involving invocation of `COMPLEX' and
875 `DOUBLE COMPLEX' `FUNCTION's and doing `COMPLEX' and `DOUBLE
876 COMPLEX' divides, when the result of the invocation or divide is
877 assigned directly to a variable that overlaps one or more of the
878 arguments to the invocation or divide.
880 * Fix crash by not generating new optimal code for `X**I' if `I' is
881 nonconstant and the expression is used to dimension a dummy array,
882 since the `gcc' back end does not support the necessary mechanics
883 (and the `gcc' front end rejects the equivalent construct, as it
886 * Fix crash on expressions like `COMPLEX**INTEGER'.
888 * Fix crash on expressions like `(1D0,2D0)**2', i.e. raising a
889 `DOUBLE COMPLEX' constant to an `INTEGER' constant power.
891 * Fix crashes and such involving diagnosed code.
893 * Diagnose, instead of crashing on, statement function definitions
894 having duplicate dummy argument names.
896 * Fix bug causing rejection of good code involving statement function
899 * Fix bug resulting in debugger not knowing size of local equivalence
900 area when any member of area has initial value (via `DATA', for
903 * Fix installation bug that prevented installation of `g77' driver.
904 Provide for easy selection of whether to install copy of `g77' as
905 `f77' to replace the broken code.
907 * Fix `gcc' driver (affects `g77' thereby) to not gratuitously
908 invoke the `f771' program (e.g. when `-E' is specified).
910 * Fix diagnostic to point to correct source line when it immediately
911 follows an `INCLUDE' statement.
913 * Support more compiler options in `gcc'/`g77' when compiling
914 Fortran files. These options include `-p', `-pg', `-aux-info',
915 `-P', correct setting of version-number macros for preprocessing,
916 full recognition of `-O0', and automatic insertion of
917 configuration-specific linker specs.
919 * Add new intrinsics that interface to existing routines in `libf2c':
920 `ABORT', `DERF', `DERFC', `ERF', `ERFC', `EXIT', `FLUSH',
921 `GETARG', `GETENV', `IARGC', `SIGNAL', and `SYSTEM'. Note that
922 `ABORT', `EXIT', `FLUSH', `SIGNAL', and `SYSTEM' are intrinsic
923 subroutines, not functions (since they have side effects), so to
924 get the return values from `SIGNAL' and `SYSTEM', append a final
925 argument specifying an `INTEGER' variable or array element (e.g.
926 `CALL SYSTEM('rm foo',ISTAT)').
928 * Add new intrinsic group named `unix' to contain the new intrinsics,
929 and by default enable this new group.
931 * Move `LOC()' intrinsic out of the `vxt' group to the new `unix'
934 * Improve `g77' so that `g77 -v' by itself (or with certain other
935 options, including `-B', `-b', `-i', `-nostdlib', and `-V')
936 reports lots more useful version info, and so that long-form
937 options `gcc' accepts are understood by `g77' as well (even in
938 truncated, unambiguous forms).
940 * Add new `g77' option `--driver=name' to specify driver when
941 default, `gcc', isn't appropriate.
943 * Add support for `#' directives (as output by the preprocessor) in
944 the compiler, and enable generation of those directives by the
945 preprocessor (when compiling `.F' files) so diagnostics and
946 debugging info are more useful to users of the preprocessor.
948 * Produce better diagnostics, more like `gcc', with info such as `In
949 function `foo':' and `In file included from...:'.
951 * Support `gcc''s `-fident' and `-fno-ident' options.
953 * When `-Wunused' in effect, don't warn about local variables used as
954 statement-function dummy arguments or `DATA' implied-`DO' iteration
955 variables, even though, strictly speaking, these are not uses of
956 the variables themselves.
958 * When `-W -Wunused' in effect, don't warn about unused dummy
959 arguments at all, since there's no way to turn this off for
960 individual cases (`g77' might someday start warning about
961 these)--applies to `gcc' versions 2.7.0 and later, since earlier
962 versions didn't warn about unused dummy arguments.
964 * New option `-fno-underscoring' that inhibits transformation of
965 names (by appending one or two underscores) so users may experiment
966 with implications of such an environment.
968 * Minor improvement to `gcc/f/info' module to make it easier to build
969 `g77' using the native (non-`gcc') compiler on certain machines
970 (but definitely not all machines nor all non-`gcc' compilers).
971 Please do not report bugs showing problems compilers have with
972 macros defined in `gcc/f/target.h' and used in places like
975 * Add warning to be printed for each invocation of the compiler if
976 the target machine `INTEGER', `REAL', or `LOGICAL' size is not 32
977 bits, since `g77' is known to not work well for such cases (to be
978 fixed in Version 0.6--*note Actual Bugs We Haven't Fixed Yet:
981 * Lots of new documentation (though work is still needed to put it
982 into canonical GNU format).
984 * Build `libf2c' with `-g0', not `-g2', in effect (by default), to
985 produce smaller library without lots of debugging clutter.
990 * Fix bad code generation involving `X**I' and temporary, internal
991 variables generated by `g77' and the back end (such as for `DO'
994 * Fix crash given `CHARACTER A;DATA A/.TRUE./'.
996 * Replace crash with diagnostic given `CHARACTER A;DATA A/1.0/'.
998 * Fix crash or other erratic behavior when null character constant
999 (`''') is encountered.
1001 * Fix crash or other erratic behavior involving diagnosed code.
1003 * Fix code generation for external functions returning type `REAL'
1004 when the `-ff2c' option is in force (which it is by default) so
1005 that `f2c' compatibility is indeed provided.
1007 * Disallow `COMMON I(10)' if `I' has previously been specified with
1008 an array declarator.
1010 * New `-ffixed-line-length-N' option, where N is the maximum length
1011 of a typical fixed-form line, defaulting to 72 columns, such that
1012 characters beyond column N are ignored, or N is `none', meaning no
1013 characters are ignored. does not affect lines with `&' in column
1014 1, which are always processed as if `-ffixed-line-length-none' was
1017 * No longer generate better code for some kinds of array references,
1018 as `gcc' back end is to be fixed to do this even better, and it
1019 turned out to slow down some code in some cases after all.
1021 * In `COMMON' and `EQUIVALENCE' areas with any members given initial
1022 values (e.g. via `DATA'), uninitialized members now always
1023 initialized to binary zeros (though this is not required by the
1024 standard, and might not be done in future versions of `g77').
1025 Previously, in some `COMMON'/`EQUIVALENCE' areas (essentially
1026 those with members of more than one type), the uninitialized
1027 members were initialized to spaces, to cater to `CHARACTER' types,
1028 but it seems no existing code expects that, while much existing
1029 code expects binary zeros.
1034 * Don't emit bad code when low bound of adjustable array is
1035 nonconstant and thus might vary as an expression at run time.
1037 * Emit correct code for calculation of number of trips in `DO' loops
1038 for cases where the loop should not execute at all. (This bug
1039 affected cases where the difference between the begin and end
1040 values was less than the step count, though probably not for
1041 floating-point cases.)
1043 * Fix crash when extra parentheses surround item in `DATA'
1046 * Fix crash over minor internal inconsistencies in handling
1047 diagnostics, just substitute dummy strings where necessary.
1049 * Fix crash on some systems when compiling call to `MVBITS()'
1052 * Fix crash on array assignment `TYPEDDD(...)=...', where DDD is a
1053 string of one or more digits.
1055 * Fix crash on `DCMPLX()' with a single `INTEGER' argument.
1057 * Fix various crashes involving code with diagnosed errors.
1059 * Support `-I' option for `INCLUDE' statement, plus `gcc''s
1060 `header.gcc' facility for handling systems like MS-DOS.
1062 * Allow `INCLUDE' statement to be continued across multiple lines,
1063 even allow it to coexist with other statements on the same line.
1065 * Incorporate Bellcore fixes to `libf2c' through 1995-03-15--this
1066 fixes a bug involving infinite loops reading EOF with empty
1067 list-directed I/O list.
1069 * Remove all the `g77'-specific auto-configuration scripts, code,
1070 and so on, except for temporary substitutes for bsearch() and
1071 strtoul(), as too many configure/build problems were reported in
1072 these areas. People will have to fix their systems' problems
1073 themselves, or at least somewhere other than `g77', which expects
1074 a working ANSI C environment (and, for now, a GNU C compiler to
1075 compile `g77' itself).
1077 * Complain if initialized common redeclared as larger in subsequent
1080 * Warn if blank common initialized, since its size can vary and hence
1081 related warnings that might be helpful won't be seen.
1083 * New `-fbackslash' option, on by default, that causes `\' within
1084 `CHARACTER' and Hollerith constants to be interpreted a la GNU C.
1085 Note that this behavior is somewhat different from `f2c''s, which
1086 supports only a limited subset of backslash (escape) sequences.
1088 * Make `-fugly-args' the default.
1090 * New `-fugly-init' option, on by default, that allows
1091 typeless/Hollerith to be specified as initial values for variables
1092 or named constants (`PARAMETER'), and also allows
1093 character<->numeric conversion in those contexts--turn off via
1096 * New `-finit-local-zero' option to initialize local variables to
1097 binary zeros. This does not affect whether they are `SAVE'd, i.e.
1098 made automatic or static.
1100 * New `-Wimplicit' option to warn about implicitly typed variables,
1101 arrays, and functions. (Basically causes all program units to
1102 default to `IMPLICIT NONE'.)
1104 * `-Wall' now implies `-Wuninitialized' as with `gcc' (i.e. unless
1105 `-O' not specified, since `-Wuninitialized' requires `-O'), and
1106 implies `-Wunused' as well.
1108 * `-Wunused' no longer gives spurious messages for unused `EXTERNAL'
1109 names (since they are assumed to refer to block data program
1110 units, to make use of libraries more reliable).
1112 * Support `%LOC()' and `LOC()' of character arguments.
1114 * Support null (zero-length) character constants and expressions.
1116 * Support `f2c''s `IMAG()' generic intrinsic.
1118 * Support `ICHAR()', `IACHAR()', and `LEN()' of character
1119 expressions that are valid in assignments but not normally as
1122 * Support `f2c'-style `&' in column 1 to mean continuation line.
1124 * Allow `NAMELIST', `EXTERNAL', `INTRINSIC', and `VOLATILE' in
1125 `BLOCK DATA', even though these are not allowed by the standard.
1127 * Allow `RETURN' in main program unit.
1129 * Changes to Hollerith-constant support to obey Appendix C of the
1132 - Now padded on the right with zeros, not spaces.
1134 - Hollerith "format specifications" in the form of arrays of
1135 non-character allowed.
1137 - Warnings issued when non-space truncation occurs when
1138 converting to another type.
1140 - When specified as actual argument, now passed by reference to
1141 `INTEGER' (padded on right with spaces if constant too small,
1142 otherwise fully intact if constant wider the `INTEGER' type)
1143 instead of by value.
1145 *Warning:* `f2c' differs on the interpretation of `CALL FOO(1HX)',
1146 which it treats exactly the same as `CALL FOO('X')', but which the
1147 standard and `g77' treat as `CALL FOO(%REF('X '))' (padded with
1148 as many spaces as necessary to widen to `INTEGER'), essentially.
1150 * Changes and fixes to typeless-constant support:
1152 - Now treated as a typeless double-length `INTEGER' value.
1154 - Warnings issued when overflow occurs.
1156 - Padded on the left with zeros when converting to a larger
1159 - Should be properly aligned and ordered on the target machine
1160 for whatever type it is turned into.
1162 - When specified as actual argument, now passed as reference to
1163 a default `INTEGER' constant.
1165 * `%DESCR()' of a non-`CHARACTER' expression now passes a pointer to
1166 the expression plus a length for the expression just as if it were
1167 a `CHARACTER' expression. For example, `CALL FOO(%DESCR(D))',
1168 where `D' is `REAL*8', is the same as `CALL FOO(D,%VAL(8)))'.
1170 * Name of multi-entrypoint master function changed to incorporate
1171 the name of the primary entry point instead of a decimal value, so
1172 the name of the master function for `SUBROUTINE X' with alternate
1173 entry points is now `__g77_masterfun_x'.
1175 * Remove redundant message about zero-step-count `DO' loops.
1177 * Clean up diagnostic messages, shortening many of them.
1179 * Fix typo in `g77' man page.
1181 * Clarify implications of constant-handling bugs in `f/BUGS'.
1183 * Generate better code for `**' operator with a right-hand operand of
1186 * Generate better code for `SQRT()' and `DSQRT()', also when
1187 `-ffast-math' specified, enable better code generation for `SIN()'
1190 * Generate better code for some kinds of array references.
1192 * Speed up lexing somewhat (this makes the compilation phase