summaryrefslogtreecommitdiff
path: root/gcc/fortran/invoke.texi
diff options
context:
space:
mode:
authorlangton <langton@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-21 02:34:14 +0000
committerlangton <langton@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-21 02:34:14 +0000
commita28eb9a86954e46488228a9a434f816ca39ee194 (patch)
tree6f87e3fe355a7263be01fcc31cadd9d2cbcca2ac /gcc/fortran/invoke.texi
parent84786a68feb112962e57bf50061937f84a972154 (diff)
downloadgcc-a28eb9a86954e46488228a9a434f816ca39ee194.tar.gz
PR fortran/20441
* gfortran.h : Add init_local_* enums and init_flag_* flags to gfc_option_t. * lang.opt: Add -finit-local-zero, -finit-real, -finit-integer, -finit-character, and -finit-logical flags. * invoke.texi: Document new options. * resolve.c (build_init_assign): New function. (apply_init_assign): Move part of function into build_init_assign. (build_default_init_expr): Build local initializer (-finit-*). (apply_default_init_local): Apply local initializer (-finit-*). (resolve_fl_variable): Try to add local initializer (-finit-*). * options.c (gfc_init_options, gfc_handle_option, gfc_post_options): Handle -finit-local-zero, -finit-real, -finit-integer, -finit-character, and -finit-logical flags. PR fortran/20441 * gfortran.dg/init_flag_1.f90: New. * gfortran.dg/init_flag_2.f90: New. * gfortran.dg/init_flag_3.f90: New. * gfortran.dg/init_flag_4.f90: New. * gfortran.dg/init_flag_5.f90: New. * gfortran.dg/init_flag_6.f90: New. * gfortran.dg/init_flag_7.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/invoke.texi')
-rw-r--r--gcc/fortran/invoke.texi31
1 files changed, 30 insertions, 1 deletions
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 1388b6c123e..754974fe8c7 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -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} -frecursive}
+-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
@@ -931,6 +933,33 @@ 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,