aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDave Love <fx@gcc.gnu.org>1998-05-22 10:55:21 +0000
committerDave Love <fx@gcc.gnu.org>1998-05-22 10:55:21 +0000
commit43ebf5a44579bd6ea7b1355c24aa56a73be68a05 (patch)
tree31fec69735e89d3e68dd43bcc7f1120418634fc0 /gcc
parent2929d7a2a0b6d5d3be66a4261b958104030077bf (diff)
downloadgcc-43ebf5a44579bd6ea7b1355c24aa56a73be68a05.zip
gcc-43ebf5a44579bd6ea7b1355c24aa56a73be68a05.tar.gz
gcc-43ebf5a44579bd6ea7b1355c24aa56a73be68a05.tar.bz2
JCB update.
From-SVN: r19958
Diffstat (limited to 'gcc')
-rw-r--r--gcc/f/g77.texi161
-rw-r--r--gcc/f/news.texi65
2 files changed, 199 insertions, 27 deletions
diff --git a/gcc/f/g77.texi b/gcc/f/g77.texi
index 79cdd1f..dfd0c6b 100644
--- a/gcc/f/g77.texi
+++ b/gcc/f/g77.texi
@@ -14,7 +14,7 @@
@c %**start of header
@setfilename g77.info
-@set last-up-date 1998-05-19
+@set last-up-date 1998-05-22
@set version-g77 0.5.23
@c @setfilename useg77.info
@@ -8119,23 +8119,148 @@ avoid clashes with C++ reserved words in addition to those in C@.
@cindex startup code
@cindex runtime initialization
@cindex initialization, runtime
-Unlike with some runtime systems, it shouldn't be necessary (unless there are
-bugs) to use a Fortran main program to ensure the
-runtime---specifically the i/o system---is initialized.
-However, to use
-the @code{g77} intrinsics @code{GETARG()} and @code{IARGC()} the
-@code{main()} routine from the @file{libf2c} library must be used, either
-explicitly or implicitly by using a Fortran main program.
-This
-@code{main()} program calls @code{MAIN__()} (where the names are C-type
-@code{extern} names, i.e.@ not mangled).
-You need to provide this
-nullary procedure as the entry point for your C code if using
-@file{libf2c}'s @code{main}.
-In some cases it might be necessary to
-provide a dummy version of this to avoid linkers complaining about
-failure to resolve @code{MAIN__()} if linking against @file{libf2c} and
-not using @code{main()} from it.
+Unlike with some runtime systems,
+it shouldn't be necessary
+(unless there are bugs)
+to use a Fortran main program unit to ensure the
+runtime---specifically the I/O system---is initialized.
+
+However, to use the @code{g77} intrinsics @code{GETARG} and @code{IARGC},
+either the @code{main} routine from the @file{libg2c} library must be used,
+or the @code{f_setarg} routine
+(new as of @code{egcs} version 1.1 and @code{g77} version 0.5.23)
+must be called with the appropriate @code{argc} and @code{argv} arguments
+prior to the program calling @code{GETARG} or @code{IARGC}.
+
+To provide more flexibility for mixed-language programming
+involving @code{g77} while allowing for shared libraries,
+as of @code{egcs} version 1.1 and @code{g77} version 0.5.23,
+@code{g77}'s @code{main} routine in @code{libg2c}
+does the following, in order:
+
+@enumerate
+@item
+Calls @code{f_setarg}
+with the incoming @code{argc} and @code{argv} arguments,
+in the same order as for @code{main} itself.
+
+This sets up the command-line environment
+for @code{GETARG} and @code{IARGC}.
+
+@item
+Calls @code{f_setsig} (with no arguments).
+
+This sets up the signaling and exception environment.
+
+@item
+Calls @code{f_init} (with no arguments).
+
+This initializes the I/O environment,
+though that should not be necessary,
+as all I/O functions in @code{libf2c}
+are believed to call @code{f_init} automatically,
+if necessary.
+
+(A future version of @code{g77} might skip this explicit step,
+to speed up normal exit of a program.)
+
+@item
+Arranges for @code{f_exit} to be called (with no arguments)
+when the program exits.
+
+This ensures that the I/O environment is properly shut down
+before the program exits normally.
+Otherwise, output buffers might not be fully flushed,
+scratch files might not be deleted, and so on.
+
+The simple way @code{main} does this is
+to call @code{f_exit} itself after calling
+@code{MAIN__} (in the next step).
+
+However, this does not catch the cases where the program
+might call @code{exit} directly,
+instead of using the @code{EXIT} intrinsic
+(implemented as @code{exit_} in @code{libf2c}).
+
+So, @code{main} attempts to use
+the operating environment's @code{onexit} or @code{atexit}
+facility, if available,
+to cause @code{f_exit} to be called automatically
+upon any invocation of @code{exit}.
+
+@item
+Calls @code{MAIN__} (with no arguments).
+
+This starts executing the Fortran main program unit for
+the application.
+(Both @code{g77} and @code{f2c} currently compile a main
+program unit so that its global name is @code{MAIN__}.)
+
+@item
+If no @code{onexit} or @code{atexit} is provided by the system,
+calls @code{f_exit}.
+
+@item
+Calls @code{exit} with a zero argument,
+to signal a successful program termination.
+
+@item
+Returns a zero value to the caller,
+to signal a successful program termination,
+in case @code{exit} doesn't exit on the system.
+@end enumerate
+
+All of the above names are C @code{extern} names,
+i.e.@: not mangled.
+
+When using the @code{main} procedure provided by @code{g77}
+without a Fortran main program unit,
+you need to provide @code{MAIN__}
+as the entry point for your C code.
+(Make sure you link the object file that defines that
+entry point with the rest of your program.)
+
+To provide your own @code{main} procedure
+in place of @code{g77}'s,
+make sure you specify the object file defining that procedure
+@emph{before} @samp{-lg2c} on the @code{g77} command line.
+Since the @samp{-lg2c} option is implicitly provided,
+this is usually straightforward.
+(Use the @samp{--verbose} option to see how and where
+@code{g77} implicitly adds @samp{-lg2c} in a command line
+that will link the program.
+Feel free to specify @samp{-lg2c} explicitly,
+as appropriate.)
+
+However, when providing your own @code{main},
+make sure you perform the appropriate tasks in the
+appropriate order.
+For example, if your @code{main} does not call @code{f_setarg},
+make sure the rest of your application does not call
+@code{GETARG} or @code{IARGC}.
+
+And, if your @code{main} fails to ensure that @code{f_exit}
+is called upon program exit,
+some files might end up incompletely written,
+some scratch files might be left lying around,
+and some existing files being written might be left
+with old data not properly truncated at the end.
+
+Note that, generally, the @code{g77} operating environment
+does not depend on a procedure named @code{MAIN__} actually
+being called prior to any other @code{g77}-compiled code.
+That is, @code{MAIN__} does not, itself,
+set up any important operating-environment characteristics
+upon which other code might depend.
+This might change in future versions of @code{g77},
+with appropriate notification in the release notes.
+
+For more information, consult the source code for the above routines.
+These are in @file{egcs/libf2c/libF77/}, named @file{main.c},
+@file{setarg.c}, @file{setsig.c}, @file{getarg_.c}, and @file{iargc_.c}.
+
+Also, the file @file{egcs/gcc/f/com.c} contains the code @code{g77}
+uses to open-code (inline) references to @code{IARGC}.
@include g77install.texi
diff --git a/gcc/f/news.texi b/gcc/f/news.texi
index 7453e13..7dfa316 100644
--- a/gcc/f/news.texi
+++ b/gcc/f/news.texi
@@ -5,7 +5,7 @@
@c The text of this file appears in the file BUGS
@c in the G77 distribution, as well as in the G77 manual.
-@c 1998-04-20
+@c 1998-05-19
@ifclear NEWSONLY
@node News
@@ -34,14 +34,6 @@ New features
Fixes and enhancements to existing features
@item
-@code{CASE DEFAULT} no longer crashes @code{g77}.
-
-@item
-The @samp{-Wunused} option no longer issues a spurious
-warning about the ``master'' procedure generated by
-@code{g77} for procedures containing @code{ENTRY} statements.
-
-@item
New diagnostics
@item
@@ -100,8 +92,25 @@ because the defaults are optimized for @code{g77} users.)
@item
Support for the @samp{-W} option warning about
integer division by zero.
+
+@item
+The Intel x86-specific option @samp{-malign-double}
+applying to stack-allocated data
+as well as statically-allocate data.
@end itemize
+Note that the @file{gcc/f/gbe/} subdirectory has been removed
+from this distribution as a result of @code{g77} no longer
+including patches for the @code{gcc} back end.
+
+@item
+Fix bugs in the @code{libU77} intrinsic @samp{HostNm}
+that wrote one byte beyond the end of its @samp{CHARACTER}
+argument,
+and in the @code{libU77} intrinsics
+@samp{GMTime} and @samp{LTime}
+that overwrote their arguments.
+
@item
Support @code{gcc} version 2.8,
and remove support for prior versions of @code{gcc}.
@@ -118,6 +127,15 @@ just like @code{gcc}.
@code{CASE DEFAULT} no longer crashes @code{g77}.
@item
+Valid combinations of @code{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 @code{g77}.
+
+@item
@code{g77} no longer installs the @file{f77} command
and @file{f77.1} man page
in the @file{/usr} or @file{/usr/local} heirarchy,
@@ -165,6 +183,18 @@ warning about the ``master'' procedure generated by
@code{g77} for procedures containing @code{ENTRY} statements.
@item
+@code{g77}'s version of @code{libf2c} separates out
+the setting of global state
+(such as command-line arguments and signal handling)
+from @file{main.o} into distinct, new library
+archive members.
+
+This should make it easier to write portable applications
+that have their own (non-Fortran) @code{main()} routine
+to properly set up the @code{libf2c} environment, even
+when @code{libf2c} (now @code{libg2c}) is a shared library.
+
+@item
During the configuration and build process,
@code{g77} creates subdirectories it needs only as it
needs them, thus avoiding unnecessary creation of, for example,
@@ -173,6 +203,23 @@ Other cleaning up of the configuration and build process
has been performed as well.
@item
+Use @code{install-info} to update the directory of
+Info documentation to contain an entry for @code{g77}
+(during installation).
+
+@item
+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 @code{OPEN}, @code{INQUIRE}, @code{READ}, and
+@code{WRITE} statements,
+and about truncations of various sorts of constants.
+
+@item
+Improve documentation and indexing.
+
+@item
Upgrade to @code{libf2c} as of 1998-04-20.
This should fix a variety of problems, including