OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / fortran / invoke.texi
index c68a261..2bac12c 100644 (file)
@@ -1,4 +1,4 @@
-@c Copyright (C) 2004, 2005, 2006, 2007
+@c Copyright (C) 2004, 2005, 2006, 2007, 2008
 @c Free Software Foundation, Inc.
 @c This is part of the GNU Fortran manual.   
 @c For copying conditions, see the file gfortran.texi.
@@ -121,7 +121,7 @@ by type.  Explanations are in the following sections.
 -ffixed-line-length-@var{n}  -ffixed-line-length-none @gol
 -ffree-line-length-@var{n}  -ffree-line-length-none @gol
 -fdefault-double-8  -fdefault-integer-8  -fdefault-real-8 @gol
--fcray-pointer  -fopenmp  -frange-check -fno-backslash -fmodule-private}
+-fcray-pointer  -fopenmp  -fno-range-check -fbackslash -fmodule-private}
 
 @item Error and Warning Options
 @xref{Error and Warning Options,,Options to request or suppress errors
@@ -156,7 +156,9 @@ and warnings}.
 -fsecond-underscore @gol
 -fbounds-check  -fmax-stack-var-size=@var{n} @gol
 -fpack-derived  -frepack-arrays  -fshort-enums  -fexternal-blas @gol
--fblas-matmul-limit=@var{n}}
+-fblas-matmul-limit=@var{n} -frecursive -finit-local-zero @gol
+-finit-integer=@var{n} -finit-real=@var{<zero|inf|-inf|nan>} @gol
+-finit-logical=@var{<true|false>} -finit-character=@var{n}}
 @end table
 
 @menu
@@ -231,12 +233,17 @@ Do nothing if this is already the default.
 @cindex character set
 Allow @samp{$} as a valid character in a symbol name.
 
-@item -fno-backslash
-@opindex @code{fno-backslash}
+@item -fbackslash
+@opindex @code{backslash}
 @cindex backslash
 @cindex escape characters
-Change the interpretation of backslashes in string literals from
-``C-style'' escape characters to a single backslash character.
+Change the interpretation of backslashes in string literals
+from a single backslash character to ``C-style'' escape characters.
+The following combinations are expanded \a, \b, \f, \n, \r, \t,
+\v, \\, and \0 to the ASCII characters alert, backspace, form feed,
+newline, carriage return, horizontal tab, vertical tab, backslash,
+and NUL, respectively.  All other combinations of a character preceded
+by \ are unexpanded.
 
 @item -fmodule-private
 @opindex @code{fmodule-private}
@@ -274,7 +281,7 @@ lines in the source file. The default value is 132.
 @item -fmax-identifier-length=@var{n}
 @opindex @code{fmax-identifier-length=}@var{n}
 Specify the maximum allowed identifier length. Typical values are
-31 (Fortran 95) and 63 (Fortran 2003).
+31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
 
 @item -fimplicit-none
 @opindex @code{fimplicit-none}
@@ -296,15 +303,18 @@ and @code{c$omp}, @code{*$omp} and @code{!$omp} directives in fixed form,
 @code{!$} conditional compilation sentinels in free form
 and @code{c$}, @code{*$} and @code{!$} sentinels in fixed form, 
 and when linking arranges for the OpenMP runtime library to be linked
-in.
+in.  The option @option{-fopenmp} implies @option{-frecursive}.
 
-@item -frange-check
+@item -fno-range-check
 @opindex @code{frange-check}
-Enable range checking on results of simplification of constant
-expressions during compilation.  For example, by default, GNU Fortran
-will give an overflow error at compile time when simplifying @code{a =
-EXP(1000)}. With @option{-fno-range-check}, no error will be given and
-the variable @code{a} will be assigned the value @code{+Infinity}.
+Disable range checking on results of simplification of constant
+expressions during compilation.  For example, GNU Fortran will give
+an error at compile time when simplifying @code{a = 1. / 0}.
+With this option, no error will be given and @code{a} will be assigned
+the value @code{+Infinity}.  If an expression evaluates to a value
+outside of the relevant range of [@code{-HUGE()}:@code{HUGE()}],
+then the expression will be replaced by @code{-Inf} or @code{+Inf}
+as appropriate.
 Similarly, @code{DATA i/Z'FFFFFFFF'/} will result in an integer overflow
 on most systems, but with @option{-fno-range-check} the value will
 ``wrap around'' and @code{i} will be initialized to @math{-1} instead.
@@ -312,18 +322,18 @@ on most systems, but with @option{-fno-range-check} the value will
 @item -std=@var{std}
 @opindex @code{std=}@var{std} option
 Specify the standard to which the program is expected to conform, which
-may be one of @samp{f95}, @samp{f2003}, @samp{gnu}, or @samp{legacy}.
-The default value for @var{std} is @samp{gnu}, which specifies a
-superset of the Fortran 95 standard that includes all of the extensions
-supported by GNU Fortran, although warnings will be given for obsolete
-extensions not recommended for use in new code.  The @samp{legacy} value
-is equivalent but without the warnings for obsolete extensions, and may
-be useful for old non-standard programs.  The @samp{f95} and
-@samp{f2003} values specify strict conformance to the Fortran 95 and
-Fortran 2003 standards, respectively; errors are given for all
-extensions beyond the relevant language standard, and warnings are given
-for the Fortran 77 features that are permitted but obsolescent in later
-standards.
+may be one of @samp{f95}, @samp{f2003}, @samp{f2008}, @samp{gnu}, or
+@samp{legacy}.  The default value for @var{std} is @samp{gnu}, which
+specifies a superset of the Fortran 95 standard that includes all of the
+extensions supported by GNU Fortran, although warnings will be given for
+obsolete extensions not recommended for use in new code.  The
+@samp{legacy} value is equivalent but without the warnings for obsolete
+extensions, and may be useful for old non-standard programs.  The
+@samp{f95}, @samp{f2003} and @samp{f2008} values specify strict
+conformance to the Fortran 95, Fortran 2003 and Fortran 2008 standards,
+respectively; errors are given for all extensions beyond the relevant
+language standard, and warnings are given for the Fortran 77 features
+that are permitted but obsolescent in later standards.
 
 @end table
 
@@ -357,8 +367,8 @@ These options control the amount and kinds of errors and warnings produced
 by GNU Fortran:
 
 @table @gcctabopt
-@item -fmax-errors-@var{n}
-@opindex @code{fmax-errors-}@var{n}
+@item -fmax-errors=@var{n}
+@opindex @code{fmax-errors=}@var{n}
 @cindex errors, limiting
 Limits the maximum number of error messages to @var{n}, at which point
 GNU Fortran bails out rather than attempting to continue processing the
@@ -390,8 +400,8 @@ They soon find that it does not do quite what they want---it finds some
 nonstandard practices, but not all.
 However, improvements to GNU Fortran in this area are welcome.
 
-This should be used in conjunction with @option{-std=f95} or
-@option{-std=f2003}.
+This should be used in conjunction with @option{-std=f95},
+@option{-std=f2003} or @option{-std=f2008}.
 
 @item -pedantic-errors
 @opindex @code{pedantic-errors}
@@ -435,16 +445,22 @@ The following example will trigger the warning.
 @cindex warnings, ampersand
 @cindex &
 Warn about missing ampersand in continued character constants. The warning is
-given with @option{-Wampersand}, @option{-pedantic}, @option{-std=f95}, and
-@option{-std=f2003}. Note: With no ampersand given in a continued character
-constant, GNU Fortran assumes continuation at the first non-comment,
-non-whitespace character after the ampersand that initiated the continuation.
+given with @option{-Wampersand}, @option{-pedantic}, @option{-std=f95},
+@option{-std=f2003} and @option{-std=f2008}. Note: With no ampersand
+given in a continued character constant, GNU Fortran assumes continuation
+at the first non-comment, non-whitespace character after the ampersand
+that initiated the continuation.
 
 @item -Wcharacter-truncation
 @opindex @code{Wcharacter-truncation}
 @cindex warnings, character truncation
 Warn when a character assignment will truncate the assigned string.
 
+@item -Wline-truncation
+@opindex @code{Wline-truncation}
+@cindex warnings, line truncation
+Warn when a source code line will be truncated.
+
 @item -Wconversion
 @opindex @code{Wconversion}
 @cindex warnings, conversion
@@ -479,6 +495,9 @@ lower value is greater than its upper value.
 
 @item
 A LOGICAL SELECT construct has three CASE statements.
+
+@item
+A TRANSFER specifies a source that is shorter than the destination.
 @end itemize
 
 @item -Wtabs
@@ -486,10 +505,11 @@ A LOGICAL SELECT construct has three CASE statements.
 @cindex warnings, tabs
 @cindex tabulators
 By default, tabs are accepted as whitespace, but tabs are not members
-of the Fortran Character Set.  @option{-Wno-tabs} will cause a warning
-to be issued if a tab is encountered. Note, @option{-Wno-tabs} is active
-for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003}, and
-@option{-Wall}.
+of the Fortran Character Set.  For continuation lines, a tab followed
+by a digit between 1 and 9 is supported.  @option{-Wno-tabs} will cause
+a warning to be issued if a tab is encountered. Note, @option{-Wno-tabs}
+is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
+@option{-std=f2008} and @option{-Wall}.
 
 @item -Wunderflow
 @opindex @code{Wunderflow}
@@ -548,6 +568,11 @@ zero), @samp{overflow} (overflow in a floating point operation),
 @samp{precision} (loss of precision during operation) and @samp{denormal}
 (operation produced a denormal value).
 
+Some of the routines in the Fortran runtime library, like
+@samp{CPU_TIME}, are likely to to trigger floating point exceptions when
+@code{ffpe-trap=precision} is used. For this reason, the use of 
+@code{ffpe-trap=precision} is not recommended.
+
 @item -fbacktrace
 @opindex @code{fbacktrace}
 @cindex backtrace
@@ -710,10 +735,13 @@ it.
 @opindex @code{fno-automatic}
 @cindex @code{SAVE} statement
 @cindex statement, @code{SAVE}
-Treat each program unit as if the @code{SAVE} 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
-@option{-static}.)
+Treat each program unit (except those marked as RECURSIVE) as if the
+@code{SAVE} statement were specified for every local variable and array
+referenced in it. Does not affect common blocks. (Some Fortran compilers
+provide this option under the name @option{-static} or @option{-save}.)
+The default, which is @option{-fautomatic}, uses the stack for local
+variables smaller than the value given by @option{-fmax-stack-var-size}.
+Use the option @option{-frecursive} to use no static memory. 
 
 @item -ff2c
 @opindex ff2c
@@ -770,8 +798,8 @@ tools.
 
 Use of @option{-fno-underscoring} is not recommended unless you are
 experimenting with issues such as integration of GNU Fortran into
-existing system environments (vis-a-vis existing libraries, tools, and
-so on).
+existing system environments (vis-@`{a}-vis existing libraries, tools,
+and so on).
 
 For example, with @option{-funderscoring}, and assuming other defaults like
 @option{-fcase-lower} and that @code{j()} and @code{max_count()} are
@@ -857,7 +885,7 @@ checks array indices for assumed and deferred
 shape arrays against the actual allocated bounds.
 
 Some checks require that @option{-fbounds-check} is set for
-the compilation of the main probram.
+the compilation of the main program.
 
 In the future this may also include other forms of checking, e.g., checking
 substring references.
@@ -865,7 +893,10 @@ substring references.
 @item -fmax-stack-var-size=@var{n}
 @opindex @code{fmax-stack-var-size}
 This option specifies the size in bytes of the largest array that will be put
-on the stack.
+on the stack; if the size is exceeded static memory is used (except in
+procedures marked as RECURSIVE). Use the option @option{-frecursive} to
+allow for recursive procedures which do not have a RECURSIVE attribute or
+for parallel programs. Use @option{-fno-automatic} to never use the stack.
 
 This option currently only affects local arrays declared with constant
 bounds, and may not apply to all character variables.
@@ -919,6 +950,39 @@ geometric mean of the dimensions of the argument and result matrices.
 
 The default value for @var{n} is 30.
 
+@item -frecursive
+@opindex @code{frecursive}
+Allow indirect recursion by forcing all local arrays to be allocated
+on the stack. This flag cannot be used together with
+@option{-fmax-stack-var-size=} or @option{-fno-automatic}.
+
+@item -finit-local-zero
+@item -finit-integer=@var{n}
+@item -finit-real=@var{<zero|inf|-inf|nan>} 
+@item -finit-logical=@var{<true|false>}
+@item -finit-character=@var{n}
+@opindex @code{finit-local-zero}
+@opindex @code{finit-integer}
+@opindex @code{finit-real}
+@opindex @code{finit-logical}
+@opindex @code{finit-character}
+The @option{-finit-local-zero} option instructs the compiler to
+initialize local @code{INTEGER}, @code{REAL}, and @code{COMPLEX}
+variables to zero, @code{LOGICAL} variables to false, and
+@code{CHARACTER} variables to a string of null bytes.  Finer-grained
+initialization options are provided by the
+@option{-finit-integer=@var{n}},
+@option{-finit-real=@var{<zero|inf|-inf|nan>}} (which also initializes
+the real and imaginary parts of local @code{COMPLEX} variables),
+@option{-finit-logical=@var{<true|false>}}, and
+@option{-finit-character=@var{n}} (where @var{n} is an ASCII character
+value) options.  These options do not initialize components of derived
+type variables, nor do they initialize variables that appear in an
+@code{EQUIVALENCE} statement.  (This limitation may be removed in
+future releases).
+
+Note that the @option{-finit-real=nan} option initializes @code{REAL}
+and @code{COMPLEX} variables with a quiet NaN.
 @end table
 
 @xref{Code Gen Options,,Options for Code Generation Conventions,