|
|
 |
 |
 |
MAN page from PLD gcc-fortran-12.2.0-1.i686.rpm
GFORTRANSection: GNU (1) Updated: 2022-08-19 Index NAMEgfortran - GNU Fortran compiler SYNOPSISgfortran [ -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 theremainder. DESCRIPTIONThe gfortran command supports all the options supported by the gcc command. Only options specific to GNU Fortran are documentedhere. All GCC and GNU Fortran optionsare accepted both by gfortran and by gcc(as well as any other drivers built at the same time,such as g++),since adding GNU Fortran to the GCC distributionenables acceptance of GNU Fortran optionsby 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, whicheverone is not the default. OPTIONSHere is a summary of all the options specific to GNU Fortran, groupedby type. Explanations are in the following sections. - Fortran Language Options
- -fall-intrinsics -fallow-argument-mismatch -fallow-invalid-boz -fbackslash -fcray-pointer -fd-lines-as-code -fd-lines-as-comments -fdec -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints -fdec-static -fdec-math -fdec-include -fdec-format-defaults -fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok -ffixed-line-length-n -ffixed-line-length-none -fpad-source -ffree-form -ffree-line-length-n -ffree-line-length-none -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 -freal-8-real-16 -freal-8-real-4 -std=std -ftest-forall-temp
- Preprocessing Options
- -A-question[=answer]-Aquestion=answer -C -CC -Dmacro[=defn]-H -P -Umacro -cpp -dD -dI -dM -dN -dU -fworking-directory-imultilib dir -iprefix file -iquote -isysroot dir -isystem dir -nocpp -nostdinc -undef
- Error and Warning Options
- -Waliasing -Wall -Wampersand -Warray-bounds -Wc-binding-type -Wcharacter-truncation -Wconversion -Wdo-subscript -Wfunction-elimination -Wimplicit-interface -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only -Wintrinsics-std -Wline-truncation -Wno-align-commons -Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wsurprising -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all -Wfrontend-loop-interchange -Wtarget-lifetime -fmax-errors=n -fsyntax-only -pedantic -pedantic-errors
- Debugging Options
- -fbacktrace -fdump-fortran-optimized -fdump-fortran-original -fdebug-aux-vars -fdump-fortran-global -fdump-parse-tree -ffpe-trap=list -ffpe-summary=list
- Directory Options
- -Idir -Jdir -fintrinsic-modules-path dir
- Link Options
- -static-libgfortran
- Runtime Options
- -fconvert=conversion -fmax-subrecord-length=length -frecord-marker=length -fsign-zero
- Interoperability Options
- -fc-prototypes -fc-prototypes-external
- Code Generation Options
- -faggressive-function-elimination -fblas-matmul-limit=n -fbounds-check -ftail-call-workaround -ftail-call-workaround=n -fcheck-array-temporaries -fcheck=<all|array-temps|bits|bounds|do|mem|pointer|recursion> -fcoarray=<none|single|lib> -fexternal-blas -ff2c -ffrontend-loop-interchange -ffrontend-optimize -finit-character=n -finit-integer=n -finit-local-zero -finit-derived -finit-logical=<true|false> -finit-real=<zero|inf|-inf|nan|snan>-finline-matmul-limit=n -finline-arg-packing -fmax-array-constructor=n -fmax-stack-var-size=n -fno-align-commons -fno-automatic -fno-protect-parens -fno-underscoring -fsecond-underscore -fpack-derived -frealloc-lhs -frecursive -frepack-arrays -fshort-enums -fstack-arrays
Options controlling Fortran dialectThe following options control the details of the Fortran dialectaccepted by the compiler: - -ffree-form
- -ffixed-form
- Specify the layout used by the source file. The free form layoutwas introduced in Fortran 90. Fixed form was traditionally used inolder Fortran programs. When neither option is specified, the sourceform is determined by the file extension.
- -fall-intrinsics
- This option causes all intrinsic procedures (including the GNU-specificextensions) to be accepted. This can be useful with -std= toforce standard-compliance but get access to the full range of intrinsicsavailable with gfortran. As a consequence, -Wintrinsics-stdwill be ignored and no user-defined procedure with the same name as anyintrinsic will be called except when it is explicitly declared "EXTERNAL".
- -fallow-argument-mismatch
- Some code contains calls to external procedures with mismatchesbetween the calls and the procedure definition, or with mismatchesbetween different calls. Such code is non-conforming, and will usuallybe flagged with an error. This options degrades the error to awarning, which can only be disabled by disabling all warnings via-w. Only a single occurrence per argument is flagged by thiswarning. -fallow-argument-mismatch is implied by-std=legacy.
Using this option is strongly discouraged. It is possible toprovide standard-conforming code which allows different types ofarguments by using an explicit interface and TYPE(*). - -fallow-invalid-boz
- A BOZ literal constant can occur in a limited number of contexts instandard conforming Fortran. This option degrades an error conditionto a warning, and allows a BOZ literal constant to appear where theFortran standard would otherwise prohibit its use.
- -fd-lines-as-code
- -fd-lines-as-comments
- Enable special treatment for lines beginning with "d" or "D"in fixed form sources. If the -fd-lines-as-code option isgiven they are treated as if the first column contained a blank. If the-fd-lines-as-comments option is given, they are treated ascomment lines.
- -fdec
- DEC compatibility mode. Enables extensions and other features that mimicthe default behavior of older compilers (such as DEC).These features are non-standard and should be avoided at all costs.For details on GNU Fortran's implementation of these extensions see thefull documentation.
Other flags enabled by this switch are:-fdollar-ok -fcray-pointer -fdec-char-conversions-fdec-structure -fdec-intrinsic-ints -fdec-static-fdec-math -fdec-include -fdec-blank-format-item-fdec-format-defaults If -fd-lines-as-code/-fd-lines-as-comments are unset, then-fdec also sets -fd-lines-as-comments. - -fdec-char-conversions
- Enable the use of character literals in assignments and "DATA" statementsfor non-character variables.
- -fdec-structure
- Enable DEC "STRUCTURE" and "RECORD" as well as "UNION","MAP", and dot ('.') as a member separator (in addition to '%'). This isprovided for compatibility only; Fortran 90 derived types should be usedinstead where possible.
- -fdec-intrinsic-ints
- Enable B/I/J/K kind variants of existing integer functions (e.g. BIAND, IIAND,JIAND, etc...). For a complete list of intrinsics see the full documentation.
- -fdec-math
- Enable legacy math intrinsics such as COTAN and degree-valued trigonometricfunctions (e.g. TAND, ATAND, etc...) for compatability with older code.
- -fdec-static
- Enable DEC-style STATIC and AUTOMATIC attributes to explicitly specifythe storage of variables and other objects.
- -fdec-include
- Enable parsing of INCLUDE as a statement in addition to parsing it asINCLUDE line. When parsed as INCLUDE statement, INCLUDE does not have tobe on a single line and can use line continuations.
- -fdec-format-defaults
- Enable format specifiers F, G and I to be used without width specifiers,default widths will be used instead.
- -fdec-blank-format-item
- Enable a blank format item at the end of a format specification i.e. nothingfollowing the final comma.
- -fdollar-ok
- Allow $ as a valid non-first character in a symbol name. Symbols that start with $ are rejected since it is unclear which rules toapply to implicit typing as different vendors implement different rules.Using $ in "IMPLICIT" statements is also rejected.
- -fbackslash
- Change the interpretation of backslashes in string literals from a singlebackslash character to ``C-style'' escape characters. The followingcombinations are expanded "\a", "\b", "\f", "\n","\r", "\t", "\v", "\\", and "\0" to the ASCIIcharacters alert, backspace, form feed, newline, carriage return,horizontal tab, vertical tab, backslash, and NUL, respectively.Additionally, "\x"nn, "\u"nnnn and"\U"nnnnnnnn (where each n is a hexadecimal digit) aretranslated into the Unicode characters corresponding to the specified codepoints. All other combinations of a character preceded by \ areunexpanded.
- -fmodule-private
- Set the default accessibility of module entities to "PRIVATE".Use-associated entities will not be accessible unless they are explicitlydeclared as "PUBLIC".
- -ffixed-line-length-n
- Set column after which characters are ignored in typical fixed-formlines in the source file, and, unless "-fno-pad-source", through whichspaces are assumed (as if padded to that length) after the ends of shortfixed-form lines.
Popular values for n include 72 (thestandard and the default), 80 (card image), and 132 (correspondingto ``extended-source'' options in some popular compilers).n may also be none, meaning that the entire line is meaningfuland that continued character constants never have implicit spaces appendedto them to fill out the line.-ffixed-line-length-0 means the same thing as-ffixed-line-length-none. - -fno-pad-source
- By default fixed-form lines have spaces assumed (as if padded to that length)after the ends of short fixed-form lines. This is not done either if-ffixed-line-length-0, -ffixed-line-length-none orif -fno-pad-source option is used. With any of those optionscontinued character constants never have implicit spaces appendedto them to fill out the line.
- -ffree-line-length-n
- Set column after which characters are ignored in typical free-formlines in the source file. The default value is 132.n may be none, meaning that the entire line is meaningful.-ffree-line-length-0 means the same thing as-ffree-line-length-none.
- -fmax-identifier-length=n
- Specify the maximum allowed identifier length. Typical values are31 (Fortran 95) and 63 (Fortran 2003 and later).
- -fimplicit-none
- Specify that no implicit typing is allowed, unless overridden by explicit"IMPLICIT" statements. This is the equivalent of adding"implicit none" to the start of every procedure.
- -fcray-pointer
- Enable the Cray pointer extension, which provides C-like pointerfunctionality.
- -fopenacc
- Enable the OpenACC extensions. This includes OpenACC "!$acc"directives in free form and "c$acc", *$acc and"!$acc" directives in fixed form, "!$" conditionalcompilation sentinels in free form and "c$", "*$" and"!$" sentinels in fixed form, and when linking arranges for theOpenACC runtime library to be linked in.
- -fopenmp
- Enable the OpenMP extensions. This includes OpenMP "!$omp" directivesin free formand "c$omp", *$omp and "!$omp" directives in fixed form,"!$" conditional compilation sentinels in free formand "c$", "*$" and "!$" sentinels in fixed form, and when linking arranges for the OpenMP runtime library to be linkedin. The option -fopenmp implies -frecursive.
- -fno-range-check
- Disable range checking on results of simplification of constantexpressions during compilation. For example, GNU Fortran will givean error at compile time when simplifying "a = 1. / 0".With this option, no error will be given and "a" will be assignedthe value "+Infinity". If an expression evaluates to a valueoutside of the relevant range of ["-HUGE()":"HUGE()"],then the expression will be replaced by "-Inf" or "+Inf"as appropriate.Similarly, "DATA i/Z'FFFFFFFF'/" will result in an integer overflowon most systems, but with -fno-range-check the value will``wrap around'' and "i" will be initialized to -1 instead.
- -fdefault-integer-8
- Set the default integer and logical types to an 8 byte wide type. This optionalso affects the kind of integer constants like 42. Unlike-finteger-4-integer-8, it does not promote variables with explicitkind declaration.
- -fdefault-real-8
- Set the default real type to an 8 byte wide type. This option also affectsthe kind of non-double real constants like 1.0. This option promotesthe default width of "DOUBLE PRECISION" and double real constantslike "1.d0" to 16 bytes if possible. If "-fdefault-double-8"is given along with "fdefault-real-8", "DOUBLE PRECISION"and double real constants are not promoted. Unlike -freal-4-real-8,"fdefault-real-8" does not promote variables with explicit kinddeclarations.
- -fdefault-real-10
- Set the default real type to an 10 byte wide type. This option also affectsthe kind of non-double real constants like 1.0. This option promotesthe default width of "DOUBLE PRECISION" and double real constantslike "1.d0" to 16 bytes if possible. If "-fdefault-double-8"is given along with "fdefault-real-10", "DOUBLE PRECISION"and double real constants are not promoted. Unlike -freal-4-real-10,"fdefault-real-10" does not promote variables with explicit kinddeclarations.
- -fdefault-real-16
- Set the default real type to an 16 byte wide type. This option also affectsthe kind of non-double real constants like 1.0. This option promotesthe default width of "DOUBLE PRECISION" and double real constantslike "1.d0" to 16 bytes if possible. If "-fdefault-double-8"is given along with "fdefault-real-16", "DOUBLE PRECISION"and double real constants are not promoted. Unlike -freal-4-real-16,"fdefault-real-16" does not promote variables with explicit kinddeclarations.
- -fdefault-double-8
- Set the "DOUBLE PRECISION" type and double real constantslike "1.d0" to an 8 byte wide type. Do nothing if thisis already the default. This option prevents -fdefault-real-8,-fdefault-real-10, and -fdefault-real-16,from promoting "DOUBLE PRECISION" and double real constants like"1.d0" to 16 bytes.
- -finteger-4-integer-8
- Promote all "INTEGER(KIND=4)" entities to an "INTEGER(KIND=8)"entities. If "KIND=8" is unavailable, then an error will be issued.This option should be used with care and may not be suitable for your codes.Areas of possible concern include calls to external procedures,alignment in "EQUIVALENCE" and/or "COMMON", generic interfaces,BOZ literal constant conversion, and I/O. Inspection of the intermediaterepresentation of the translated Fortran code, produced by-fdump-tree-original, is suggested.
- -freal-4-real-8
- -freal-4-real-10
- -freal-4-real-16
- -freal-8-real-4
- -freal-8-real-10
- -freal-8-real-16
- Promote all "REAL(KIND=M)" entities to "REAL(KIND=N)" entities.If "REAL(KIND=N)" is unavailable, then an error will be issued.The "-freal-4-" flags also affect the default real kind and the"-freal-8-" flags also the double-precision real kind. All otherreal-kind types are unaffected by this option. The promotion is alsoapplied to real literal constants of default and double-precision kindand a specified kind number of 4 or 8, respectively.However, "-fdefault-real-8", "-fdefault-real-10","-fdefault-real-10", and "-fdefault-double-8" take precedencefor the default and double-precision real kinds, both for real literalconstants and for declarations without a kind number.Note that for "REAL(KIND=KIND(1.0))" the literal may get promoted andthen the result may get promoted again.These options should be used with care and may not be suitable for yourcodes. Areas of possible concern include calls to external procedures,alignment in "EQUIVALENCE" and/or "COMMON", generic interfaces,BOZ literal constant conversion, and I/O and calls to intrinsic procedureswhen passing a value to the "kind=" dummy argument. Inspection of theintermediate representation of the translated Fortran code, produced by-fdump-fortran-original or -fdump-tree-original, is suggested.
- -std=std
- Specify the standard to which the program is expected to conform,which may be one of f95, f2003, f2008,f2018, gnu, or legacy. The default value forstd is gnu, which specifies a superset of the latestFortran standard that includes all of the extensions supported by GNUFortran, although warnings will be given for obsolete extensions notrecommended for use in new code. The legacy value isequivalent but without the warnings for obsolete extensions, and maybe useful for old non-standard programs. The f95,f2003, f2008, and f2018 values specify strictconformance to the Fortran 95, Fortran 2003, Fortran 2008 and Fortran2018 standards, respectively; errors are given for all extensionsbeyond the relevant language standard, and warnings are given for theFortran 77 features that are permitted but obsolescent in laterstandards. The deprecated option -std=f2008ts acts as an alias for-std=f2018. It is only present for backwards compatibility withearlier gfortran versions and should not be used any more.
- -ftest-forall-temp
- Enhance test coverage by forcing most forall assignments to use temporary.
Enable and customize preprocessingMany Fortran compilers including GNU Fortran allow passing the source codethrough a C preprocessor ( CPP; sometimes also called the Fortran preprocessor, FPP) to allow for conditional compilation. In the case of GNU Fortran,this is the GNU C Preprocessor in the traditional mode. On systems withcase-preserving file names, the preprocessor is automatically invoked if thefilename extension is .F, .FOR, .FTN, .fpp, .FPP, .F90, .F95, .F03 or .F08. To manuallyinvoke the preprocessor on any file, use -cpp, to disablepreprocessing on files where the preprocessor is run automatically, use -nocpp. If a preprocessed file includes another file with the Fortran "INCLUDE"statement, the included file is not preprocessed. To preprocess includedfiles, use the equivalent preprocessor statement "#include". If GNU Fortran invokes the preprocessor, "__GFORTRAN__"is defined. The macros "__GNUC__", "__GNUC_MINOR__" and"__GNUC_PATCHLEVEL__" can be used to determine the version of thecompiler. See Top,,Overview,cpp,The C Preprocessor for details. GNU Fortran supports a number of "INTEGER" and "REAL" kind typesin additional to the kind types required by the Fortran standard.The availability of any given kind type is architecture dependent. Thefollowing pre-defined preprocessor macros can be used to conditionallyinclude code for these additional kind types: "__GFC_INT_1__","__GFC_INT_2__", "__GFC_INT_8__", "__GFC_INT_16__","__GFC_REAL_10__", and "__GFC_REAL_16__". While CPP is the de-facto standard for preprocessing Fortran code,Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) definesConditional Compilation, which is not widely used and not directlysupported by the GNU Fortran compiler. You can use the program cocoto preprocess such files (<http://www.daniellnagle.com/coco.html>). The following options control preprocessing of Fortran code: - -cpp
- -nocpp
- Enable preprocessing. The preprocessor is automatically invoked ifthe file extension is .fpp, .FPP, .F, .FOR,.FTN, .F90, .F95, .F03 or .F08. Usethis option to manually enable preprocessing of any kind of Fortran file.
To disable preprocessing of files with any of the above listed extensions,use the negative form: -nocpp. The preprocessor is run in traditional mode. Any restrictions of thefile-format, especially the limits on line length, apply forpreprocessed output as well, so it might be advisable to use the-ffree-line-length-none or -ffixed-line-length-noneoptions. - -dM
- Instead of the normal output, generate a list of '#define'directives for all the macros defined during the execution of thepreprocessor, including predefined macros. This gives you a wayof finding out what is predefined in your version of the preprocessor.Assuming you have no file foo.f90, the command
touch foo.f90; gfortran -cpp -E -dM foo.f90 will show all the predefined macros. - -dD
- Like -dM except in two respects: it does not include thepredefined macros, and it outputs both the "#define" directivesand the result of preprocessing. Both kinds of output go to thestandard output file.
- -dN
- Like -dD, but emit only the macro names, not their expansions.
- -dU
- Like dD except that only macros that are expanded, or whosedefinedness is tested in preprocessor directives, are output; the output is delayed until the use or test of the macro; and '#undef'directives are also output for macros tested but undefined at the time.
- -dI
- Output '#include' directives in addition to the resultof preprocessing.
- -fworking-directory
- Enable generation of linemarkers in the preprocessor output that willlet the compiler know the current working directory at the time ofpreprocessing. When this option is enabled, the preprocessor will emit,after the initial linemarker, a second linemarker with the currentworking directory followed by two slashes. GCC will use this directory,when it is present in the preprocessed input, as the directory emittedas the current working directory in some debugging information formats.This option is implicitly enabled if debugging information is enabled,but this can be inhibited with the negated form-fno-working-directory. If the -P flag is presentin the command line, this option has no effect, since no "#line"directives are emitted whatsoever.
- -idirafter dir
- Search dir for include files, but do it after all directoriesspecified with -I and the standard system directories havebeen exhausted. dir is treated as a system include directory.If dir begins with "=", then the "=" will be replaced bythe sysroot prefix; see --sysroot and -isysroot.
- -imultilib dir
- Use dir as a subdirectory of the directory containing target-specificC++ headers.
- -iprefix prefix
- Specify prefix as the prefix for subsequent -iwithprefixoptions. If the prefix represents a directory, you should includethe final '/'.
- -isysroot dir
- This option is like the --sysroot option, but applies only toheader files. See the --sysroot option for more information.
- -iquote dir
- Search dir only for header files requested with "#include "file"";they are not searched for "#include <file>", before all directoriesspecified by -I and before the standard system directories. Ifdir begins with "=", then the "=" will be replaced by thesysroot prefix; see --sysroot and -isysroot.
- -isystem dir
- Search dir for header files, after all directories specified by-I but before the standard system directories. Mark it as asystem directory, so that it gets the same special treatment as isapplied to the standard system directories. If dir begins with"=", then the "=" will be replaced by the sysroot prefix;see --sysroot and -isysroot.
- -nostdinc
- Do not search the standard system directories for header files. Onlythe directories you have specified with -I options (and thedirectory of the current file, if appropriate) are searched.
- -undef
- Do not predefine any system-specific or GCC-specific macros.The standard predefined macros remain defined.
- -Apredicate=answer
- Make an assertion with the predicate predicate and answer answer.This form is preferred to the older form -A predicate(answer), which is stillsupported, because it does not use shell special characters.
- -A-predicate=answer
- Cancel an assertion with the predicate predicate and answer answer.
- -C
- Do not discard comments. All comments are passed through to the outputfile, except for comments in processed directives, which are deletedalong with the directive.
You should be prepared for side effects when using -C; it causesthe preprocessor to treat comments as tokens in their own right. For example,comments appearing at the start of what would be a directive line have theeffect of turning that line into an ordinary source line, since the firsttoken on the line is no longer a '#'. Warning: this currently handles C-Style comments only. The preprocessordoes not yet recognize Fortran-style comments. - -CC
- Do not discard comments, including during macro expansion. This is like-C, except that comments contained within macros are also passedthrough to the output file where the macro is expanded.
In addition to the side-effects of the -C option, the -CCoption causes all C++-style comments inside a macro to be converted to C-stylecomments. This is to prevent later use of that macro from inadvertentlycommenting out the remainder of the source line. The -CC optionis generally used to support lint comments. Warning: this currently handles C- and C++-Style comments only. Thepreprocessor does not yet recognize Fortran-style comments. - -Dname
- Predefine name as a macro, with definition 1.
- -Dname=definition
- The contents of definition are tokenized and processed as if theyappeared during translation phase three in a '#define' directive.In particular, the definition will be truncated by embedded newlinecharacters.
If you are invoking the preprocessor from a shell or shell-like programyou may need to use the shell's quoting syntax to protect characters suchas spaces that have a meaning in the shell syntax. If you wish to define a function-like macro on the command line, writeits argument list with surrounding parentheses before the equals sign(if any). Parentheses are meaningful to most shells, so you will needto quote the option. With sh and csh, "-D'name(args...)=definition'"works. -D and -U options are processed in the order they aregiven on the command line. All -imacros file and -include file optionsare processed after all -D and -U options. - -H
- Print the name of each header file used, in addition to other normalactivities. Each name is indented to show how deep in the '#include'stack it is.
- -P
- Inhibit generation of linemarkers in the output from the preprocessor.This might be useful when running the preprocessor on something thatis not C code, and will be sent to a program which might be confusedby the linemarkers.
- -Uname
- Cancel any previous definition of name, either built in or providedwith a -D option.
Options to request or suppress errors and warningsErrors are diagnostic messages that report that the GNU Fortran compilercannot compile the relevant piece of source code. The compiler willcontinue to process the program in an attempt to report further errorsto aid in debugging, but will not produce any compiled output. Warnings are diagnostic messages that report constructions whichare not inherently erroneous but which are risky or suggest there islikely to be a bug in the program. Unless -Werror is specified,they do not prevent compilation of the program. You can request many specific warnings with options beginning -W,for example -Wimplicit to request warnings on implicitdeclarations. Each of these specific warning options also has anegative form beginning -Wno- to turn off warnings;for example, -Wno-implicit. This manual lists only one of thetwo forms, whichever is not the default. These options control the amount and kinds of errors and warnings producedby GNU Fortran: - -fmax-errors=n
- Limits the maximum number of error messages to n, at which pointGNU Fortran bails out rather than attempting to continue processing thesource code. If n is 0, there is no limit on the number of errormessages produced.
- -fsyntax-only
- Check the code for syntax errors, but do not actually compile it. Thiswill generate module files for each module present in the code, but noother output file.
- -Wpedantic
- -pedantic
- Issue warnings for uses of extensions to Fortran.-pedantic also applies to C-language constructs where theyoccur in GNU Fortran source files, such as use of \e in acharacter constant within a directive like "#include".
Valid Fortran programs should compile properly with or withoutthis option.However, without this option, certain GNU extensions and traditionalFortran features are supported as well.With this option, many of them are rejected. Some users try to use -pedantic to check programs for conformance.They soon find that it does not do quite what they want---it finds somenonstandard practices, but not all.However, improvements to GNU Fortran in this area are welcome. This should be used in conjunction with -std=f95,-std=f2003, -std=f2008 or -std=f2018. - -pedantic-errors
- Like -pedantic, except that errors are produced rather thanwarnings.
- -Wall
- Enables commonly used warning options pertaining to usage thatwe recommend avoiding and that we believe are easy to avoid.This currently includes -Waliasing, -Wampersand,-Wconversion, -Wsurprising, -Wc-binding-type,-Wintrinsics-std, -Wtabs, -Wintrinsic-shadow,-Wline-truncation, -Wtarget-lifetime,-Winteger-division, -Wreal-q-constant, -Wunusedand -Wundefined-do-loop.
- -Waliasing
- Warn about possible aliasing of dummy arguments. Specifically, it warnsif the same actual argument is associated with a dummy argument with"INTENT(IN)" and a dummy argument with "INTENT(OUT)" in a callwith an explicit interface.
The following example will trigger the warning. interface subroutine bar(a,b) integer, intent(in) :: a integer, intent(out) :: b end subroutine end interface integer :: a call bar(a,a) - -Wampersand
- Warn about missing ampersand in continued character constants. Thewarning is given with -Wampersand, -pedantic,-std=f95, -std=f2003, -std=f2008 and-std=f2018. Note: With no ampersand given in a continuedcharacter constant, GNU Fortran assumes continuation at the firstnon-comment, non-whitespace character after the ampersand thatinitiated the continuation.
- -Warray-temporaries
- Warn about array temporaries generated by the compiler. The informationgenerated by this warning is sometimes useful in optimization, in order toavoid such temporaries.
- -Wc-binding-type
- Warn if the a variable might not be C interoperable. In particular, warn if the variable has been declared using an intrinsic type with default kindinstead of using a kind parameter defined for C interoperability in theintrinsic "ISO_C_Binding" module. This option is implied by-Wall.
- -Wcharacter-truncation
- Warn when a character assignment will truncate the assigned string.
- -Wline-truncation
- Warn when a source code line will be truncated. This option isimplied by -Wall. For free-form source code, the default is-Werror=line-truncation such that truncations are reported aserror.
- -Wconversion
- Warn about implicit conversions that are likely to change the value of the expression after conversion. Implied by -Wall.
- -Wconversion-extra
- Warn about implicit conversions between different types and kinds. Thisoption does not imply -Wconversion.
- -Wextra
- Enables some warning options for usages of language features whichmay be problematic. This currently includes -Wcompare-reals,-Wunused-parameter and -Wdo-subscript.
- -Wfrontend-loop-interchange
- Warn when using -ffrontend-loop-interchange for performing loopinterchanges.
- -Wimplicit-interface
- Warn if a procedure is called without an explicit interface.Note this only checks that an explicit interface is present. It does notcheck that the declared interfaces are consistent across program units.
- -Wimplicit-procedure
- Warn if a procedure is called that has neither an explicit interfacenor has been declared as "EXTERNAL".
- -Winteger-division
- Warn if a constant integer division truncates its result.As an example, 3/5 evaluates to 0.
- -Wintrinsics-std
- Warn if gfortran finds a procedure named like an intrinsic notavailable in the currently selected standard (with -std) and treatsit as "EXTERNAL" procedure because of this. -fall-intrinsics canbe used to never trigger this behavior and always link to the intrinsicregardless of the selected standard.
- -Wno-overwrite-recursive
- Do not warn when -fno-automatic is used with -frecursive. Recursionwill be broken if the relevant local variables do not have the attribute"AUTOMATIC" explicitly declared. This option can be used to suppress the warningwhen it is known that recursion is not broken. Useful for build environments that use-Werror.
- -Wreal-q-constant
- Produce a warning if a real-literal-constant contains a "q"exponent-letter.
- -Wsurprising
- Produce a warning when ``suspicious'' code constructs are encountered.While technically legal these usually indicate that an error has been made.
This currently produces a warning under the following circumstances: - *
- An INTEGER SELECT construct has a CASE that can never be matched as itslower value is greater than its upper value.
- *
- A LOGICAL SELECT construct has three CASE statements.
- *
- A TRANSFER specifies a source that is shorter than the destination.
- *
- The type of a function result is declared more than once with the same type. If-pedantic or standard-conforming mode is enabled, this is an error.
- *
- A "CHARACTER" variable is declared with negative length.
- -Wtabs
- By default, tabs are accepted as whitespace, but tabs are not membersof the Fortran Character Set. For continuation lines, a tab followedby a digit between 1 and 9 is supported. -Wtabs will cause awarning to be issued if a tab is encountered. Note, -Wtabs isactive for -pedantic, -std=f95, -std=f2003,-std=f2008, -std=f2018 and-Wall.
- -Wundefined-do-loop
- Warn if a DO loop with step either 1 or -1 yields an underflow or an overflowduring iteration of an induction variable of the loop.This option is implied by -Wall.
- -Wunderflow
- Produce a warning when numerical constant expressions areencountered, which yield an UNDERFLOW during compilation. Enabled by default.
- -Wintrinsic-shadow
- Warn if a user-defined procedure or module procedure has the same name as anintrinsic; in this case, an explicit interface or "EXTERNAL" or"INTRINSIC" declaration might be needed to get calls later resolved tothe desired intrinsic/procedure. This option is implied by -Wall.
- -Wuse-without-only
- Warn if a "USE" statement has no "ONLY" qualifier and thus implicitly imports all public entities of the used module.
- -Wunused-dummy-argument
- Warn about unused dummy arguments. This option is implied by -Wall.
- -Wunused-parameter
- Contrary to gcc's meaning of -Wunused-parameter,gfortran's implementation of this option does not warnabout unused dummy arguments (see -Wunused-dummy-argument),but about unused "PARAMETER" values. -Wunused-parameteris implied by -Wextra if also -Wunused or-Wall is used.
- -Walign-commons
- By default, gfortran warns about any occasion of variables beingpadded for proper alignment inside a "COMMON" block. This warning can be turnedoff via -Wno-align-commons. See also -falign-commons.
- -Wfunction-elimination
- Warn if any calls to impure functions are eliminated by the optimizationsenabled by the -ffrontend-optimize option.This option is implied by -Wextra.
- -Wrealloc-lhs
- Warn when the compiler might insert code to for allocation or reallocation ofan allocatable array variable of intrinsic type in intrinsic assignments. Inhot loops, the Fortran 2003 reallocation feature may reduce the performance.If the array is already allocated with the correct shape, consider using awhole-array array-spec (e.g. "(:,:,:)") for the variable on the left-handside to prevent the reallocation check. Note that in some cases the warningis shown, even if the compiler will optimize reallocation checks away. Forinstance, when the right-hand side contains the same variable multiplied bya scalar. See also -frealloc-lhs.
- -Wrealloc-lhs-all
- Warn when the compiler inserts code to for allocation or reallocation of anallocatable variable; this includes scalars and derived types.
- -Wcompare-reals
- Warn when comparing real or complex types for equality or inequality.This option is implied by -Wextra.
- -Wtarget-lifetime
- Warn if the pointer in a pointer assignment might be longer than the itstarget. This option is implied by -Wall.
- -Wzerotrip
- Warn if a "DO" loop is known to execute zero times at compiletime. This option is implied by -Wall.
- -Wdo-subscript
- Warn if an array subscript inside a DO loop could lead to anout-of-bounds access even if the compiler cannot prove that thestatement is actually executed, in cases like
real a(3) do i=1,4 if (condition(i)) then a(i) = 1.2 end if end do This option is implied by -Wextra. - -Werror
- Turns all warnings into errors.
Some of these have no effect when compiling programs written in Fortran. Options for debugging your program or GNU FortranGNU Fortran has various special options that are used for debuggingeither your program or the GNU Fortran compiler. - -fdump-fortran-original
- Output the internal parse tree after translating the source programinto internal representation. This option is mostly useful fordebugging the GNU Fortran compiler itself. The output generated bythis option might change between releases. This option may alsogenerate internal compiler errors for features which have onlyrecently been added.
- -fdump-fortran-optimized
- Output the parse tree after front-end optimization. Mostly useful fordebugging the GNU Fortran compiler itself. The output generated bythis option might change between releases. This option may alsogenerate internal compiler errors for features which have onlyrecently been added.
- -fdump-parse-tree
- Output the internal parse tree after translating the source programinto internal representation. Mostly useful for debugging the GNUFortran compiler itself. The output generated by this option mightchange between releases. This option may also generate internalcompiler errors for features which have only recently been added. Thisoption is deprecated; use "-fdump-fortran-original" instead.
- -fdebug-aux-vars
- Renames internal variables created by the gfortran front end and makesthem accessible to a debugger. The name of the internal variables thenstart with upper-case letters followed by an underscore. This option isuseful for debugging the compiler's code generation together with"-fdump-tree-original" and enabling debugging of the executableprogram by using "-g" or "-ggdb3".
- -fdump-fortran-global
- Output a list of the global identifiers after translating intomiddle-end representation. Mostly useful for debugging the GNU Fortrancompiler itself. The output generated by this option might changebetween releases. This option may also generate internal compilererrors for features which have only recently been added.
- -ffpe-trap=list
- Specify a list of floating point exception traps to enable. On mostsystems, if a floating point exception occurs and the trap for thatexception is enabled, a SIGFPE signal will be sent and the programbeing aborted, producing a core file useful for debugging. listis a (possibly empty) comma-separated list of the followingexceptions: invalid (invalid floating point operation, such as"SQRT(-1.0)"), zero (division by zero), overflow(overflow in a floating point operation), underflow (underflowin a floating point operation), inexact (loss of precisionduring operation), and denormal (operation performed on adenormal value). The first five exceptions correspond to the fiveIEEE 754 exceptions, whereas the last one (denormal) is notpart of the IEEE 754 standard but is available on some commonarchitectures such as x86.
The first three exceptions (invalid, zero, andoverflow) often indicate serious errors, and unless the programhas provisions for dealing with these exceptions, enabling traps forthese three exceptions is probably a good idea. If the option is used more than once in the command line, the lists willbe joined: '"ffpe-trap="list1 "ffpe-trap="list2'is equivalent to "ffpe-trap="list1,list2. Note that once enabled an exception cannot be disabled (no negative form). Many, if not most, floating point operations incur loss of precisiondue to rounding, and hence the "ffpe-trap=inexact" is likely tobe uninteresting in practice. By default no exception traps are enabled. - -ffpe-summary=list
- Specify a list of floating-point exceptions, whose flag status is printedto "ERROR_UNIT" when invoking "STOP" and "ERROR STOP".list can be either none, all or a comma-separated listof the following exceptions: invalid, zero, overflow,underflow, inexact and denormal. (See-ffpe-trap for a description of the exceptions.)
If the option is used more than once in the command line, only thelast one will be used. By default, a summary for all exceptions but inexact is shown. - -fno-backtrace
- When a serious runtime error is encountered or a deadly signal isemitted (segmentation fault, illegal instruction, bus error,floating-point exception, and the other POSIX signals that have theaction core), the Fortran runtime library tries to output abacktrace of the error. "-fno-backtrace" disables the backtracegeneration. This option only has influence for compilation of theFortran main program.
Options for directory searchThese options affect how GNU Fortran searchesfor files specified by the "INCLUDE" directive and where it searchesfor previously compiled modules. It also affects the search paths used by cpp when used to preprocessFortran source. - -Idir
- These affect interpretation of the "INCLUDE" directive(as well as of the "#include" directive of the cpppreprocessor).
Also note that the general behavior of -I and"INCLUDE" is pretty much the same as of -I with"#include" in the cpp preprocessor, with regard tolooking for header.gcc files and other such things. This path is also used to search for .mod files when previouslycompiled modules are required by a "USE" statement. - -Jdir
- This option specifies where to put .mod files for compiled modules.It is also added to the list of directories to searched by an "USE"statement.
The default is the current directory. - -fintrinsic-modules-path dir
- This option specifies the location of pre-compiled intrinsic modules, ifthey are not in the default location expected by the compiler.
Influencing the linking stepThese options come into play when the compiler links object files into an executable output file. They are meaningless if the compiler is not doing a link step. - -static-libgfortran
- On systems that provide libgfortran as a shared and a staticlibrary, this option forces the use of the static version. If noshared version of libgfortran was built when the compiler wasconfigured, this option has no effect.
Influencing runtime behaviorThese options affect the runtime behavior of programs compiled with GNU Fortran. - -fconvert=conversion
- Specify the representation of data for unformatted files. Validvalues for conversion on most systems are: native, the default;swap, swap between big- and little-endian; big-endian, usebig-endian representation for unformatted files; little-endian, uselittle-endian representation for unformatted files.
On POWER systems which suppport -mabi=ieeelongdouble,there are additional options, which can be combined with others withcommas. Those are - @w<-fconvert=r16_ieee Use IEEE 128-bit format for>
- "REAL(KIND=16)".
- @w<-fconvert=r16_ibm Use IBM long double format for>
- "REAL(KIND=16)".
This option has an effect only when used in the main program.The "CONVERT" specifier and the GFORTRAN_CONVERT_UNIT environmentvariable override the default specified by -fconvert.
- -frecord-marker=length
- Specify the length of record markers for unformatted files.Valid values for length are 4 and 8. Default is 4.This is different from previous versions of gfortran,which specified a default record marker length of 8 on mostsystems. If you want to read or write files compatiblewith earlier versions of gfortran, use -frecord-marker=8.
- -fmax-subrecord-length=length
- Specify the maximum length for a subrecord. The maximum permittedvalue for length is 2147483639, which is also the default. Onlyreally useful for use by the gfortran testsuite.
- -fsign-zero
- When enabled, floating point numbers of value zero with the sign bit setare written as negative number in formatted output and treated asnegative in the "SIGN" intrinsic. -fno-sign-zero does notprint the negative sign of zero values (or values rounded to zero for I/O)and regards zero as positive number in the "SIGN" intrinsic forcompatibility with Fortran 77. The default is -fsign-zero.
Options for code generation conventionsThese machine-independent options control the interface conventionsused in code generation. Most of them have both positive and negative forms; the negative formof -ffoo would be -fno-foo. In the table below, onlyone of the forms is listed---the one which is not the default. Youcan figure out the other form by either removing no- or addingit. - -fno-automatic
- Treat each program unit (except those marked as RECURSIVE) as if the"SAVE" statement were specified for every local variable and arrayreferenced in it. Does not affect common blocks. (Some Fortran compilersprovide this option under the name -static or -save.)The default, which is -fautomatic, uses the stack for localvariables smaller than the value given by -fmax-stack-var-size.Use the option -frecursive to use no static memory.
Local variables or arrays having an explicit "SAVE" attribute aresilently ignored unless the -pedantic option is added. - -ff2c
- Generate code designed to be compatible with code generatedby g77 and f2c.
The calling conventions used by g77 (originally implementedin f2c) require functions that return typedefault "REAL" to actually return the C type "double", andfunctions that return type "COMPLEX" to return the values via anextra argument in the calling sequence that points to where tostore the return value. Under the default GNU calling conventions, suchfunctions simply return their results as they would in GNUC---default "REAL" functions return the C type "float", and"COMPLEX" functions return the GNU C type "complex".Additionally, this option implies the -fsecond-underscoreoption, unless -fno-second-underscore is explicitly requested. This does not affect the generation of code that interfaces withthe libgfortran library. Caution: It is not a good idea to mix Fortran code compiled with-ff2c with code compiled with the default -fno-f2ccalling conventions as, calling "COMPLEX" or default "REAL"functions between program parts which were compiled with differentcalling conventions will break at execution time. Caution: This will break code which passes intrinsic functionsof type default "REAL" or "COMPLEX" as actual arguments, asthe library implementations use the -fno-f2c calling conventions. - -fno-underscoring
- Do not transform names of entities specified in the Fortransource file by appending underscores to them.
With -funderscoring in effect, GNU Fortran appends oneunderscore to external names with no underscores. This is done to ensurecompatibility with code produced by many UNIX Fortran compilers. Caution: The default behavior of GNU Fortran isincompatible with f2c and g77, please use the-ff2c option if you want object files compiled withGNU Fortran to be compatible with object code created with thesetools. Use of -fno-underscoring is not recommended unless you areexperimenting with issues such as integration of GNU Fortran intoexisting system environments (vis-a-vis existing libraries, tools,and so on). For example, with -funderscoring, and assuming that "j()" and"max_count()" are external functions while "my_var" and"lvar" are local variables, a statement like I = J() + MAX_COUNT (MY_VAR, LVAR) is implemented as something akin to: i = j_() + max_count__(&my_var__, &lvar); With -fno-underscoring, the same statement is implemented as: i = j() + max_count(&my_var, &lvar); Use of -fno-underscoring allows direct specification ofuser-defined names while debugging and when interfacing GNU Fortrancode with other languages. Note that just because the names match does not mean that theinterface implemented by GNU Fortran for an external name matches theinterface implemented by some other language for that same name.That is, getting code produced by GNU Fortran to link to code producedby some other compiler using this or any other method can be only asmall part of the overall solution---getting the code generated byboth compilers to agree on issues other than naming can requiresignificant effort, and, unlike naming disagreements, linkers normallycannot detect disagreements in these other areas. Also, note that with -fno-underscoring, the lack of appendedunderscores introduces the very real possibility that a user-definedexternal name will conflict with a name in a system library, whichcould make finding unresolved-reference bugs quite difficult in somecases---they might occur at program run time, and show up only asbuggy behavior at run time. In future versions of GNU Fortran we hope to improve naming and linkingissues so that debugging always involves using the names as they appearin the source, even if the names as seen by the linker are mangled toprevent accidental linking between procedures with incompatibleinterfaces. - -fsecond-underscore
- By default, GNU Fortran appends an underscore to externalnames. If this option is used GNU Fortran appends twounderscores to names with underscores and one underscore to external nameswith no underscores. GNU Fortran also appends two underscores tointernal names with underscores to avoid naming collisions with externalnames.
This option has no effect if -fno-underscoring isin effect. It is implied by the -ff2c option. Otherwise, with this option, an external name such as "MAX_COUNT"is implemented as a reference to the link-time external symbol"max_count__", instead of "max_count_". This is requiredfor compatibility with g77 and f2c, and is impliedby use of the -ff2c option. - -fcoarray=<keyword>
- none
- Disable coarray support; using coarray declarations and image-controlstatements will produce a compile-time error. (Default)
- single
- Single-image mode, i.e. "num_images()" is always one.
- lib
- Library-based coarray parallelization; a suitable GNU Fortran coarraylibrary needs to be linked.
- -fcheck=<keyword>
- Enable the generation of run-time checks; the argument shall bea comma-delimited list of the following keywords. Prefixing a check withno- disables it if it was activated by a previous specification.
- all
- Enable all run-time test of -fcheck.
- array-temps
- Warns at run time when for passing an actual argument a temporary arrayhad to be generated. The information generated by this warning issometimes useful in optimization, in order to avoid such temporaries.
Note: The warning is only printed once per location. - bits
- Enable generation of run-time checks for invalid arguments to the bitmanipulation intrinsics.
- bounds
- Enable generation of run-time checks for array subscriptsand against the declared minimum and maximum values. It alsochecks array indices for assumed and deferredshape arrays against the actual allocated bounds and ensures that all stringlengths are equal for character array constructors without an explicittypespec.
Some checks require that -fcheck=bounds is set forthe compilation of the main program. Note: In the future this may also include other forms of checking, e.g.,checking substring references. - do
- Enable generation of run-time checks for invalid modification of loopiteration variables.
- mem
- Enable generation of run-time checks for memory allocation.Note: This option does not affect explicit allocations using the"ALLOCATE" statement, which will be always checked.
- pointer
- Enable generation of run-time checks for pointers and allocatables.
- recursion
- Enable generation of run-time checks for recursively called subroutines andfunctions which are not marked as recursive. See also -frecursive.Note: This check does not work for OpenMP programs and is disabled if usedtogether with -frecursive and -fopenmp.
Example: Assuming you have a file foo.f90, the command gfortran -fcheck=all,no-array-temps foo.f90 will compile the file with all checks enabled as specified above exceptwarnings for generated array temporaries.
- -fbounds-check
- Deprecated alias for -fcheck=bounds.
- -ftail-call-workaround
- -ftail-call-workaround=n
- Some C interfaces to Fortran codes violate the gfortran ABI byomitting the hidden character length arguments as described in
This can lead to crashesbecause pushing arguments for tail calls can overflow the stack.To provide a workaround for existing binary packages, this optiondisables tail call optimization for gfortran procedures with characterarguments. With -ftail-call-workaround=2 tail call optimizationis disabled in all gfortran procedures with character arguments,with -ftail-call-workaround=1 or equivalent-ftail-call-workaround only in gfortran procedures with characterarguments that call implicitly prototyped procedures. Using this option can lead to problems including crashes due toinsufficient stack space. It is very strongly recommended to fix the code in question.The -fc-prototypes-external option can be used to generateprototypes which conform to gfortran's ABI, for inclusion in thesource code. Support for this option will likely be withdrawn in a future releaseof gfortran. The negative form, -fno-tail-call-workaround or equivalent-ftail-call-workaround=0, can be used to disable this option. Default is currently -ftail-call-workaround, this will changein future releases. - -fcheck-array-temporaries
- Deprecated alias for -fcheck=array-temps.
- -fmax-array-constructor=n
- This option can be used to increase the upper limit permitted in array constructors. The code below requires this option to expandthe array at compile time.
program test implicit none integer j integer, parameter :: n = 100000 integer, parameter :: i(n) = (/ (2*j, j = 1, n) /) print '(10(I0,1X))', i end program test Caution: This option can lead to long compile times and excessivelylarge object files. The default value for n is 65535. - -fmax-stack-var-size=n
- This option specifies the size in bytes of the largest array that will be puton the stack; if the size is exceeded static memory is used (except inprocedures marked as RECURSIVE). Use the option -frecursive toallow for recursive procedures which do not have a RECURSIVE attribute orfor parallel programs. Use -fno-automatic to never use the stack.
This option currently only affects local arrays declared with constantbounds, and may not apply to all character variables.Future versions of GNU Fortran may improve this behavior. The default value for n is 65536. - -fstack-arrays
- Adding this option will make the Fortran compiler put all arrays ofunknown size and array temporaries onto stack memory. If your program uses verylarge local arrays it is possible that you will have to extend your runtimelimits for stack memory on some operating systems. This flag is enabledby default at optimization level -Ofast unless-fmax-stack-var-size is specified.
- -fpack-derived
- This option tells GNU Fortran to pack derived type members as closely aspossible. Code compiled with this option is likely to be incompatiblewith code compiled without this option, and may execute slower.
- -frepack-arrays
- In some circumstances GNU Fortran may pass assumed shape arraysections via a descriptor describing a noncontiguous area of memory.This option adds code to the function prologue to repack the data intoa contiguous block at runtime.
This should result in faster accesses to the array. However it can introducesignificant overhead to the function call, especially when the passed datais noncontiguous. - -fshort-enums
- This option is provided for interoperability with C code that wascompiled with the -fshort-enums option. It will makeGNU Fortran choose the smallest "INTEGER" kind a givenenumerator set will fit in, and give all its enumerators this kind.
- -finline-arg-packing
- When passing an assumed-shape argument of a procedure as actualargument to an assumed-size or explicit size or as argument to aprocedure that does not have an explicit interface, the argument mayhave to be packed, that is put into contiguous memory. An example isthe call to "foo" in
subroutine foo(a) real, dimension(*) :: a end subroutine foo subroutine bar(b) real, dimension(:) :: b call foo(b) end subroutine bar When -finline-arg-packing is in effect, this packing will beperformed by inline code. This allows for more optimization whileincreasing code size. -finline-arg-packing is implied by any of the -O optionsexcept when optimizing for size via -Os. If the codecontains a very large number of argument that have to be packed, codesize and also compilation time may become excessive. If that is thecase, it may be better to disable this option. Instances of packingcan be found by using -Warray-temporaries. - -fexternal-blas
- This option will make gfortran generate calls to BLAS functionsfor some matrix operations like "MATMUL", instead of using our ownalgorithms, if the size of the matrices involved is larger than a givenlimit (see -fblas-matmul-limit). This may be profitable if anoptimized vendor BLAS library is available. The BLAS library will haveto be specified at link time.
- -fblas-matmul-limit=n
- Only significant when -fexternal-blas is in effect.Matrix multiplication of matrices with size larger than (or equal to) nwill be performed by calls to BLAS functions, while others will behandled by gfortran internal algorithms. If the matricesinvolved are not square, the size comparison is performed using thegeometric mean of the dimensions of the argument and result matrices.
The default value for n is 30. - -finline-matmul-limit=n
- When front-end optimization is active, some calls to the "MATMUL"intrinsic function will be inlined. This may result in code sizeincrease if the size of the matrix cannot be determined at compiletime, as code for both cases is generated. Setting"-finline-matmul-limit=0" will disable inlining in all cases.Setting this option with a value of n will produce inline codefor matrices with size up to n. If the matrices involved are notsquare, the size comparison is performed using the geometric mean ofthe dimensions of the argument and result matrices.
The default value for n is 30. The "-fblas-matmul-limit"can be used to change this value. - -frecursive
- Allow indirect recursion by forcing all local arrays to be allocatedon the stack. This flag cannot be used together with-fmax-stack-var-size= or -fno-automatic.
- -finit-local-zero
- -finit-derived
- -finit-integer=n
- -finit-real=<zero|inf|-inf|nan|snan>
- -finit-logical=<true|false>
- -finit-character=n
- The -finit-local-zero option instructs the compiler toinitialize local "INTEGER", "REAL", and "COMPLEX"variables to zero, "LOGICAL" variables to false, and"CHARACTER" variables to a string of null bytes. Finer-grainedinitialization options are provided by the-finit-integer=n,-finit-real=<zero|inf|-inf|nan|snan> (which also initializesthe real and imaginary parts of local "COMPLEX" variables),-finit-logical=<true|false>, and-finit-character=n (where n is an ASCII charactervalue) options.
With -finit-derived, components of derived type variables will beinitialized according to these flags. Components whose type is not covered byan explicit -finit-* flag will be treated as described above with-finit-local-zero. These options do not initialize - *
- objects with the POINTER attribute
- *
- allocatable arrays
- *
- variables that appear in an "EQUIVALENCE" statement.
(These limitations may be removed in future releases). Note that the -finit-real=nan option initializes "REAL"and "COMPLEX" variables with a quiet NaN. For a signalling NaNuse -finit-real=snan; note, however, that compile-timeoptimizations may convert them into quiet NaN and that trappingneeds to be enabled (e.g. via -ffpe-trap). The -finit-integer option will parse the value into aninteger of type "INTEGER(kind=C_LONG)" on the host. Said valueis then assigned to the integer variables in the Fortran code, whichmight result in wraparound if the value is too large for the kind. Finally, note that enabling any of the -finit-* options willsilence warnings that would have been emitted by -Wuninitializedfor the affected local variables.
- -falign-commons
- By default, gfortran enforces proper alignment of all variables in a"COMMON" block by padding them as needed. On certain platforms this is mandatory,on others it increases performance. If a "COMMON" block is not declared withconsistent data types everywhere, this padding can cause trouble, and-fno-align-commons can be used to disable automatic alignment. Thesame form of this option should be used for all files that share a "COMMON" block.To avoid potential alignment issues in "COMMON" blocks, it is recommended to orderobjects from largest to smallest.
- -fno-protect-parens
- By default the parentheses in expression are honored for all optimizationlevels such that the compiler does not do any re-association. Using-fno-protect-parens allows the compiler to reorder "REAL" and"COMPLEX" expressions to produce faster code. Note that for the re-associationoptimization -fno-signed-zeros and -fno-trapping-mathneed to be in effect. The parentheses protection is enabled by default, unless-Ofast is given.
- -frealloc-lhs
- An allocatable left-hand side of an intrinsic assignment is automatically(re)allocated if it is either unallocated or has a different shape. Theoption is enabled by default except when -std=f95 is given. Seealso -Wrealloc-lhs.
- -faggressive-function-elimination
- Functions with identical argument lists are eliminated withinstatements, regardless of whether these functions are marked"PURE" or not. For example, in
a = f(b,c) + f(b,c) there will only be a single call to "f". This option only worksif -ffrontend-optimize is in effect. - -ffrontend-optimize
- This option performs front-end optimization, based on manipulatingparts the Fortran parse tree. Enabled by default by any -O optionexcept -O0 and -Og. Optimizations enabled by this optioninclude:
- *<inlining calls to "MATMUL",>
- *<elimination of identical function calls within expressions,>
- *<removing unnecessary calls to "TRIM" in comparisons and assignments,>
- *<replacing TRIM(a) with "a(1:LEN_TRIM(a))" and>
- *<short-circuiting of logical operators (".AND." and ".OR.").>
It can be deselected by specifying -fno-frontend-optimize.
- -ffrontend-loop-interchange
- Attempt to interchange loops in the Fortran front end whereprofitable. Enabled by default by any -O option.At the moment, this option only affects "FORALL" and"DO CONCURRENT" statements with several forall triplets.
ENVIRONMENTThe gfortran compiler currently does not make use of any environmentvariables to control its operation above and beyond thosethat affect the operation of gcc. BUGSFor instructions on reporting bugs, see< http://bugs.pld-linux.org>. SEE ALSOgpl(7), gfdl(7), fsf-funding(7), cpp(1), gcov(1), gcc(1), as(1), ld(1), gdb(1), dbx(1)and the Info entries for gcc, cpp, gfortran, as, ld, binutils and gdb. AUTHORSee the Info entry for gfortran for contributors to GCC and GNU Fortran. COPYRIGHTCopyright (c) 2004-2022 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.3 orany later version published by the Free Software Foundation; with theInvariant Sections being ``Funding Free Software'', the Front-CoverTexts 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 FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: 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. Index- NAME
- SYNOPSIS
- DESCRIPTION
- OPTIONS
- Options controlling Fortran dialect
- Enable and customize preprocessing
- Options to request or suppress errors and warnings
- Options for debugging your program or GNU Fortran
- Options for directory search
- Influencing the linking step
- Influencing runtime behavior
- Options for code generation conventions
- ENVIRONMENT
- BUGS
- SEE ALSO
- AUTHOR
- COPYRIGHT
This document was created byman2html,using the manual pages. |
|
|