Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 Standard preamble: ========================================================================
\\$1
..
..
..
..
Set up some character translations and predefined strings. \*(-- will give an unbreakable dash, \*(PI will give pi, \*(L" will give a left double quote, and \*(R" will give a right double quote. | will give a real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to do unbreakable dashes and therefore won't be available. \*(C` and \*(C' expand to `' in nroff, nothing in troff, for use with C<>..tr \(*W-|\(bv\*(Tr
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
If the F register is turned on, we'll generate index entries on stderr for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index entries marked with X<> in POD. Of course, you'll have to process the output yourself in some meaningful fashion.. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
For nroff, turn off justification. Always turn off hyphenation; it makes way too many mistakes in technical documents. Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #]
.\}
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
. \" corrections for vroff
. \" for low resolution devices (crt and lpr)
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
======================================================================== Title "G77 1" G77 1 "2004-11-05" "gcc-3.4.3" "GNU"
"NAME"
g77 - GNU project Fortran 77 compiler
"SYNOPSIS"
Header "SYNOPSIS" g77 [
-c|
-S|
-E]
[
-g] [
-pg] [
-Olevel]
[
-Wwarn...] [
-pedantic]
[
-Idir...] [
-Ldir...]
[
-Dmacro[=
defn]...] [
-Umacro]
[
-foption...] [
-mmachine-option...]
[
-o outfile]
infile...
Only the most useful options are listed here; see below for the
remainder.
"DESCRIPTION"
Header "DESCRIPTION" The
g77 command supports all the options supported by the
\fBgcc command.
All gcc and g77 options
are accepted both by g77 and by gcc
(as well as any other drivers built at the same time,
such as g++),
since adding g77 to the gcc distribution
enables acceptance of g77 options
by all of the relevant drivers.
In some cases, options have positive and negative forms;
the negative form of -ffoo would be -fno-foo.
This manual documents only one of these two forms, whichever
one is not the default.
"OPTIONS"
Header "OPTIONS" Here is a summary of all the options specific to \s-1GNU\s0 Fortran, grouped
by type. Explanations are in the following sections.
"Overall Options" 4
Item "Overall Options" \fB-fversion -fset-g77-defaults -fno-silent
"Shorthand Options" 4
Item "Shorthand Options" \fB-ff66 -fno-f66 -ff77 -fno-f77 -fno-ugly
"Fortran Language Options" 4
Item "Fortran Language Options" \fB-ffree-form -fno-fixed-form -ff90
\-fvxt -fdollar-ok -fno-backslash
\-fno-ugly-args -fno-ugly-assign -fno-ugly-assumed
\-fugly-comma -fugly-complex -fugly-init -fugly-logint
\-fonetrip -ftypeless-boz
\-fintrin-case-initcap -fintrin-case-upper
\-fintrin-case-lower -fintrin-case-any
\-fmatch-case-initcap -fmatch-case-upper
\-fmatch-case-lower -fmatch-case-any
\-fsource-case-upper -fsource-case-lower
\-fsource-case-preserve
\-fsymbol-case-initcap -fsymbol-case-upper
\-fsymbol-case-lower -fsymbol-case-any
\-fcase-strict-upper -fcase-strict-lower
\-fcase-initcap -fcase-upper -fcase-lower -fcase-preserve
\-ff2c-intrinsics-delete -ff2c-intrinsics-hide
\-ff2c-intrinsics-disable -ff2c-intrinsics-enable
\-fbadu77-intrinsics-delete -fbadu77-intrinsics-hide
\-fbadu77-intrinsics-disable -fbadu77-intrinsics-enable
\-ff90-intrinsics-delete -ff90-intrinsics-hide
\-ff90-intrinsics-disable -ff90-intrinsics-enable
\-fgnu-intrinsics-delete -fgnu-intrinsics-hide
\-fgnu-intrinsics-disable -fgnu-intrinsics-enable
\-fmil-intrinsics-delete -fmil-intrinsics-hide
\-fmil-intrinsics-disable -fmil-intrinsics-enable
\-funix-intrinsics-delete -funix-intrinsics-hide
\-funix-intrinsics-disable -funix-intrinsics-enable
\-fvxt-intrinsics-delete -fvxt-intrinsics-hide
\-fvxt-intrinsics-disable -fvxt-intrinsics-enable
\-ffixed-line-length-
n -ffixed-line-length-none
"Warning Options" 4
Item "Warning Options" \fB-fsyntax-only -pedantic -pedantic-errors -fpedantic
\-w -Wno-globals -Wimplicit -Wunused -Wuninitialized
\-Wall -Wsurprising
\-Werror -W
"Debugging Options" 4
Item "Debugging Options" \fB-g
"Optimization Options" 4
Item "Optimization Options" \fB-malign-double
\-ffloat-store -fforce-mem -fforce-addr -fno-inline
\-ffast-math -fstrength-reduce -frerun-cse-after-loop
\-funsafe-math-optimizations -ffinite-math-only -fno-trapping-math
\-fexpensive-optimizations -fdelayed-branch
\-fschedule-insns -fschedule-insn2 -fcaller-saves
\-funroll-loops -funroll-all-loops
\-fno-move-all-movables -fno-reduce-all-givs
\-fno-rerun-loop-opt
"Directory Options" 4
Item "Directory Options" \fB-I
dir -I-
"Code Generation Options" 4
Item "Code Generation Options" \fB-fno-automatic -finit-local-zero -fno-f2c
\-ff2c-library -fno-underscoring -fno-ident
\-fpcc-struct-return -freg-struct-return
\-fshort-double -fno-common -fpack-struct
\-fzeros -fno-second-underscore
\-femulate-complex
\-falias-check -fargument-alias
\-fargument-noalias -fno-argument-noalias-global
\-fno-globals -fflatten-arrays
\-fbounds-check -ffortran-bounds-check
Compilation can involve as many as four stages: preprocessing, code
generation (often what is really meant by the term ``compilation''),
assembly, and linking, always in that order. The first three
stages apply to an individual source file, and end by producing an
object file; linking combines all the object files (those newly
compiled, and those specified as input) into an executable file.
For any given input file, the file name suffix determines what kind of
program is contained in the file---that is, the language in which the
program is written is generally indicated by the suffix.
Suffixes specific to \s-1GNU\s0 Fortran are listed below.
"file.f" 4
Item "file.f" 0
"file.for" 4
Item "file.for" "file.FOR" 4
Item "file.FOR"
Fortran source code that should not be preprocessed.
.Sp
Such source code cannot contain any preprocessor directives, such
as \*(C`#include\*(C', \*(C`#define\*(C', \*(C`#if\*(C', and so on.
.Sp
You can force .f files to be preprocessed by cpp by using
\fB-x f77-cpp-input.
"file.F" 4
Item "file.F" 0
"file.fpp" 4
Item "file.fpp" "file.FPP" 4
Item "file.FPP"
Fortran source code that must be preprocessed (by the C preprocessor
\fBcpp, which is part of \s-1GCC\s0).
.Sp
Note that preprocessing is not extended to the contents of
files included by the \*(C`INCLUDE\*(C' directive---the \*(C`#include\*(C'
preprocessor directive must be used instead.
"file.r" 4
Item "file.r" Ratfor source code, which must be preprocessed by the
ratfor
command, which is available separately (as it is not yet part of the \s-1GNU\s0
Fortran distribution).
A public domain version in C is at
<
http://sepwww.stanford.edu/sep/prof/ratfor.shar.2>.
\s-1UNIX\s0 users typically use the file.f and file.F
nomenclature.
Users of other operating systems, especially those that cannot
distinguish upper-case
letters from lower-case letters in their file names, typically use
the file.for and file.fpp nomenclature.
Use of the preprocessor cpp allows use of C-like
constructs such as \*(C`#define\*(C' and \*(C`#include\*(C', but can
lead to unexpected, even mistaken, results due to Fortran's source file
format.
It is recommended that use of the C preprocessor
be limited to \*(C`#include\*(C' and, in
conjunction with \*(C`#define\*(C', only \*(C`#if\*(C' and related directives,
thus avoiding in-line macro expansion entirely.
This recommendation applies especially
when using the traditional fixed source form.
With free source form,
fewer unexpected transformations are likely to happen, but use of
constructs such as Hollerith and character constants can nevertheless
present problems, especially when these are continued across multiple
source lines.
These problems result, primarily, from differences between the way
such constants are interpreted by the C preprocessor and by a Fortran
compiler.
Another example of a problem that results from using the C preprocessor
is that a Fortran comment line that happens to contain any
characters ``interesting'' to the C preprocessor,
such as a backslash at the end of the line,
is not recognized by the preprocessor as a comment line,
so instead of being passed through ``raw'',
the line is edited according to the rules for the preprocessor.
For example, the backslash at the end of the line is removed,
along with the subsequent newline, resulting in the next
line being effectively commented out---unfortunate if that
line is a non-comment line of important code!
\fINote: The -traditional and -undef flags are supplied
to cpp by default, to help avoid unpleasant surprises.
This means that \s-1ANSI\s0 C preprocessor features (such as the #
operator) aren't available, and only variables in the C reserved
namespace (generally, names with a leading underscore) are liable to
substitution by C predefines.
Thus, if you want to do system-specific
tests, use, for example, #ifdef _\|_linux_\|_ rather than #ifdef linux.
Use the -v option to see exactly how the preprocessor is invoked.
Unfortunately, the -traditional flag will not avoid an error from
anything that cpp sees as an unterminated C comment, such as:
.Vb 2
C Some Fortran compilers accept /* as starting
C an inline comment.
.Ve
The following options that affect overall processing are recognized
by the g77 and gcc commands in a \s-1GNU\s0 Fortran installation:
"-fversion" 4
Item "-fversion" Ensure that the
g77 version of the compiler phase is reported,
if run,
and, starting in
\*(C`egcs\*(C' version 1.1,
that internal consistency checks in the
f771 program are run.
.Sp
This option is supplied automatically when
-v or
--verbose
is specified as a command-line option for
g77 or
gcc
and when the resulting commands compile Fortran source files.
.Sp
In \s-1GCC\s0 3.1, this is changed back to the behavior
gcc displays
for
.c files.
"-fset-g77-defaults" 4
Item "-fset-g77-defaults" \fIVersion info:
This option was obsolete as of
\*(C`egcs\*(C'
version 1.1.
The effect is instead achieved
by the
\*(C`lang_init_options\*(C' routine
in
gcc/gcc/f/com.c.
.Sp
Set up whatever
gcc options are to apply to Fortran
compilations, and avoid running internal consistency checks
that might take some time.
.Sp
This option is supplied automatically when compiling Fortran code
via the
g77 or
gcc command.
The description of this option is provided so that users seeing
it in the output of, say,
g77 -v understand why it is
there.
.Sp
Also, developers who run
\*(C`f771\*(C' directly might want to specify it
by hand to get the same defaults as they would running
\*(C`f771\*(C'
via
g77 or
gcc
However, such developers should, after linking a new
\*(C`f771\*(C'
executable, invoke it without this option once,
e.g. via
\*(C`./f771 -quiet < /dev/null\*(C',
to ensure that they have not introduced any
internal inconsistencies (such as in the table of
intrinsics) before proceeding---
g77 will crash
with a diagnostic if it detects an inconsistency.
"-fno-silent" 4
Item "-fno-silent" Print (to
\*(C`stderr\*(C') the names of the program units as
they are compiled, in a form similar to that used by popular
\s-1UNIX\s0
f77 implementations and
f2c
.Sh "Shorthand Options"
Subsection "Shorthand Options" The following options serve as ``shorthand''
for other options accepted by the compiler:
"-fugly" 4
Item "-fugly" \fINote: This option is no longer supported.
The information, below, is provided to aid
in the conversion of old scripts.
.Sp
Specify that certain ``ugly'' constructs are to be quietly accepted.
Same as:
.Sp
.Vb 3
-fugly-args -fugly-assign -fugly-assumed
-fugly-comma -fugly-complex -fugly-init
-fugly-logint
.Ve
.Sp
These constructs are considered inappropriate to use in new
or well-maintained portable Fortran code, but widely used
in old code.
"-fno-ugly" 4
Item "-fno-ugly" Specify that all ``ugly'' constructs are to be noisily rejected.
Same as:
.Sp
.Vb 3
-fno-ugly-args -fno-ugly-assign -fno-ugly-assumed
-fno-ugly-comma -fno-ugly-complex -fno-ugly-init
-fno-ugly-logint
.Ve
"-ff66" 4
Item "-ff66" Specify that the program is written in idiomatic \s-1FORTRAN\s0 66.
Same as
-fonetrip -fugly-assumed.
.Sp
The
-fno-f66 option is the inverse of
-ff66.
As such, it is the same as
-fno-onetrip -fno-ugly-assumed.
.Sp
The meaning of this option is likely to be refined as future
versions of
g77 provide more compatibility with other
existing and obsolete Fortran implementations.
"-ff77" 4
Item "-ff77" Specify that the program is written in idiomatic \s-1UNIX\s0 \s-1FORTRAN\s0 77
and/
or the dialect accepted by the
f2c product.
Same as
-fbackslash -fno-typeless-boz.
.Sp
The meaning of this option is likely to be refined as future
versions of
g77 provide more compatibility with other
existing and obsolete Fortran implementations.
"-fno-f77" 4
Item "-fno-f77" The
-fno-f77 option is
not the inverse
of
-ff77.
It specifies that the program is not written in idiomatic \s-1UNIX\s0
\s-1FORTRAN\s0 77 or
f2c but in a more widely portable dialect.
\fB-fno-f77 is the same as
-fno-backslash.
.Sp
The meaning of this option is likely to be refined as future
versions of
g77 provide more compatibility with other
existing and obsolete Fortran implementations.
.Sh "Options Controlling Fortran Dialect"
Subsection "Options Controlling Fortran Dialect" The following options control the dialect of Fortran
that the compiler accepts:
"-ffree-form" 4
Item "-ffree-form" 0
"-fno-fixed-form" 4
Item "-fno-fixed-form"
Specify that the source file is written in free form
(introduced in Fortran 90) instead of the more-traditional fixed form.
"-ff90" 4
Item "-ff90" Allow certain Fortran-90 constructs.
.Sp
This option controls whether certain
Fortran 90 constructs are recognized.
(Other Fortran 90 constructs
might or might not be recognized depending on other options such as
\fB-fvxt,
-ff90-intrinsics-enable, and the
current level of support for Fortran 90.)
"-fvxt" 4
Item "-fvxt" Specify the treatment of certain constructs that have different
meanings depending on whether the code is written in
\s-1GNU\s0 Fortran (based on \s-1FORTRAN\s0 77 and akin to Fortran 90)
or \s-1VXT\s0 Fortran (more like \s-1VAX\s0 \s-1FORTRAN\s0).
.Sp
The default is
-fno-vxt.
\fB-fvxt specifies that the \s-1VXT\s0 Fortran interpretations
for those constructs are to be chosen.
"-fdollar-ok" 4
Item "-fdollar-ok" Allow
$ as a valid character in a symbol name.
"-fno-backslash" 4
Item "-fno-backslash" Specify that
\e is not to be specially interpreted in character
and Hollerith constants a la C and many \s-1UNIX\s0 Fortran compilers.
.Sp
For example, with
-fbackslash in effect,
A\enB specifies
three characters, with the second one being newline.
With
-fno-backslash, it specifies four characters,
\fBA,
\e,
n, and
B.
.Sp
Note that
g77 implements a fairly general form of backslash
processing that is incompatible with the narrower forms supported
by some other compilers.
For example,
'A\e003B' is a three-character string in
g77
whereas other compilers that support backslash might not support
the three-octal-digit form, and thus treat that string as longer
than three characters.
"-fno-ugly-args" 4
Item "-fno-ugly-args" Disallow passing Hollerith and typeless constants as actual
arguments (for example,
\s-1CALL\s0 \s-1FOO\s0(4HABCD)).
"-fugly-assign" 4
Item "-fugly-assign" Use the same storage for a given variable regardless of
whether it is used to hold an assigned-statement label
(as in
\s-1ASSIGN\s0 10 \s-1TO\s0 I) or used to hold numeric data
(as in
I = 3).
"-fugly-assumed" 4
Item "-fugly-assumed" Assume any dummy array with a final dimension specified as
1
is really an assumed-size array, as if
* had been specified
for the final dimension instead of
1.
.Sp
For example,
\s-1DIMENSION\s0 X(1) is treated as if it
had read
\s-1DIMENSION\s0 X(*).
"-fugly-comma" 4
Item "-fugly-comma" In an external-procedure invocation,
treat a trailing comma in the argument list
as specification of a trailing null argument,
and treat an empty argument list
as specification of a single null argument.
.Sp
For example,
\s-1CALL\s0 \s-1FOO\s0(,) is treated as
\fB\s-1CALL\s0 \s-1FOO\s0(%\f(BIVAL
\|(0), %\f(BIVAL\|(0)).
That is, two null arguments are specified
by the procedure call when -fugly-comma is in force.
And F = \s-1\f(BIFUNC\s0() is treated as F = \s-1FUNC\s0(%\f(BIVAL\|(0)).
.Sp
The default behavior, -fno-ugly-comma, is to ignore
a single trailing comma in an argument list.
So, by default, \s-1CALL\s0 \s-1FOO\s0(X,) is treated
exactly the same as \s-1CALL\s0 \s-1FOO\s0(X).
"-fugly-complex" 4
Item "-fugly-complex" Do not complain about
\s-1REAL\s0(expr) or
\fB\s-1AIMAG\s0(
expr) when
expr is a
\*(C`COMPLEX\*(C'
type other than
\*(C`COMPLEX(KIND=1)\*(C'---usually
this is used to permit
\*(C`COMPLEX(KIND=2)\*(C'
(
\*(C`DOUBLE COMPLEX\*(C') operands.
.Sp
The
-ff90 option controls the interpretation
of this construct.
"-fno-ugly-init" 4
Item "-fno-ugly-init" Disallow use of Hollerith and typeless constants as initial
values (in
\*(C`PARAMETER\*(C' and
\*(C`DATA\*(C' statements), and
use of character constants to
initialize numeric types and vice versa.
.Sp
For example,
\s-1DATA\s0 I/'F'/, \s-1CHRVAR/65/\s0, J/4HABCD/ is disallowed by
\fB-fno-ugly-init.
"-fugly-logint" 4
Item "-fugly-logint" Treat
\*(C`INTEGER\*(C' and
\*(C`LOGICAL\*(C' variables and
expressions as potential stand-ins for each other.
.Sp
For example, automatic conversion between
\*(C`INTEGER\*(C' and
\f(CW\*(C`LOGICAL\*(C' is enabled, for many contexts, via this option.
"-fonetrip" 4
Item "-fonetrip" Executable iterative
\*(C`DO\*(C' loops are to be executed at
least once each time they are reached.
.Sp
\s-1ANSI\s0 \s-1FORTRAN\s0 77 and more recent versions of the Fortran standard
specify that the body of an iterative
\*(C`DO\*(C' loop is not executed
if the number of iterations calculated from the parameters of the
loop is less than 1.
(For example,
\s-1DO\s0 10 I = 1, 0.)
Such a loop is called a
zero-trip loop.
.Sp
Prior to \s-1ANSI\s0 \s-1FORTRAN\s0 77, many compilers implemented
\*(C`DO\*(C' loops
such that the body of a loop would be executed at least once, even
if the iteration count was zero.
Fortran code written assuming this behavior is said to require
\fIone-trip loops.
For example, some code written to the \s-1FORTRAN\s0 66 standard
expects this behavior from its
\*(C`DO\*(C' loops, although that
standard did not specify this behavior.
.Sp
The
-fonetrip option specifies that the source file(s) being
compiled require one-trip loops.
.Sp
This option affects only those loops specified by the (iterative)
\*(C`DO\*(C'
statement and by implied-
\*(C`DO\*(C' lists in I/O statements.
Loops specified by implied-
\*(C`DO\*(C' lists in
\*(C`DATA\*(C' and
specification (non-executable) statements are not affected.
"-ftypeless-boz" 4
Item "-ftypeless-boz" Specifies that prefix-radix non-decimal constants, such as
\fBZ'\s-1ABCD\s0', are typeless instead of
\*(C`INTEGER(KIND=1)\*(C'.
.Sp
You can test for yourself whether a particular compiler treats
the prefix form as
\*(C`INTEGER(KIND=1)\*(C' or typeless by running the
following program:
.Sp
.Vb 6
EQUIVALENCE (I, R)
R = Z'ABCD1234'
J = Z'ABCD1234'
IF (J .EQ. I) PRINT *, 'Prefix form is TYPELESS'
IF (J .NE. I) PRINT *, 'Prefix form is INTEGER'
END
.Ve
.Sp
Reports indicate that many compilers process this form as
\f(CW\*(C`INTEGER(KIND=1)\*(C', though a few as typeless, and at least one
based on a command-line option specifying some kind of
compatibility.
"-fintrin-case-initcap" 4
Item "-fintrin-case-initcap" 0
"-fintrin-case-upper" 4
Item "-fintrin-case-upper" "-fintrin-case-lower" 4
Item "-fintrin-case-lower" "-fintrin-case-any" 4
Item "-fintrin-case-any"
Specify expected case for intrinsic names.
\fB-fintrin-case-lower is the default.
"-fmatch-case-initcap" 4
Item "-fmatch-case-initcap" 0
"-fmatch-case-upper" 4
Item "-fmatch-case-upper" "-fmatch-case-lower" 4
Item "-fmatch-case-lower" "-fmatch-case-any" 4
Item "-fmatch-case-any"
Specify expected case for keywords.
\fB-fmatch-case-lower is the default.
"-fsource-case-upper" 4
Item "-fsource-case-upper" 0
"-fsource-case-lower" 4
Item "-fsource-case-lower" "-fsource-case-preserve" 4
Item "-fsource-case-preserve"
Specify whether source text other than character and Hollerith constants
is to be translated to uppercase, to lowercase, or preserved as is.
\fB-fsource-case-lower is the default.
"-fsymbol-case-initcap" 4
Item "-fsymbol-case-initcap" 0
"-fsymbol-case-upper" 4
Item "-fsymbol-case-upper" "-fsymbol-case-lower" 4
Item "-fsymbol-case-lower" "-fsymbol-case-any" 4
Item "-fsymbol-case-any"
Specify valid cases for user-defined symbol names.
\fB-fsymbol-case-any is the default.
"-fcase-strict-upper" 4
Item "-fcase-strict-upper" Same as
-fintrin-case-upper -fmatch-case-upper -fsource-case-preserve
\-fsymbol-case-upper.
(Requires all pertinent source to be in uppercase.)
"-fcase-strict-lower" 4
Item "-fcase-strict-lower" Same as
-fintrin-case-lower -fmatch-case-lower -fsource-case-preserve
\-fsymbol-case-lower.
(Requires all pertinent source to be in lowercase.)
"-fcase-initcap" 4
Item "-fcase-initcap" Same as
-fintrin-case-initcap -fmatch-case-initcap -fsource-case-preserve
\-fsymbol-case-initcap.
(Requires all pertinent source to be in initial capitals,
as in
Print *,SqRt(Value).)
"-fcase-upper" 4
Item "-fcase-upper" Same as
-fintrin-case-any -fmatch-case-any -fsource-case-upper
\-fsymbol-case-any.
(Maps all pertinent source to uppercase.)
"-fcase-lower" 4
Item "-fcase-lower" Same as
-fintrin-case-any -fmatch-case-any -fsource-case-lower
\-fsymbol-case-any.
(Maps all pertinent source to lowercase.)
"-fcase-preserve" 4
Item "-fcase-preserve" Same as
-fintrin-case-any -fmatch-case-any -fsource-case-preserve
\-fsymbol-case-any.
(Preserves all case in user-defined symbols,
while allowing any-case matching of intrinsics and keywords.
For example,
call Foo(i,I) would pass two
different
variables named
i and
I to a procedure named
Foo.)
"-fbadu77-intrinsics-delete" 4
Item "-fbadu77-intrinsics-delete" 0
"-fbadu77-intrinsics-hide" 4
Item "-fbadu77-intrinsics-hide" "-fbadu77-intrinsics-disable" 4
Item "-fbadu77-intrinsics-disable" "-fbadu77-intrinsics-enable" 4
Item "-fbadu77-intrinsics-enable"
Specify status of \s-1UNIX\s0 intrinsics having inappropriate forms.
\fB-fbadu77-intrinsics-enable is the default.
"-ff2c-intrinsics-delete" 4
Item "-ff2c-intrinsics-delete" 0
"-ff2c-intrinsics-hide" 4
Item "-ff2c-intrinsics-hide" "-ff2c-intrinsics-disable" 4
Item "-ff2c-intrinsics-disable" "-ff2c-intrinsics-enable" 4
Item "-ff2c-intrinsics-enable"
Specify status of f2c-specific intrinsics.
\fB-ff2c-intrinsics-enable is the default.
"-ff90-intrinsics-delete" 4
Item "-ff90-intrinsics-delete" 0
"-ff90-intrinsics-hide" 4
Item "-ff90-intrinsics-hide" "-ff90-intrinsics-disable" 4
Item "-ff90-intrinsics-disable" "-ff90-intrinsics-enable" 4
Item "-ff90-intrinsics-enable"
Specify status of F90-specific intrinsics.
\fB-ff90-intrinsics-enable is the default.
"-fgnu-intrinsics-delete" 4
Item "-fgnu-intrinsics-delete" 0
"-fgnu-intrinsics-hide" 4
Item "-fgnu-intrinsics-hide" "-fgnu-intrinsics-disable" 4
Item "-fgnu-intrinsics-disable" "-fgnu-intrinsics-enable" 4
Item "-fgnu-intrinsics-enable"
Specify status of Digital's COMPLEX-related intrinsics.
\fB-fgnu-intrinsics-enable is the default.
"-fmil-intrinsics-delete" 4
Item "-fmil-intrinsics-delete" 0
"-fmil-intrinsics-hide" 4
Item "-fmil-intrinsics-hide" "-fmil-intrinsics-disable" 4
Item "-fmil-intrinsics-disable" "-fmil-intrinsics-enable" 4
Item "-fmil-intrinsics-enable"
Specify status of MIL-STD-1753-specific intrinsics.
\fB-fmil-intrinsics-enable is the default.
"-funix-intrinsics-delete" 4
Item "-funix-intrinsics-delete" 0
"-funix-intrinsics-hide" 4
Item "-funix-intrinsics-hide" "-funix-intrinsics-disable" 4
Item "-funix-intrinsics-disable" "-funix-intrinsics-enable" 4
Item "-funix-intrinsics-enable"
Specify status of \s-1UNIX\s0 intrinsics.
\fB-funix-intrinsics-enable is the default.
"-fvxt-intrinsics-delete" 4
Item "-fvxt-intrinsics-delete" 0
"-fvxt-intrinsics-hide" 4
Item "-fvxt-intrinsics-hide" "-fvxt-intrinsics-disable" 4
Item "-fvxt-intrinsics-disable" "-fvxt-intrinsics-enable" 4
Item "-fvxt-intrinsics-enable"
Specify status of \s-1VXT\s0 intrinsics.
\fB-fvxt-intrinsics-enable is the default.
"-ffixed-line-length-n" 4
Item "-ffixed-line-length-n" Set column after which characters are ignored in typical fixed-form
lines in the source file, and through which spaces are assumed (as
if padded to that length) after the ends of short fixed-form lines.
.Sp
Popular values for
n include 72 (the
standard and the default), 80 (card image), and 132 (corresponds
to ``extended-source'' options in some popular compilers).
\fIn may be
none, meaning that the entire line is meaningful
and that continued character constants never have implicit spaces appended
to them to fill out the line.
\fB-ffixed-line-length-0 means the same thing as
\fB-ffixed-line-length-none.
.Sh "Options to Request or Suppress Warnings"
Subsection "Options to Request or Suppress Warnings" Warnings are diagnostic messages that report constructions which
are not inherently erroneous but which are risky or suggest there
might have been an error.
You can request many specific warnings with options beginning -W,
for example -Wimplicit to request warnings on implicit
declarations. Each of these specific warning options also has a
negative form beginning -Wno- to turn off warnings;
for example, -Wno-implicit. This manual lists only one of the
two forms, whichever is not the default.
These options control the amount and kinds of warnings produced by \s-1GNU\s0
Fortran:
"-fsyntax-only" 4
Item "-fsyntax-only" Check the code for syntax errors, but don't do anything beyond that.
"-pedantic" 4
Item "-pedantic" Issue warnings for uses of extensions to \s-1ANSI\s0 \s-1FORTRAN\s0 77.
\fB-pedantic also applies to C-language constructs where they
occur in \s-1GNU\s0 Fortran source files, such as use of
\ee in a
character constant within a directive like
#include.
.Sp
Valid \s-1ANSI\s0 \s-1FORTRAN\s0 77 programs should compile properly with or without
this option.
However, without this option, certain \s-1GNU\s0 extensions and traditional
Fortran features are supported as well.
With this option, many of them are rejected.
.Sp
Some users try to use
-pedantic to check programs for strict \s-1ANSI\s0
conformance.
They soon find that it does not do quite what they want---it finds some
non-ANSI practices, but not all.
However, improvements to
g77 in this area are welcome.
"-pedantic-errors" 4
Item "-pedantic-errors" Like
-pedantic, except that errors are produced rather than
warnings.
"-fpedantic" 4
Item "-fpedantic" Like
-pedantic, but applies only to Fortran constructs.
"-w" 4
Item "-w" Inhibit all warning messages.
"-Wno-globals" 4
Item "-Wno-globals" Inhibit warnings about use of a name as both a global name
(a subroutine, function, or block data program unit, or a
common block) and implicitly as the name of an intrinsic
in a source file.
.Sp
Also inhibit warnings about inconsistent invocations
and/
or
definitions of global procedures (function and subroutines).
Such inconsistencies include different numbers of arguments
and different types of arguments.
"-Wimplicit" 4
Item "-Wimplicit" Warn whenever a variable, array, or function is implicitly
declared.
Has an effect similar to using the
\*(C`IMPLICIT NONE\*(C' statement
in every program unit.
(Some Fortran compilers provide this feature by an option
named
-u or
/WARNINGS=DECLARATIONS.)
"-Wunused" 4
Item "-Wunused" Warn whenever a variable is unused aside from its declaration.
"-Wuninitialized" 4
Item "-Wuninitialized" Warn whenever an automatic variable is used without first being initialized.
.Sp
These warnings are possible only in optimizing compilation,
because they require data-flow information that is computed only
when optimizing. If you don't specify
-O, you simply won't
get these warnings.
.Sp
These warnings occur only for variables that are candidates for
register allocation. Therefore, they do not occur for a variable
whose address is taken, or whose size
is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
arrays, even when they are in registers.
.Sp
Note that there might be no warning about a variable that is used only
to compute a value that itself is never used, because such
computations may be deleted by data-flow analysis before the warnings
are printed.
.Sp
These warnings are made optional because \s-1GNU\s0 Fortran is not smart
enough to see all the reasons why the code might be correct
despite appearing to have an error. Here is one example of how
this can happen:
.Sp
.Vb 6
SUBROUTINE DISPAT(J)
IF (J.EQ.1) I=1
IF (J.EQ.2) I=4
IF (J.EQ.3) I=5
CALL FOO(I)
END
.Ve
.Sp
If the value of
\*(C`J\*(C' is always 1, 2 or 3, then
\*(C`I\*(C' is
always initialized, but \s-1GNU\s0 Fortran doesn't know this. Here is
another common case:
.Sp
.Vb 6
SUBROUTINE MAYBE(FLAG)
LOGICAL FLAG
IF (FLAG) VALUE = 9.4
...
IF (FLAG) PRINT *, VALUE
END
.Ve
.Sp
This has no bug because
\*(C`VALUE\*(C' is used only if it is set.
"-Wall" 4
Item "-Wall" The
-Wunused and
-Wuninitialized options combined.
These are all the
options which pertain to usage that we recommend avoiding and that we
believe is easy to avoid.
(As more warnings are added to
g77 some might
be added to the list enabled by
-Wall.)
The remaining -W... options are not implied by -Wall
because they warn about constructions that we consider reasonable to
use, on occasion, in clean programs.
"-Wsurprising" 4
Item "-Wsurprising" Warn about ``suspicious'' constructs that are interpreted
by the compiler in a way that might well be surprising to
someone reading the code.
These differences can result in subtle, compiler-dependent
(even machine-dependent) behavioral differences.
The constructs warned about include:
"\(bu" 4
Expressions having two arithmetic operators in a row, such
as
X*-Y.
Such a construct is nonstandard, and can produce
unexpected results in more complicated situations such
as
X**-Y*Z.
\fBg77 along with many other compilers, interprets
this example differently than many programmers, and a few
other compilers.
Specifically,
g77 interprets
X**-Y*Z as
\fB(X**(-Y))*Z, while others might think it should
be interpreted as
X**(-(Y*Z)).
.Sp
A revealing example is the constant expression
2**-2*1.,
which
g77 evaluates to .25, while others might evaluate
it to 0., the difference resulting from the way precedence affects
type promotion.
.Sp
(The
-fpedantic option also warns about expressions
having two arithmetic operators in a row.)
"\(bu" 4
Expressions with a unary minus followed by an operand and then
a binary operator other than plus or minus.
For example,
-2**2 produces a warning, because
the precedence is
-(2**2), yielding -4, not
\fB(-2)**2, which yields 4, and which might represent
what a programmer expects.
.Sp
An example of an expression producing different results
in a surprising way is
-I*S, where
I holds
the value
-2147483648 and
S holds
0.5.
On many systems, negating
I results in the same
value, not a positive number, because it is already the
lower bound of what an
\*(C`INTEGER(KIND=1)\*(C' variable can hold.
So, the expression evaluates to a positive number, while
the ``expected'' interpretation,
(-I)*S, would
evaluate to a negative number.
.Sp
Even cases such as
-I*J produce warnings,
even though, in most configurations and situations,
there is no computational difference between the
results of the two interpretations---the purpose
of this warning is to warn about differing interpretations
and encourage a better style of coding, not to identify
only those places where bugs might exist in the user's
code.
"\(bu" 4
\f(CW\*(C`DO\*(C' loops with
\*(C`DO\*(C' variables that are not
of integral type---that is, using
\*(C`REAL\*(C'
variables as loop control variables.
Although such loops can be written to work in the
``obvious'' way, the way
g77 is required by the
Fortran standard to interpret such code is likely to
be quite different from the way many programmers expect.
(This is true of all
\*(C`DO\*(C' loops, but the differences
are pronounced for non-integral loop control variables.)
"-Werror" 4
Item "-Werror" Make all warnings into errors.
"-W" 4
Item "-W" Turns on ``extra warnings'' and, if optimization is specified
via
-O, the
-Wuninitialized option.
(This might change in future versions of
g77
.Sp
``Extra warnings'' are issued for:
"\(bu" 4
Unused parameters to a procedure (when
-Wunused also is
specified).
"\(bu" 4
Overflows involving floating-point constants (not available
for certain configurations).
Some of these have no effect when compiling programs written in Fortran:
"-Wcomment" 4
Item "-Wcomment" 0
"-Wformat" 4
Item "-Wformat" "-Wparentheses" 4
Item "-Wparentheses" "-Wswitch" 4
Item "-Wswitch" "-Wswitch-default" 4
Item "-Wswitch-default" "-Wswitch-enum" 4
Item "-Wswitch-enum" "-Wtraditional" 4
Item "-Wtraditional" "-Wshadow" 4
Item "-Wshadow" "-Wid-clash-len" 4
Item "-Wid-clash-len" "-Wlarger-than-len" 4
Item "-Wlarger-than-len" "-Wconversion" 4
Item "-Wconversion" "-Waggregate-return" 4
Item "-Waggregate-return" "-Wredundant-decls" 4
Item "-Wredundant-decls"
These options all could have some relevant meaning for
\s-1GNU\s0 Fortran programs, but are not yet supported.
.Sh "Options for Debugging Your Program or \s-1GNU\s0 Fortran"
Subsection "Options for Debugging Your Program or GNU Fortran" \s-1GNU\s0 Fortran has various special options that are used for debugging
either your program or g77
"-g" 4
Item "-g" Produce debugging information in the operating system's native format
(stabs, \s-1COFF\s0, \s-1XCOFF\s0, or \s-1DWARF\s0). \s-1GDB\s0 can work with this debugging
information.
.Sp
A sample debugging session looks like this (note the use of the breakpoint):
.Sp
.Vb 24
$ cat gdb.f
PROGRAM PROG
DIMENSION A(10)
DATA A /1.,2.,3.,4.,5.,6.,7.,8.,9.,10./
A(5) = 4.
PRINT*,A
END
$ g77 -g -O gdb.f
$ gdb a.out
...
(gdb) break MAIN__
Breakpoint 1 at 0x8048e96: file gdb.f, line 4.
(gdb) run
Starting program: /
home/
toon/
g77-bugs/./a.out
Breakpoint 1, MAIN__ () at gdb.f:4
4 A(5) = 4.
Current language: auto; currently fortran
(gdb) print a(5)
$1 = 5
(gdb) step
5 PRINT*,A
(gdb) print a(5)
$2 = 4
...
.Ve
.Sp
One could also add the setting of the breakpoint and the first run command
to the file
.gdbinit in the current directory, to simplify the debugging
session.
.Sh "Options That Control Optimization"
Subsection "Options That Control Optimization" Most Fortran users will want to use no optimization when
developing and testing programs, and use
-O or
-O2 when
compiling programs for late-cycle testing and for production use.
However, note that certain diagnostics---such as for uninitialized
variables---depend on the flow analysis done by
-O, i.e. you
must use
-O or
-O2 to get such diagnostics.
The following flags have particular applicability when
compiling Fortran programs:
"-malign-double" 4
Item "-malign-double" (Intel x86 architecture only.)
.Sp
Noticeably improves performance of
g77 programs making
heavy use of
\*(C`REAL(KIND=2)\*(C' (
\*(C`DOUBLE PRECISION\*(C') data
on some systems.
In particular, systems using Pentium, Pentium Pro, 586, and
686 implementations
of the i386 architecture execute programs faster when
\f(CW\*(C`REAL(KIND=2)\*(C' (
\*(C`DOUBLE PRECISION\*(C') data are
aligned on 64-bit boundaries
in memory.
.Sp
This option can, at least, make benchmark results more consistent
across various system configurations, versions of the program,
and data sets.
.Sp
\fINote: The warning in the
gcc documentation about
this option does not apply, generally speaking, to Fortran
code compiled by
g77
.Sp
\fIAlso also note: The negative form of
-malign-double
is
-mno-align-double, not
-benign-double.
"-ffloat-store" 4
Item "-ffloat-store" Might help a Fortran program that depends on exact \s-1IEEE\s0 conformance on
some machines, but might slow down a program that doesn't.
.Sp
This option is effective when the floating-point unit is set to work in
\s-1IEEE\s0 854 `extended precision'---as it typically is on x86 and m68k \s-1GNU\s0
systems---rather than \s-1IEEE\s0 754 double precision.
-ffloat-store
tries to remove the extra precision by spilling data from floating-point
registers into memory and this typically involves a big performance
hit. However, it doesn't affect intermediate results, so that it is
only partially effective. `Excess precision' is avoided in code like:
.Sp
.Vb 2
a = b + c
d = a * e
.Ve
.Sp
but not in code like:
.Sp
.Vb 1
d = (b + c) * e
.Ve
.Sp
For another, potentially better, way of controlling the precision,
see
Floating-point precision.
"-fforce-mem" 4
Item "-fforce-mem" 0
"-fforce-addr" 4
Item "-fforce-addr"
Might improve optimization of loops.
"-fno-inline" 4
Item "-fno-inline" Don't compile statement functions inline.
Might reduce the size of a program unit---which might be at
expense of some speed (though it should compile faster).
Note that if you are not optimizing, no functions can be expanded inline.
"-ffast-math" 4
Item "-ffast-math" Might allow some programs designed to not be too dependent
on \s-1IEEE\s0 behavior for floating-point to run faster, or die trying.
Sets
-funsafe-math-optimizations,
-ffinite-math-only,
and
-fno-trapping-math.
"-funsafe-math-optimizations" 4
Item "-funsafe-math-optimizations" Allow optimizations that may be give incorrect results
for certain \s-1IEEE\s0 inputs.
"-ffinite-math-only" 4
Item "-ffinite-math-only" Allow optimizations for floating-point arithmetic that assume
that arguments and results are not NaNs or +-Infs.
.Sp
This option should never be turned on by any
-O option since
it can result in incorrect output for programs which depend on
an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0
rules/
specifications.
.Sp
The default is
-fno-finite-math-only.
"-fno-trapping-math" 4
Item "-fno-trapping-math" Allow the compiler to assume that floating-point arithmetic
will not generate traps on any inputs. This is useful, for
example, when running a program using \s-1IEEE\s0 \*(L"non-stop\*(R"
floating-point arithmetic.
"-fstrength-reduce" 4
Item "-fstrength-reduce" Might make some loops run faster.
"-frerun-cse-after-loop" 4
Item "-frerun-cse-after-loop" 0
"-fexpensive-optimizations" 4
Item "-fexpensive-optimizations" "-fdelayed-branch" 4
Item "-fdelayed-branch" "-fschedule-insns" 4
Item "-fschedule-insns" "-fschedule-insns2" 4
Item "-fschedule-insns2" "-fcaller-saves" 4
Item "-fcaller-saves"
Might improve performance on some code.
"-funroll-loops" 4
Item "-funroll-loops" Typically improves performance on code using iterative
\*(C`DO\*(C' loops by
unrolling them and is probably generally appropriate for Fortran, though
it is not turned on at any optimization level.
Note that outer loop unrolling isn't done specifically; decisions about
whether to unroll a loop are made on the basis of its instruction count.
.Sp
Also, no `loop discovery'[1] is done, so only loops written with
\*(C`DO\*(C'
benefit from loop optimizations, including---but not limited
to---unrolling. Loops written with
\*(C`IF\*(C' and
\*(C`GOTO\*(C' are not
currently recognized as such. This option unrolls only iterative
\f(CW\*(C`DO\*(C' loops, not
\*(C`DO WHILE\*(C' loops.
"-funroll-all-loops" 4
Item "-funroll-all-loops" Probably improves performance on code using
\*(C`DO WHILE\*(C' loops by
unrolling them in addition to iterative
\*(C`DO\*(C' loops. In the absence
of
\*(C`DO WHILE\*(C', this option is equivalent to
-funroll-loops
but possibly slower.
"-fno-move-all-movables" 4
Item "-fno-move-all-movables" 0
"-fno-reduce-all-givs" 4
Item "-fno-reduce-all-givs" "-fno-rerun-loop-opt" 4
Item "-fno-rerun-loop-opt"
In general, the optimizations enabled with these options will lead to
faster code being generated by \s-1GNU\s0 Fortran; hence they are enabled by default
when issuing the g77 command.
.Sp
\fB-fmove-all-movables and -freduce-all-givs will enable
loop optimization to move all loop-invariant index computations in nested
loops over multi-rank array dummy arguments out of these loops.
.Sp
\fB-frerun-loop-opt will move offset calculations resulting
from the fact that Fortran arrays by default have a lower bound of 1
out of the loops.
.Sp
These three options are intended to be removed someday, once
loop optimization is sufficiently advanced to perform all those
transformations without help from these options.
.Sh "Options Controlling the Preprocessor"
Subsection "Options Controlling the Preprocessor" These options control the C preprocessor, which is run on each C source
file before actual compilation.
Some of these options also affect how g77 processes the
\f(CW\*(C`INCLUDE\*(C' directive.
Since this directive is processed even when preprocessing
is not requested, it is not described in this section.
However, the \*(C`INCLUDE\*(C' directive does not apply
preprocessing to the contents of the included file itself.
Therefore, any file that contains preprocessor directives
(such as \*(C`#include\*(C', \*(C`#define\*(C', and \*(C`#if\*(C')
must be included via the \*(C`#include\*(C' directive, not
via the \*(C`INCLUDE\*(C' directive.
Therefore, any file containing preprocessor directives,
if included, is necessarily included by a file that itself
contains preprocessor directives.
.Sh "Options for Directory Search"
Subsection "Options for Directory Search" These options affect how the cpp preprocessor searches
for files specified via the \*(C`#include\*(C' directive.
Therefore, when compiling Fortran programs, they are meaningful
when the preprocessor is used.
Some of these options also affect how g77 searches
for files specified via the \*(C`INCLUDE\*(C' directive,
although files included by that directive are not,
themselves, preprocessed.
These options are:
"-I-" 4
Item "-I-" 0
"-Idir" 4
Item "-Idir"
These affect interpretation of the \*(C`INCLUDE\*(C' directive
(as well as of the \*(C`#include\*(C' directive of the cpp
preprocessor).
.Sp
Note that -Idir must be specified without any
spaces between -I and the directory name---that is,
\fB-Ifoo/bar is valid, but -I foo/bar
is rejected by the g77 compiler (though the preprocessor supports
the latter form).
Also note that the general behavior of -I and
\f(CW\*(C`INCLUDE\*(C' is pretty much the same as of -I with
\f(CW\*(C`#include\*(C' in the cpp preprocessor, with regard to
looking for header.gcc files and other such things.
.Sh "Options for Code Generation Conventions"
Subsection "Options for Code Generation Conventions" These machine-independent options control the interface conventions
used in code generation.
Most of them have both positive and negative forms; the negative form
of -ffoo would be -fno-foo. In the table below, only
one of the forms is listed---the one which is not the default. You
can figure out the other form by either removing no- or adding
it.
"-fno-automatic" 4
Item "-fno-automatic" Treat each program unit as if the
\*(C`SAVE\*(C' statement was specified
for every local variable and array referenced in it.
Does not affect common blocks.
(Some Fortran compilers provide this option under
the name
-static.)
"-finit-local-zero" 4
Item "-finit-local-zero" Specify that variables and arrays that are local to a program unit
(not in a common block and not passed as an argument) are to be initialized
to binary zeros.
.Sp
Since there is a run-time penalty for initialization of variables
that are not given the
\*(C`SAVE\*(C' attribute, it might be a
good idea to also use
-fno-automatic with
-finit-local-zero.
"-fno-f2c" 4
Item "-fno-f2c" Do not generate code designed to be compatible with code generated
by
f2c use the \s-1GNU\s0 calling conventions instead.
.Sp
The
f2c calling conventions require functions that return
type
\*(C`REAL(KIND=1)\*(C' to actually return the C type
\*(C`double\*(C',
and functions that return type
\*(C`COMPLEX\*(C' to return the
values via an extra argument in the calling sequence that points
to where to store the return value.
Under the \s-1GNU\s0 calling conventions, such functions simply return
their results as they would in \s-1GNU\s0 C---
\*(C`REAL(KIND=1)\*(C' functions
return the C type
\*(C`float\*(C', and
\*(C`COMPLEX\*(C' functions
return the \s-1GNU\s0 C type
\*(C`complex\*(C' (or its
\*(C`struct\*(C'
equivalent).
.Sp
This does not affect the generation of code that interfaces with the
\f(CW\*(C`libg2c\*(C' library.
.Sp
However, because the
\*(C`libg2c\*(C' library uses
f2c
calling conventions,
g77 rejects attempts to pass
intrinsics implemented by routines in this library as actual
arguments when
-fno-f2c is used, to avoid bugs when
they are actually called by code expecting the \s-1GNU\s0 calling
conventions to work.
.Sp
For example,
\s-1INTRINSIC\s0 \s-1ABS\s0;CALL \s-1FOO\s0(\s-1ABS\s0) is
rejected when
-fno-f2c is in force.
(Future versions of the
g77 run-time library might
offer routines that provide GNU-callable versions of the
routines that implement the
f2c intrinsics
that may be passed as actual arguments, so that
valid programs need not be rejected when
-fno-f2c
is used.)
.Sp
\fBCaution: If
-fno-f2c is used when compiling any
source file used in a program, it must be used when compiling
\fIall Fortran source files used in that program.
"-ff2c-library" 4
Item "-ff2c-library" Specify that use of
\*(C`libg2c\*(C' (or the original
\*(C`libf2c\*(C')
is required.
This is the default for the current version of
g77
.Sp
Currently it is not
valid to specify
-fno-f2c-library.
This option is provided so users can specify it in shell
scripts that build programs and libraries that require the
\f(CW\*(C`libf2c\*(C' library, even when being compiled by future
versions of
g77 that might otherwise default to
generating code for an incompatible library.
"-fno-underscoring" 4
Item "-fno-underscoring" Do not transform names of entities specified in the Fortran
source file by appending underscores to them.
.Sp
With
-funderscoring in effect,
g77 appends two underscores
to names with underscores and one underscore to external names with
no underscores. (
g77 also appends two underscores to internal
names with underscores to avoid naming collisions with external names.
The
-fno-second-underscore option disables appending of the
second underscore in all cases.)
.Sp
This is done to ensure compatibility with code produced by many
\s-1UNIX\s0 Fortran compilers, including
f2c which perform the
same transformations.
.Sp
Use of
-fno-underscoring is not recommended unless you are
experimenting with issues such as integration of (\s-1GNU\s0) Fortran into
existing system environments (vis-a-vis existing libraries, tools, and
so on).
.Sp
For example, with
-funderscoring, and assuming other defaults like
\fB-fcase-lower and that
j() and
\f(BImax_count() are
external functions while my_var and lvar are local variables,
a statement like
.Sp
.Vb 1
I = J() + MAX_COUNT (MY_VAR, LVAR)
.Ve
.Sp
is implemented as something akin to:
.Sp
.Vb 1
i = j_() + max_count__(&my_var__, &lvar);
.Ve
.Sp
With -fno-underscoring, the same statement is implemented as:
.Sp
.Vb 1
i = j() + max_count(&my_var, &lvar);
.Ve
.Sp
Use of -fno-underscoring allows direct specification of
user-defined names while debugging and when interfacing g77
code with other languages.
.Sp
Note that just because the names match does not mean that the
interface implemented by g77 for an external name matches the
interface implemented by some other language for that same name.
That is, getting code produced by g77 to link to code produced
by some other compiler using this or any other method can be only a
small part of the overall solution---getting the code generated by
both compilers to agree on issues other than naming can require
significant effort, and, unlike naming disagreements, linkers normally
cannot detect disagreements in these other areas.
.Sp
Also, note that with -fno-underscoring, the lack of appended
underscores introduces the very real possibility that a user-defined
external name will conflict with a name in a system library, which
could make finding unresolved-reference bugs quite difficult in some
cases---they might occur at program run time, and show up only as
buggy behavior at run time.
.Sp
In future versions of g77 we hope to improve naming and linking
issues so that debugging always involves using the names as they appear
in the source, even if the names as seen by the linker are mangled to
prevent accidental linking between procedures with incompatible
interfaces.
"-fno-second-underscore" 4
Item "-fno-second-underscore" Do not append a second underscore to names of entities specified
in the Fortran source file.
.Sp
This option has no effect if
-fno-underscoring is
in effect.
.Sp
Otherwise, with this option, an external name such as
\s-1MAX_COUNT\s0
is implemented as a reference to the link-time external symbol
\fBmax_count_, instead of
max_count_\|_.
"-fno-ident" 4
Item "-fno-ident" Ignore the
#ident directive.
"-fzeros" 4
Item "-fzeros" Treat initial values of zero as if they were any other value.
.Sp
As of version 0.5.18,
g77 normally treats
\*(C`DATA\*(C' and
other statements that are used to specify initial values of zero
for variables and arrays as if no values were actually specified,
in the sense that no diagnostics regarding multiple initializations
are produced.
.Sp
This is done to speed up compiling of programs that initialize
large arrays to zeros.
.Sp
Use
-fzeros to revert to the simpler, slower behavior
that can catch multiple initializations by keeping track of
all initializations, zero or otherwise.
.Sp
\fICaution: Future versions of
g77 might disregard this option
(and its negative form, the default) or interpret it somewhat
differently.
The interpretation changes will affect only non-standard
programs; standard-conforming programs should not be affected.
"-femulate-complex" 4
Item "-femulate-complex" Implement
\*(C`COMPLEX\*(C' arithmetic via emulation,
instead of using the facilities of
the
gcc back end that provide direct support of
\f(CW\*(C`complex\*(C' arithmetic.
.Sp
(
gcc had some bugs in its back-end support
for
\*(C`complex\*(C' arithmetic, due primarily to the support not being
completed as of version 2.8.1 and
\*(C`egcs\*(C' 1.1.2.)
.Sp
Use
-femulate-complex if you suspect code-generation bugs,
or experience compiler crashes,
that might result from
g77 using the
\*(C`COMPLEX\*(C' support
in the
gcc back end.
If using that option fixes the bugs or crashes you are seeing,
that indicates a likely
g77 bugs
(though, all compiler crashes are considered bugs),
so, please report it.
(Note that the known bugs, now believed fixed, produced compiler crashes
rather than causing the generation of incorrect code.)
.Sp
Use of this option should not affect how Fortran code compiled
by
g77 works in terms of its interfaces to other code,
e.g. that compiled by
f2c
.Sp
As of \s-1GCC\s0 version 3.0, this option is not necessary anymore.
.Sp
\fICaution: Future versions of
g77 might ignore both forms
of this option.
"-falias-check" 4
Item "-falias-check" 0
"-fargument-alias" 4
Item "-fargument-alias" "-fargument-noalias" 4
Item "-fargument-noalias" "-fno-argument-noalias-global" 4
Item "-fno-argument-noalias-global"
\fIVersion info:
These options are not supported by
versions of g77 based on gcc version 2.8.
.Sp
These options specify to what degree aliasing
(overlap)
is permitted between
arguments (passed as pointers) and \*(C`COMMON\*(C' (external, or
public) storage.
.Sp
The default for Fortran code, as mandated by the \s-1FORTRAN\s0 77 and
Fortran 90 standards, is -fargument-noalias-global.
The default for code written in the C language family is
\fB-fargument-alias.
.Sp
Note that, on some systems, compiling with -fforce-addr in
effect can produce more optimal code when the default aliasing
options are in effect (and when optimization is enabled).
"-fno-globals" 4
Item "-fno-globals" Disable diagnostics about inter-procedural
analysis problems, such as disagreements about the
type of a function or a procedure's argument,
that might cause a compiler crash when attempting
to inline a reference to a procedure within a
program unit.
(The diagnostics themselves are still produced, but
as warnings, unless
-Wno-globals is specified,
in which case no relevant diagnostics are produced.)
.Sp
Further, this option disables such inlining, to
avoid compiler crashes resulting from incorrect
code that would otherwise be diagnosed.
.Sp
As such, this option might be quite useful when
compiling existing, ``working'' code that happens
to have a few bugs that do not generally show themselves,
but which
g77 diagnoses.
.Sp
Use of this option therefore has the effect of
instructing
g77 to behave more like it did
up through version 0.5.19.1, when it paid little or
no attention to disagreements between program units
about a procedure's type and argument information,
and when it performed no inlining of procedures
(except statement functions).
.Sp
Without this option,
g77 defaults to performing
the potentially inlining procedures as it started doing
in version 0.5.20, but as of version 0.5.21, it also
diagnoses disagreements that might cause such inlining
to crash the compiler as (fatal) errors,
and warns about similar disagreements
that are currently believed to not
likely to result in the compiler later crashing
or producing incorrect code.
"-fflatten-arrays" 4
Item "-fflatten-arrays" Use back end's C-like constructs
(pointer plus offset)
instead of its
\*(C`ARRAY_REF\*(C' construct
to handle all array references.
.Sp
\fINote: This option is not supported.
It is intended for use only by
g77 developers,
to evaluate code-generation issues.
It might be removed at any time.
"-fbounds-check" 4
Item "-fbounds-check" 0
"-ffortran-bounds-check" 4
Item "-ffortran-bounds-check"
Enable generation of run-time checks for array subscripts
and substring start and end points
against the (locally) declared minimum and maximum values.
.Sp
The current implementation uses the \*(C`libf2c\*(C'
library routine \*(C`s_rnge\*(C' to print the diagnostic.
.Sp
However, whereas f2c generates a single check per
reference for a multi-dimensional array, of the computed
offset against the valid offset range (0 through the size of the array),
\fBg77 generates a single check per subscript expression.
This catches some cases of potential bugs that f2c does not,
such as references to below the beginning of an assumed-size array.
.Sp
\fBg77 also generates checks for \*(C`CHARACTER\*(C' substring references,
something f2c currently does not do.
.Sp
Use the new -ffortran-bounds-check option
to specify bounds-checking for only the Fortran code you are compiling,
not necessarily for code written in other languages.
.Sp
\fINote: To provide more detailed information on the offending subscript,
\fBg77 provides the \*(C`libg2c\*(C' run-time library routine \*(C`s_rnge\*(C'
with somewhat differently-formatted information.
Here's a sample diagnostic:
.Sp
.Vb 3
Subscript out of range on file line 4, procedure rnge.f/bf.
Attempt to access the -6-th element of variable b[subscript-2-of-2].
Aborted
.Ve
.Sp
The above message indicates that the offending source line is
line 4 of the file rnge.f,
within the program unit (or statement function) named bf.
The offended array is named b.
The offended array dimension is the second for a two-dimensional array,
and the offending, computed subscript expression was -6.
.Sp
For a \*(C`CHARACTER\*(C' substring reference, the second line has
this appearance:
.Sp
.Vb 1
Attempt to access the 11-th element of variable a[start-substring].
.Ve
.Sp
This indicates that the offended \*(C`CHARACTER\*(C' variable or array
is named a,
the offended substring position is the starting (leftmost) position,
and the offending substring expression is 11.
.Sp
(Though the verbage of \*(C`s_rnge\*(C' is not ideal
for the purpose of the g77 compiler,
the above information should provide adequate diagnostic abilities
to it users.)
Some of these do not work when compiling programs written in Fortran:
"-fpcc-struct-return" 4
Item "-fpcc-struct-return" 0
"-freg-struct-return" 4
Item "-freg-struct-return"
You should not use these except strictly the same way as you
used them to build the version of \*(C`libg2c\*(C' with which
you will be linking all code compiled by g77 with the
same option.
"-fshort-double" 4
Item "-fshort-double" This probably either has no effect on Fortran programs, or
makes them act loopy.
"-fno-common" 4
Item "-fno-common" Do not use this when compiling Fortran programs,
or there will be Trouble.
"-fpack-struct" 4
Item "-fpack-struct" This probably will break any calls to the
\*(C`libg2c\*(C' library,
at the very least, even if it is built with the same option.
"ENVIRONMENT"
Header "ENVIRONMENT" \s-1GNU\s0 Fortran currently does not make use of any environment
variables to control its operation above and beyond those
that affect the operation of
gcc.
"BUGS"
Header "BUGS" For instructions on reporting bugs, see
<
http://gcc.gnu.org/bugs.html>. Use of the
gccbug
script to report bugs is recommended.
"FOOTNOTES"
Header "FOOTNOTES" "1." 4
\fIloop discovery refers to the
process by which a compiler, or indeed any reader of a program,
determines which portions of the program are more likely to be executed
repeatedly as it is being run. Such discovery typically is done early
when compiling using optimization techniques, so the ``discovered''
loops get more attention---and more run-time resources, such as
registers---from the compiler. It is easy to ``discover'' loops that are
constructed out of looping constructs in the language
(such as Fortran's
\*(C`DO\*(C'). For some programs, ``discovering'' loops
constructed out of lower-level constructs (such as
\*(C`IF\*(C' and
\f(CW\*(C`GOTO\*(C') can lead to generation of more optimal code
than otherwise.
"SEE ALSO"
Header "SEE ALSO" \fIgpl\|(7),
gfdl\|(7),
fsf-funding\|(7),
\fIcpp\|(1),
gcov\|(1),
gcc\|(1),
as\|(1),
ld\|(1),
gdb\|(1),
adb\|(1),
dbx\|(1),
sdb\|(1)
and the Info entries for
gcc,
cpp,
g77,
as,
\fIld,
binutils and
gdb.
"AUTHOR"
Header "AUTHOR" See the Info entry for
g77 for contributors to \s-1GCC\s0 and G77.
"COPYRIGHT"
Header "COPYRIGHT" Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``\s-1GNU\s0 General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
the Back-Cover Texts being (b) (see below). A copy of the license is
included in the gfdl\|(7) man page.
(a) The \s-1FSF\s0's Front-Cover Text is:
.Vb 1
A GNU Manual
.Ve
(b) The \s-1FSF\s0's Back-Cover Text is:
.Vb 3
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.
.Ve