1GFORTRAN(1) GNU GFORTRAN(1)
2
3
4
6 gfortran - GNU Fortran compiler
7
9 gfortran [-c|-S|-E]
10 [-g] [-pg] [-Olevel]
11 [-Wwarn...] [-pedantic]
12 [-Idir...] [-Ldir...]
13 [-Dmacro[=defn]...] [-Umacro]
14 [-foption...]
15 [-mmachine-option...]
16 [-o outfile] infile...
17
18 Only the most useful options are listed here; see below for the
19 remainder.
20
22 The gfortran command supports all the options supported by the gcc
23 command. Only options specific to GNU Fortran are documented here.
24
25 All GCC and GNU Fortran options are accepted both by gfortran and by
26 gcc (as well as any other drivers built at the same time, such as g++),
27 since adding GNU Fortran to the GCC distribution enables acceptance of
28 GNU Fortran options by all of the relevant drivers.
29
30 In some cases, options have positive and negative forms; the negative
31 form of -ffoo would be -fno-foo. This manual documents only one of
32 these two forms, whichever one is not the default.
33
35 Here is a summary of all the options specific to GNU Fortran, grouped
36 by type. Explanations are in the following sections.
37
38 Fortran Language Options
39 -fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code
40 -fd-lines-as-comments -fdec -fdec-structure -fdec-intrinsic-ints
41 -fdec-static -fdec-math -fdec-include -fdefault-double-8
42 -fdefault-integer-8 -fdefault-real-8 -fdefault-real-10
43 -fdefault-real-16 -fdollar-ok -ffixed-line-length-n
44 -ffixed-line-length-none -fpad-source -ffree-form
45 -ffree-line-length-n -ffree-line-length-none -fimplicit-none
46 -finteger-4-integer-8 -fmax-identifier-length -fmodule-private
47 -ffixed-form -fno-range-check -fopenacc -fopenmp -freal-4-real-10
48 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 -freal-8-real-16
49 -freal-8-real-4 -std=std -ftest-forall-temp
50
51 Preprocessing Options
52 -A-question[=answer] -Aquestion=answer -C -CC -Dmacro[=defn] -H -P
53 -Umacro -cpp -dD -dI -dM -dN -dU -fworking-directory -imultilib dir
54 -iprefix file -iquote -isysroot dir -isystem dir -nocpp -nostdinc
55 -undef
56
57 Error and Warning Options
58 -Waliasing -Wall -Wampersand -Wargument-mismatch -Warray-bounds
59 -Wc-binding-type -Wcharacter-truncation -Wconversion -Wdo-subscript
60 -Wfunction-elimination -Wimplicit-interface -Wimplicit-procedure
61 -Wintrinsic-shadow -Wuse-without-only -Wintrinsics-std
62 -Wline-truncation -Wno-align-commons -Wno-tabs -Wreal-q-constant
63 -Wsurprising -Wunderflow -Wunused-parameter -Wrealloc-lhs
64 -Wrealloc-lhs-all -Wfrontend-loop-interchange -Wtarget-lifetime
65 -fmax-errors=n -fsyntax-only -pedantic -pedantic-errors
66
67 Debugging Options
68 -fbacktrace -fdump-fortran-optimized -fdump-fortran-original
69 -fdump-parse-tree -ffpe-trap=list -ffpe-summary=list
70
71 Directory Options
72 -Idir -Jdir -fintrinsic-modules-path dir
73
74 Link Options
75 -static-libgfortran
76
77 Runtime Options
78 -fconvert=conversion -fmax-subrecord-length=length
79 -frecord-marker=length -fsign-zero
80
81 Interoperability Options
82 -fc-prototypes
83
84 Code Generation Options
85 -faggressive-function-elimination -fblas-matmul-limit=n
86 -fbounds-check -fcheck-array-temporaries
87 -fcheck=<all|array-temps|bounds|do|mem|pointer|recursion>
88 -fcoarray=<none|single|lib> -fexternal-blas -ff2c
89 -ffrontend-loop-interchange -ffrontend-optimize -finit-character=n
90 -finit-integer=n -finit-local-zero -finit-derived
91 -finit-logical=<true|false> -finit-real=<zero|inf|-inf|nan|snan>
92 -finline-matmul-limit=n -fmax-array-constructor=n
93 -fmax-stack-var-size=n -fno-align-commons -fno-automatic
94 -fno-protect-parens -fno-underscoring -fsecond-underscore
95 -fpack-derived -frealloc-lhs -frecursive -frepack-arrays
96 -fshort-enums -fstack-arrays
97
98 Options controlling Fortran dialect
99 The following options control the details of the Fortran dialect
100 accepted by the compiler:
101
102 -ffree-form
103 -ffixed-form
104 Specify the layout used by the source file. The free form layout
105 was introduced in Fortran 90. Fixed form was traditionally used in
106 older Fortran programs. When neither option is specified, the
107 source form is determined by the file extension.
108
109 -fall-intrinsics
110 This option causes all intrinsic procedures (including the GNU-
111 specific extensions) to be accepted. This can be useful with
112 -std=f95 to force standard-compliance but get access to the full
113 range of intrinsics available with gfortran. As a consequence,
114 -Wintrinsics-std will be ignored and no user-defined procedure with
115 the same name as any intrinsic will be called except when it is
116 explicitly declared "EXTERNAL".
117
118 -fd-lines-as-code
119 -fd-lines-as-comments
120 Enable special treatment for lines beginning with "d" or "D" in
121 fixed form sources. If the -fd-lines-as-code option is given they
122 are treated as if the first column contained a blank. If the
123 -fd-lines-as-comments option is given, they are treated as comment
124 lines.
125
126 -fdec
127 DEC compatibility mode. Enables extensions and other features that
128 mimic the default behavior of older compilers (such as DEC). These
129 features are non-standard and should be avoided at all costs. For
130 details on GNU Fortran's implementation of these extensions see the
131 full documentation.
132
133 Other flags enabled by this switch are: -fdollar-ok -fcray-pointer
134 -fdec-structure -fdec-intrinsic-ints -fdec-static -fdec-math
135
136 If -fd-lines-as-code/-fd-lines-as-comments are unset, then -fdec
137 also sets -fd-lines-as-comments.
138
139 -fdec-structure
140 Enable DEC "STRUCTURE" and "RECORD" as well as "UNION", "MAP", and
141 dot ('.') as a member separator (in addition to '%'). This is
142 provided for compatibility only; Fortran 90 derived types should be
143 used instead where possible.
144
145 -fdec-intrinsic-ints
146 Enable B/I/J/K kind variants of existing integer functions (e.g.
147 BIAND, IIAND, JIAND, etc...). For a complete list of intrinsics see
148 the full documentation.
149
150 -fdec-math
151 Enable legacy math intrinsics such as COTAN and degree-valued
152 trigonometric functions (e.g. TAND, ATAND, etc...) for
153 compatability with older code.
154
155 -fdec-static
156 Enable DEC-style STATIC and AUTOMATIC attributes to explicitly
157 specify the storage of variables and other objects.
158
159 -fdec-include
160 Enable parsing of INCLUDE as a statement in addition to parsing it
161 as INCLUDE line. When parsed as INCLUDE statement, INCLUDE does
162 not have to be on a single line and can use line continuations.
163
164 -fdollar-ok
165 Allow $ as a valid non-first character in a symbol name. Symbols
166 that start with $ are rejected since it is unclear which rules to
167 apply to implicit typing as different vendors implement different
168 rules. Using $ in "IMPLICIT" statements is also rejected.
169
170 -fbackslash
171 Change the interpretation of backslashes in string literals from a
172 single backslash character to "C-style" escape characters. The
173 following combinations are expanded "\a", "\b", "\f", "\n", "\r",
174 "\t", "\v", "\\", and "\0" to the ASCII characters alert,
175 backspace, form feed, newline, carriage return, horizontal tab,
176 vertical tab, backslash, and NUL, respectively. Additionally,
177 "\x"nn, "\u"nnnn and "\U"nnnnnnnn (where each n is a hexadecimal
178 digit) are translated into the Unicode characters corresponding to
179 the specified code points. All other combinations of a character
180 preceded by \ are unexpanded.
181
182 -fmodule-private
183 Set the default accessibility of module entities to "PRIVATE".
184 Use-associated entities will not be accessible unless they are
185 explicitly declared as "PUBLIC".
186
187 -ffixed-line-length-n
188 Set column after which characters are ignored in typical fixed-form
189 lines in the source file, and, unless "-fno-pad-source", through
190 which spaces are assumed (as if padded to that length) after the
191 ends of short fixed-form lines.
192
193 Popular values for n include 72 (the standard and the default), 80
194 (card image), and 132 (corresponding to "extended-source" options
195 in some popular compilers). n may also be none, meaning that the
196 entire line is meaningful and that continued character constants
197 never have implicit spaces appended to them to fill out the line.
198 -ffixed-line-length-0 means the same thing as
199 -ffixed-line-length-none.
200
201 -fno-pad-source
202 By default fixed-form lines have spaces assumed (as if padded to
203 that length) after the ends of short fixed-form lines. This is not
204 done either if -ffixed-line-length-0, -ffixed-line-length-none or
205 if -fno-pad-source option is used. With any of those options
206 continued character constants never have implicit spaces appended
207 to them to fill out the line.
208
209 -ffree-line-length-n
210 Set column after which characters are ignored in typical free-form
211 lines in the source file. The default value is 132. n may be none,
212 meaning that the entire line is meaningful. -ffree-line-length-0
213 means the same thing as -ffree-line-length-none.
214
215 -fmax-identifier-length=n
216 Specify the maximum allowed identifier length. Typical values are
217 31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
218
219 -fimplicit-none
220 Specify that no implicit typing is allowed, unless overridden by
221 explicit "IMPLICIT" statements. This is the equivalent of adding
222 "implicit none" to the start of every procedure.
223
224 -fcray-pointer
225 Enable the Cray pointer extension, which provides C-like pointer
226 functionality.
227
228 -fopenacc
229 Enable the OpenACC extensions. This includes OpenACC "!$acc"
230 directives in free form and "c$acc", *$acc and "!$acc" directives
231 in fixed form, "!$" conditional compilation sentinels in free form
232 and "c$", "*$" and "!$" sentinels in fixed form, and when linking
233 arranges for the OpenACC runtime library to be linked in.
234
235 Note that this is an experimental feature, incomplete, and subject
236 to change in future versions of GCC. See
237 <https://gcc.gnu.org/wiki/OpenACC> for more information.
238
239 -fopenmp
240 Enable the OpenMP extensions. This includes OpenMP "!$omp"
241 directives in free form and "c$omp", *$omp and "!$omp" directives
242 in fixed form, "!$" conditional compilation sentinels in free form
243 and "c$", "*$" and "!$" sentinels in fixed form, and when linking
244 arranges for the OpenMP runtime library to be linked in. The
245 option -fopenmp implies -frecursive.
246
247 -fno-range-check
248 Disable range checking on results of simplification of constant
249 expressions during compilation. For example, GNU Fortran will give
250 an error at compile time when simplifying "a = 1. / 0". With this
251 option, no error will be given and "a" will be assigned the value
252 "+Infinity". If an expression evaluates to a value outside of the
253 relevant range of ["-HUGE()":"HUGE()"], then the expression will be
254 replaced by "-Inf" or "+Inf" as appropriate. Similarly, "DATA
255 i/Z'FFFFFFFF'/" will result in an integer overflow on most systems,
256 but with -fno-range-check the value will "wrap around" and "i" will
257 be initialized to -1 instead.
258
259 -fdefault-integer-8
260 Set the default integer and logical types to an 8 byte wide type.
261 This option also affects the kind of integer constants like 42.
262 Unlike -finteger-4-integer-8, it does not promote variables with
263 explicit kind declaration.
264
265 -fdefault-real-8
266 Set the default real type to an 8 byte wide type. This option also
267 affects the kind of non-double real constants like 1.0. This
268 option promotes the default width of "DOUBLE PRECISION" and double
269 real constants like "1.d0" to 16 bytes if possible. If
270 "-fdefault-double-8" is given along with "fdefault-real-8", "DOUBLE
271 PRECISION" and double real constants are not promoted. Unlike
272 -freal-4-real-8, "fdefault-real-8" does not promote variables with
273 explicit kind declarations.
274
275 -fdefault-real-10
276 Set the default real type to an 10 byte wide type. This option
277 also affects the kind of non-double real constants like 1.0. This
278 option promotes the default width of "DOUBLE PRECISION" and double
279 real constants like "1.d0" to 16 bytes if possible. If
280 "-fdefault-double-8" is given along with "fdefault-real-10",
281 "DOUBLE PRECISION" and double real constants are not promoted.
282 Unlike -freal-4-real-10, "fdefault-real-10" does not promote
283 variables with explicit kind declarations.
284
285 -fdefault-real-16
286 Set the default real type to an 16 byte wide type. This option
287 also affects the kind of non-double real constants like 1.0. This
288 option promotes the default width of "DOUBLE PRECISION" and double
289 real constants like "1.d0" to 16 bytes if possible. If
290 "-fdefault-double-8" is given along with "fdefault-real-16",
291 "DOUBLE PRECISION" and double real constants are not promoted.
292 Unlike -freal-4-real-16, "fdefault-real-16" does not promote
293 variables with explicit kind declarations.
294
295 -fdefault-double-8
296 Set the "DOUBLE PRECISION" type and double real constants like
297 "1.d0" to an 8 byte wide type. Do nothing if this is already the
298 default. This option prevents -fdefault-real-8, -fdefault-real-10,
299 and -fdefault-real-16, from promoting "DOUBLE PRECISION" and double
300 real constants like "1.d0" to 16 bytes.
301
302 -finteger-4-integer-8
303 Promote all "INTEGER(KIND=4)" entities to an "INTEGER(KIND=8)"
304 entities. If "KIND=8" is unavailable, then an error will be
305 issued. This option should be used with care and may not be
306 suitable for your codes. Areas of possible concern include calls
307 to external procedures, alignment in "EQUIVALENCE" and/or "COMMON",
308 generic interfaces, BOZ literal constant conversion, and I/O.
309 Inspection of the intermediate representation of the translated
310 Fortran code, produced by -fdump-tree-original, is suggested.
311
312 -freal-4-real-8
313 -freal-4-real-10
314 -freal-4-real-16
315 -freal-8-real-4
316 -freal-8-real-10
317 -freal-8-real-16
318 Promote all "REAL(KIND=M)" entities to "REAL(KIND=N)" entities. If
319 "REAL(KIND=N)" is unavailable, then an error will be issued. All
320 other real kind types are unaffected by this option. These options
321 should be used with care and may not be suitable for your codes.
322 Areas of possible concern include calls to external procedures,
323 alignment in "EQUIVALENCE" and/or "COMMON", generic interfaces, BOZ
324 literal constant conversion, and I/O. Inspection of the
325 intermediate representation of the translated Fortran code,
326 produced by -fdump-tree-original, is suggested.
327
328 -std=std
329 Specify the standard to which the program is expected to conform,
330 which may be one of f95, f2003, f2008, f2018, gnu, or legacy. The
331 default value for std is gnu, which specifies a superset of the
332 latest Fortran standard that includes all of the extensions
333 supported by GNU Fortran, although warnings will be given for
334 obsolete extensions not recommended for use in new code. The
335 legacy value is equivalent but without the warnings for obsolete
336 extensions, and may be useful for old non-standard programs. The
337 f95, f2003, f2008, and f2018 values specify strict conformance to
338 the Fortran 95, Fortran 2003, Fortran 2008 and Fortran 2018
339 standards, respectively; errors are given for all extensions beyond
340 the relevant language standard, and warnings are given for the
341 Fortran 77 features that are permitted but obsolescent in later
342 standards. The deprecated option -std=f2008ts acts as an alias for
343 -std=f2018. It is only present for backwards compatibility with
344 earlier gfortran versions and should not be used any more.
345
346 -ftest-forall-temp
347 Enhance test coverage by forcing most forall assignments to use
348 temporary.
349
350 Enable and customize preprocessing
351 Preprocessor related options. See section Preprocessing and conditional
352 compilation for more detailed information on preprocessing in gfortran.
353
354 -cpp
355 -nocpp
356 Enable preprocessing. The preprocessor is automatically invoked if
357 the file extension is .fpp, .FPP, .F, .FOR, .FTN, .F90, .F95, .F03
358 or .F08. Use this option to manually enable preprocessing of any
359 kind of Fortran file.
360
361 To disable preprocessing of files with any of the above listed
362 extensions, use the negative form: -nocpp.
363
364 The preprocessor is run in traditional mode. Any restrictions of
365 the file-format, especially the limits on line length, apply for
366 preprocessed output as well, so it might be advisable to use the
367 -ffree-line-length-none or -ffixed-line-length-none options.
368
369 -dM Instead of the normal output, generate a list of '#define'
370 directives for all the macros defined during the execution of the
371 preprocessor, including predefined macros. This gives you a way of
372 finding out what is predefined in your version of the preprocessor.
373 Assuming you have no file foo.f90, the command
374
375 touch foo.f90; gfortran -cpp -E -dM foo.f90
376
377 will show all the predefined macros.
378
379 -dD Like -dM except in two respects: it does not include the predefined
380 macros, and it outputs both the "#define" directives and the result
381 of preprocessing. Both kinds of output go to the standard output
382 file.
383
384 -dN Like -dD, but emit only the macro names, not their expansions.
385
386 -dU Like dD except that only macros that are expanded, or whose
387 definedness is tested in preprocessor directives, are output; the
388 output is delayed until the use or test of the macro; and '#undef'
389 directives are also output for macros tested but undefined at the
390 time.
391
392 -dI Output '#include' directives in addition to the result of
393 preprocessing.
394
395 -fworking-directory
396 Enable generation of linemarkers in the preprocessor output that
397 will let the compiler know the current working directory at the
398 time of preprocessing. When this option is enabled, the
399 preprocessor will emit, after the initial linemarker, a second
400 linemarker with the current working directory followed by two
401 slashes. GCC will use this directory, when it is present in the
402 preprocessed input, as the directory emitted as the current working
403 directory in some debugging information formats. This option is
404 implicitly enabled if debugging information is enabled, but this
405 can be inhibited with the negated form -fno-working-directory. If
406 the -P flag is present in the command line, this option has no
407 effect, since no "#line" directives are emitted whatsoever.
408
409 -idirafter dir
410 Search dir for include files, but do it after all directories
411 specified with -I and the standard system directories have been
412 exhausted. dir is treated as a system include directory. If dir
413 begins with "=", then the "=" will be replaced by the sysroot
414 prefix; see --sysroot and -isysroot.
415
416 -imultilib dir
417 Use dir as a subdirectory of the directory containing target-
418 specific C++ headers.
419
420 -iprefix prefix
421 Specify prefix as the prefix for subsequent -iwithprefix options.
422 If the prefix represents a directory, you should include the final
423 '/'.
424
425 -isysroot dir
426 This option is like the --sysroot option, but applies only to
427 header files. See the --sysroot option for more information.
428
429 -iquote dir
430 Search dir only for header files requested with "#include "file"";
431 they are not searched for "#include <file>", before all directories
432 specified by -I and before the standard system directories. If dir
433 begins with "=", then the "=" will be replaced by the sysroot
434 prefix; see --sysroot and -isysroot.
435
436 -isystem dir
437 Search dir for header files, after all directories specified by -I
438 but before the standard system directories. Mark it as a system
439 directory, so that it gets the same special treatment as is applied
440 to the standard system directories. If dir begins with "=", then
441 the "=" will be replaced by the sysroot prefix; see --sysroot and
442 -isysroot.
443
444 -nostdinc
445 Do not search the standard system directories for header files.
446 Only the directories you have specified with -I options (and the
447 directory of the current file, if appropriate) are searched.
448
449 -undef
450 Do not predefine any system-specific or GCC-specific macros. The
451 standard predefined macros remain defined.
452
453 -Apredicate=answer
454 Make an assertion with the predicate predicate and answer answer.
455 This form is preferred to the older form -A predicate(answer),
456 which is still supported, because it does not use shell special
457 characters.
458
459 -A-predicate=answer
460 Cancel an assertion with the predicate predicate and answer answer.
461
462 -C Do not discard comments. All comments are passed through to the
463 output file, except for comments in processed directives, which are
464 deleted along with the directive.
465
466 You should be prepared for side effects when using -C; it causes
467 the preprocessor to treat comments as tokens in their own right.
468 For example, comments appearing at the start of what would be a
469 directive line have the effect of turning that line into an
470 ordinary source line, since the first token on the line is no
471 longer a '#'.
472
473 Warning: this currently handles C-Style comments only. The
474 preprocessor does not yet recognize Fortran-style comments.
475
476 -CC Do not discard comments, including during macro expansion. This is
477 like -C, except that comments contained within macros are also
478 passed through to the output file where the macro is expanded.
479
480 In addition to the side-effects of the -C option, the -CC option
481 causes all C++-style comments inside a macro to be converted to
482 C-style comments. This is to prevent later use of that macro from
483 inadvertently commenting out the remainder of the source line. The
484 -CC option is generally used to support lint comments.
485
486 Warning: this currently handles C- and C++-Style comments only. The
487 preprocessor does not yet recognize Fortran-style comments.
488
489 -Dname
490 Predefine name as a macro, with definition 1.
491
492 -Dname=definition
493 The contents of definition are tokenized and processed as if they
494 appeared during translation phase three in a '#define' directive.
495 In particular, the definition will be truncated by embedded newline
496 characters.
497
498 If you are invoking the preprocessor from a shell or shell-like
499 program you may need to use the shell's quoting syntax to protect
500 characters such as spaces that have a meaning in the shell syntax.
501
502 If you wish to define a function-like macro on the command line,
503 write its argument list with surrounding parentheses before the
504 equals sign (if any). Parentheses are meaningful to most shells, so
505 you will need to quote the option. With sh and csh,
506 "-D'name(args...)=definition'" works.
507
508 -D and -U options are processed in the order they are given on the
509 command line. All -imacros file and -include file options are
510 processed after all -D and -U options.
511
512 -H Print the name of each header file used, in addition to other
513 normal activities. Each name is indented to show how deep in the
514 '#include' stack it is.
515
516 -P Inhibit generation of linemarkers in the output from the
517 preprocessor. This might be useful when running the preprocessor
518 on something that is not C code, and will be sent to a program
519 which might be confused by the linemarkers.
520
521 -Uname
522 Cancel any previous definition of name, either built in or provided
523 with a -D option.
524
525 Options to request or suppress errors and warnings
526 Errors are diagnostic messages that report that the GNU Fortran
527 compiler cannot compile the relevant piece of source code. The
528 compiler will continue to process the program in an attempt to report
529 further errors to aid in debugging, but will not produce any compiled
530 output.
531
532 Warnings are diagnostic messages that report constructions which are
533 not inherently erroneous but which are risky or suggest there is likely
534 to be a bug in the program. Unless -Werror is specified, they do not
535 prevent compilation of the program.
536
537 You can request many specific warnings with options beginning -W, for
538 example -Wimplicit to request warnings on implicit declarations. Each
539 of these specific warning options also has a negative form beginning
540 -Wno- to turn off warnings; for example, -Wno-implicit. This manual
541 lists only one of the two forms, whichever is not the default.
542
543 These options control the amount and kinds of errors and warnings
544 produced by GNU Fortran:
545
546 -fmax-errors=n
547 Limits the maximum number of error messages to n, at which point
548 GNU Fortran bails out rather than attempting to continue processing
549 the source code. If n is 0, there is no limit on the number of
550 error messages produced.
551
552 -fsyntax-only
553 Check the code for syntax errors, but do not actually compile it.
554 This will generate module files for each module present in the
555 code, but no other output file.
556
557 -Wpedantic
558 -pedantic
559 Issue warnings for uses of extensions to Fortran. -pedantic also
560 applies to C-language constructs where they occur in GNU Fortran
561 source files, such as use of \e in a character constant within a
562 directive like "#include".
563
564 Valid Fortran programs should compile properly with or without this
565 option. However, without this option, certain GNU extensions and
566 traditional Fortran features are supported as well. With this
567 option, many of them are rejected.
568
569 Some users try to use -pedantic to check programs for conformance.
570 They soon find that it does not do quite what they want---it finds
571 some nonstandard practices, but not all. However, improvements to
572 GNU Fortran in this area are welcome.
573
574 This should be used in conjunction with -std=f95, -std=f2003,
575 -std=f2008 or -std=f2018.
576
577 -pedantic-errors
578 Like -pedantic, except that errors are produced rather than
579 warnings.
580
581 -Wall
582 Enables commonly used warning options pertaining to usage that we
583 recommend avoiding and that we believe are easy to avoid. This
584 currently includes -Waliasing, -Wampersand, -Wconversion,
585 -Wsurprising, -Wc-binding-type, -Wintrinsics-std, -Wtabs,
586 -Wintrinsic-shadow, -Wline-truncation, -Wtarget-lifetime,
587 -Winteger-division, -Wreal-q-constant, -Wunused and
588 -Wundefined-do-loop.
589
590 -Waliasing
591 Warn about possible aliasing of dummy arguments. Specifically, it
592 warns if the same actual argument is associated with a dummy
593 argument with "INTENT(IN)" and a dummy argument with "INTENT(OUT)"
594 in a call with an explicit interface.
595
596 The following example will trigger the warning.
597
598 interface
599 subroutine bar(a,b)
600 integer, intent(in) :: a
601 integer, intent(out) :: b
602 end subroutine
603 end interface
604 integer :: a
605
606 call bar(a,a)
607
608 -Wampersand
609 Warn about missing ampersand in continued character constants. The
610 warning is given with -Wampersand, -pedantic, -std=f95, -std=f2003,
611 -std=f2008 and -std=f2018. Note: With no ampersand given in a
612 continued character constant, GNU Fortran assumes continuation at
613 the first non-comment, non-whitespace character after the ampersand
614 that initiated the continuation.
615
616 -Wargument-mismatch
617 Warn about type, rank, and other mismatches between formal
618 parameters and actual arguments to functions and subroutines.
619 These warnings are recommended and thus enabled by default.
620
621 -Warray-temporaries
622 Warn about array temporaries generated by the compiler. The
623 information generated by this warning is sometimes useful in
624 optimization, in order to avoid such temporaries.
625
626 -Wc-binding-type
627 Warn if the a variable might not be C interoperable. In
628 particular, warn if the variable has been declared using an
629 intrinsic type with default kind instead of using a kind parameter
630 defined for C interoperability in the intrinsic "ISO_C_Binding"
631 module. This option is implied by -Wall.
632
633 -Wcharacter-truncation
634 Warn when a character assignment will truncate the assigned string.
635
636 -Wline-truncation
637 Warn when a source code line will be truncated. This option is
638 implied by -Wall. For free-form source code, the default is
639 -Werror=line-truncation such that truncations are reported as
640 error.
641
642 -Wconversion
643 Warn about implicit conversions that are likely to change the value
644 of the expression after conversion. Implied by -Wall.
645
646 -Wconversion-extra
647 Warn about implicit conversions between different types and kinds.
648 This option does not imply -Wconversion.
649
650 -Wextra
651 Enables some warning options for usages of language features which
652 may be problematic. This currently includes -Wcompare-reals,
653 -Wunused-parameter and -Wdo-subscript.
654
655 -Wfrontend-loop-interchange
656 Enable warning for loop interchanges performed by the
657 -ffrontend-loop-interchange option.
658
659 -Wimplicit-interface
660 Warn if a procedure is called without an explicit interface. Note
661 this only checks that an explicit interface is present. It does
662 not check that the declared interfaces are consistent across
663 program units.
664
665 -Wimplicit-procedure
666 Warn if a procedure is called that has neither an explicit
667 interface nor has been declared as "EXTERNAL".
668
669 -Winteger-division
670 Warn if a constant integer division truncates it result. As an
671 example, 3/5 evaluates to 0.
672
673 -Wintrinsics-std
674 Warn if gfortran finds a procedure named like an intrinsic not
675 available in the currently selected standard (with -std) and treats
676 it as "EXTERNAL" procedure because of this. -fall-intrinsics can
677 be used to never trigger this behavior and always link to the
678 intrinsic regardless of the selected standard.
679
680 -Wreal-q-constant
681 Produce a warning if a real-literal-constant contains a "q"
682 exponent-letter.
683
684 -Wsurprising
685 Produce a warning when "suspicious" code constructs are
686 encountered. While technically legal these usually indicate that
687 an error has been made.
688
689 This currently produces a warning under the following
690 circumstances:
691
692 * An INTEGER SELECT construct has a CASE that can never be
693 matched as its lower value is greater than its upper value.
694
695 * A LOGICAL SELECT construct has three CASE statements.
696
697 * A TRANSFER specifies a source that is shorter than the
698 destination.
699
700 * The type of a function result is declared more than once with
701 the same type. If -pedantic or standard-conforming mode is
702 enabled, this is an error.
703
704 * A "CHARACTER" variable is declared with negative length.
705
706 -Wtabs
707 By default, tabs are accepted as whitespace, but tabs are not
708 members of the Fortran Character Set. For continuation lines, a
709 tab followed by a digit between 1 and 9 is supported. -Wtabs will
710 cause a warning to be issued if a tab is encountered. Note, -Wtabs
711 is active for -pedantic, -std=f95, -std=f2003, -std=f2008,
712 -std=f2018 and -Wall.
713
714 -Wundefined-do-loop
715 Warn if a DO loop with step either 1 or -1 yields an underflow or
716 an overflow during iteration of an induction variable of the loop.
717 This option is implied by -Wall.
718
719 -Wunderflow
720 Produce a warning when numerical constant expressions are
721 encountered, which yield an UNDERFLOW during compilation. Enabled
722 by default.
723
724 -Wintrinsic-shadow
725 Warn if a user-defined procedure or module procedure has the same
726 name as an intrinsic; in this case, an explicit interface or
727 "EXTERNAL" or "INTRINSIC" declaration might be needed to get calls
728 later resolved to the desired intrinsic/procedure. This option is
729 implied by -Wall.
730
731 -Wuse-without-only
732 Warn if a "USE" statement has no "ONLY" qualifier and thus
733 implicitly imports all public entities of the used module.
734
735 -Wunused-dummy-argument
736 Warn about unused dummy arguments. This option is implied by -Wall.
737
738 -Wunused-parameter
739 Contrary to gcc's meaning of -Wunused-parameter, gfortran's
740 implementation of this option does not warn about unused dummy
741 arguments (see -Wunused-dummy-argument), but about unused
742 "PARAMETER" values. -Wunused-parameter is implied by -Wextra if
743 also -Wunused or -Wall is used.
744
745 -Walign-commons
746 By default, gfortran warns about any occasion of variables being
747 padded for proper alignment inside a "COMMON" block. This warning
748 can be turned off via -Wno-align-commons. See also -falign-commons.
749
750 -Wfunction-elimination
751 Warn if any calls to impure functions are eliminated by the
752 optimizations enabled by the -ffrontend-optimize option. This
753 option is implied by -Wextra.
754
755 -Wrealloc-lhs
756 Warn when the compiler might insert code to for allocation or
757 reallocation of an allocatable array variable of intrinsic type in
758 intrinsic assignments. In hot loops, the Fortran 2003 reallocation
759 feature may reduce the performance. If the array is already
760 allocated with the correct shape, consider using a whole-array
761 array-spec (e.g. "(:,:,:)") for the variable on the left-hand side
762 to prevent the reallocation check. Note that in some cases the
763 warning is shown, even if the compiler will optimize reallocation
764 checks away. For instance, when the right-hand side contains the
765 same variable multiplied by a scalar. See also -frealloc-lhs.
766
767 -Wrealloc-lhs-all
768 Warn when the compiler inserts code to for allocation or
769 reallocation of an allocatable variable; this includes scalars and
770 derived types.
771
772 -Wcompare-reals
773 Warn when comparing real or complex types for equality or
774 inequality. This option is implied by -Wextra.
775
776 -Wtarget-lifetime
777 Warn if the pointer in a pointer assignment might be longer than
778 the its target. This option is implied by -Wall.
779
780 -Wzerotrip
781 Warn if a "DO" loop is known to execute zero times at compile time.
782 This option is implied by -Wall.
783
784 -Wdo-subscript
785 Warn if an array subscript inside a DO loop could lead to an out-
786 of-bounds access even if the compiler cannot prove that the
787 statement is actually executed, in cases like
788
789 real a(3)
790 do i=1,4
791 if (condition(i)) then
792 a(i) = 1.2
793 end if
794 end do
795
796 This option is implied by -Wextra.
797
798 -Werror
799 Turns all warnings into errors.
800
801 Some of these have no effect when compiling programs written in
802 Fortran.
803
804 Options for debugging your program or GNU Fortran
805 GNU Fortran has various special options that are used for debugging
806 either your program or the GNU Fortran compiler.
807
808 -fdump-fortran-original
809 Output the internal parse tree after translating the source program
810 into internal representation. This option is mostly useful for
811 debugging the GNU Fortran compiler itself. The output generated by
812 this option might change between releases. This option may also
813 generate internal compiler errors for features which have only
814 recently been added.
815
816 -fdump-fortran-optimized
817 Output the parse tree after front-end optimization. Mostly useful
818 for debugging the GNU Fortran compiler itself. The output generated
819 by this option might change between releases. This option may also
820 generate internal compiler errors for features which have only
821 recently been added.
822
823 -fdump-parse-tree
824 Output the internal parse tree after translating the source program
825 into internal representation. Mostly useful for debugging the GNU
826 Fortran compiler itself. The output generated by this option might
827 change between releases. This option may also generate internal
828 compiler errors for features which have only recently been added.
829 This option is deprecated; use "-fdump-fortran-original" instead.
830
831 -ffpe-trap=list
832 Specify a list of floating point exception traps to enable. On
833 most systems, if a floating point exception occurs and the trap for
834 that exception is enabled, a SIGFPE signal will be sent and the
835 program being aborted, producing a core file useful for debugging.
836 list is a (possibly empty) comma-separated list of the following
837 exceptions: invalid (invalid floating point operation, such as
838 "SQRT(-1.0)"), zero (division by zero), overflow (overflow in a
839 floating point operation), underflow (underflow in a floating point
840 operation), inexact (loss of precision during operation), and
841 denormal (operation performed on a denormal value). The first five
842 exceptions correspond to the five IEEE 754 exceptions, whereas the
843 last one (denormal) is not part of the IEEE 754 standard but is
844 available on some common architectures such as x86.
845
846 The first three exceptions (invalid, zero, and overflow) often
847 indicate serious errors, and unless the program has provisions for
848 dealing with these exceptions, enabling traps for these three
849 exceptions is probably a good idea.
850
851 If the option is used more than once in the command line, the lists
852 will be joined: '"ffpe-trap="list1 "ffpe-trap="list2' is equivalent
853 to "ffpe-trap="list1,list2.
854
855 Note that once enabled an exception cannot be disabled (no negative
856 form).
857
858 Many, if not most, floating point operations incur loss of
859 precision due to rounding, and hence the "ffpe-trap=inexact" is
860 likely to be uninteresting in practice.
861
862 By default no exception traps are enabled.
863
864 -ffpe-summary=list
865 Specify a list of floating-point exceptions, whose flag status is
866 printed to "ERROR_UNIT" when invoking "STOP" and "ERROR STOP".
867 list can be either none, all or a comma-separated list of the
868 following exceptions: invalid, zero, overflow, underflow, inexact
869 and denormal. (See -ffpe-trap for a description of the exceptions.)
870
871 If the option is used more than once in the command line, only the
872 last one will be used.
873
874 By default, a summary for all exceptions but inexact is shown.
875
876 -fno-backtrace
877 When a serious runtime error is encountered or a deadly signal is
878 emitted (segmentation fault, illegal instruction, bus error,
879 floating-point exception, and the other POSIX signals that have the
880 action core), the Fortran runtime library tries to output a
881 backtrace of the error. "-fno-backtrace" disables the backtrace
882 generation. This option only has influence for compilation of the
883 Fortran main program.
884
885 Options for directory search
886 These options affect how GNU Fortran searches for files specified by
887 the "INCLUDE" directive and where it searches for previously compiled
888 modules.
889
890 It also affects the search paths used by cpp when used to preprocess
891 Fortran source.
892
893 -Idir
894 These affect interpretation of the "INCLUDE" directive (as well as
895 of the "#include" directive of the cpp preprocessor).
896
897 Also note that the general behavior of -I and "INCLUDE" is pretty
898 much the same as of -I with "#include" in the cpp preprocessor,
899 with regard to looking for header.gcc files and other such things.
900
901 This path is also used to search for .mod files when previously
902 compiled modules are required by a "USE" statement.
903
904 -Jdir
905 This option specifies where to put .mod files for compiled modules.
906 It is also added to the list of directories to searched by an "USE"
907 statement.
908
909 The default is the current directory.
910
911 -fintrinsic-modules-path dir
912 This option specifies the location of pre-compiled intrinsic
913 modules, if they are not in the default location expected by the
914 compiler.
915
916 Influencing the linking step
917 These options come into play when the compiler links object files into
918 an executable output file. They are meaningless if the compiler is not
919 doing a link step.
920
921 -static-libgfortran
922 On systems that provide libgfortran as a shared and a static
923 library, this option forces the use of the static version. If no
924 shared version of libgfortran was built when the compiler was
925 configured, this option has no effect.
926
927 Influencing runtime behavior
928 These options affect the runtime behavior of programs compiled with GNU
929 Fortran.
930
931 -fconvert=conversion
932 Specify the representation of data for unformatted files. Valid
933 values for conversion are: native, the default; swap, swap between
934 big- and little-endian; big-endian, use big-endian representation
935 for unformatted files; little-endian, use little-endian
936 representation for unformatted files.
937
938 This option has an effect only when used in the main program. The
939 "CONVERT" specifier and the GFORTRAN_CONVERT_UNIT environment
940 variable override the default specified by -fconvert.
941
942 -frecord-marker=length
943 Specify the length of record markers for unformatted files. Valid
944 values for length are 4 and 8. Default is 4. This is different
945 from previous versions of gfortran, which specified a default
946 record marker length of 8 on most systems. If you want to read or
947 write files compatible with earlier versions of gfortran, use
948 -frecord-marker=8.
949
950 -fmax-subrecord-length=length
951 Specify the maximum length for a subrecord. The maximum permitted
952 value for length is 2147483639, which is also the default. Only
953 really useful for use by the gfortran testsuite.
954
955 -fsign-zero
956 When enabled, floating point numbers of value zero with the sign
957 bit set are written as negative number in formatted output and
958 treated as negative in the "SIGN" intrinsic. -fno-sign-zero does
959 not print the negative sign of zero values (or values rounded to
960 zero for I/O) and regards zero as positive number in the "SIGN"
961 intrinsic for compatibility with Fortran 77. The default is
962 -fsign-zero.
963
964 Options for code generation conventions
965 These machine-independent options control the interface conventions
966 used in code generation.
967
968 Most of them have both positive and negative forms; the negative form
969 of -ffoo would be -fno-foo. In the table below, only one of the forms
970 is listed---the one which is not the default. You can figure out the
971 other form by either removing no- or adding it.
972
973 -fno-automatic
974 Treat each program unit (except those marked as RECURSIVE) as if
975 the "SAVE" statement were specified for every local variable and
976 array referenced in it. Does not affect common blocks. (Some
977 Fortran compilers provide this option under the name -static or
978 -save.) The default, which is -fautomatic, uses the stack for
979 local variables smaller than the value given by
980 -fmax-stack-var-size. Use the option -frecursive to use no static
981 memory.
982
983 Local variables or arrays having an explicit "SAVE" attribute are
984 silently ignored unless the -pedantic option is added.
985
986 -ff2c
987 Generate code designed to be compatible with code generated by g77
988 and f2c.
989
990 The calling conventions used by g77 (originally implemented in f2c)
991 require functions that return type default "REAL" to actually
992 return the C type "double", and functions that return type
993 "COMPLEX" to return the values via an extra argument in the calling
994 sequence that points to where to store the return value. Under the
995 default GNU calling conventions, such functions simply return their
996 results as they would in GNU C---default "REAL" functions return
997 the C type "float", and "COMPLEX" functions return the GNU C type
998 "complex". Additionally, this option implies the
999 -fsecond-underscore option, unless -fno-second-underscore is
1000 explicitly requested.
1001
1002 This does not affect the generation of code that interfaces with
1003 the libgfortran library.
1004
1005 Caution: It is not a good idea to mix Fortran code compiled with
1006 -ff2c with code compiled with the default -fno-f2c calling
1007 conventions as, calling "COMPLEX" or default "REAL" functions
1008 between program parts which were compiled with different calling
1009 conventions will break at execution time.
1010
1011 Caution: This will break code which passes intrinsic functions of
1012 type default "REAL" or "COMPLEX" as actual arguments, as the
1013 library implementations use the -fno-f2c calling conventions.
1014
1015 -fno-underscoring
1016 Do not transform names of entities specified in the Fortran source
1017 file by appending underscores to them.
1018
1019 With -funderscoring in effect, GNU Fortran appends one underscore
1020 to external names with no underscores. This is done to ensure
1021 compatibility with code produced by many UNIX Fortran compilers.
1022
1023 Caution: The default behavior of GNU Fortran is incompatible with
1024 f2c and g77, please use the -ff2c option if you want object files
1025 compiled with GNU Fortran to be compatible with object code created
1026 with these tools.
1027
1028 Use of -fno-underscoring is not recommended unless you are
1029 experimenting with issues such as integration of GNU Fortran into
1030 existing system environments (vis-a-vis existing libraries, tools,
1031 and so on).
1032
1033 For example, with -funderscoring, and assuming that "j()" and
1034 "max_count()" are external functions while "my_var" and "lvar" are
1035 local variables, a statement like
1036
1037 I = J() + MAX_COUNT (MY_VAR, LVAR)
1038
1039 is implemented as something akin to:
1040
1041 i = j_() + max_count__(&my_var__, &lvar);
1042
1043 With -fno-underscoring, the same statement is implemented as:
1044
1045 i = j() + max_count(&my_var, &lvar);
1046
1047 Use of -fno-underscoring allows direct specification of user-
1048 defined names while debugging and when interfacing GNU Fortran code
1049 with other languages.
1050
1051 Note that just because the names match does not mean that the
1052 interface implemented by GNU Fortran for an external name matches
1053 the interface implemented by some other language for that same
1054 name. That is, getting code produced by GNU Fortran to link to
1055 code produced by some other compiler using this or any other method
1056 can be only a small part of the overall solution---getting the code
1057 generated by both compilers to agree on issues other than naming
1058 can require significant effort, and, unlike naming disagreements,
1059 linkers normally cannot detect disagreements in these other areas.
1060
1061 Also, note that with -fno-underscoring, the lack of appended
1062 underscores introduces the very real possibility that a user-
1063 defined external name will conflict with a name in a system
1064 library, which could make finding unresolved-reference bugs quite
1065 difficult in some cases---they might occur at program run time, and
1066 show up only as buggy behavior at run time.
1067
1068 In future versions of GNU Fortran we hope to improve naming and
1069 linking issues so that debugging always involves using the names as
1070 they appear in the source, even if the names as seen by the linker
1071 are mangled to prevent accidental linking between procedures with
1072 incompatible interfaces.
1073
1074 -fsecond-underscore
1075 By default, GNU Fortran appends an underscore to external names.
1076 If this option is used GNU Fortran appends two underscores to names
1077 with underscores and one underscore to external names with no
1078 underscores. GNU Fortran also appends two underscores to internal
1079 names with underscores to avoid naming collisions with external
1080 names.
1081
1082 This option has no effect if -fno-underscoring is in effect. It is
1083 implied by the -ff2c option.
1084
1085 Otherwise, with this option, an external name such as "MAX_COUNT"
1086 is implemented as a reference to the link-time external symbol
1087 "max_count__", instead of "max_count_". This is required for
1088 compatibility with g77 and f2c, and is implied by use of the -ff2c
1089 option.
1090
1091 -fcoarray=<keyword>
1092 none
1093 Disable coarray support; using coarray declarations and image-
1094 control statements will produce a compile-time error. (Default)
1095
1096 single
1097 Single-image mode, i.e. "num_images()" is always one.
1098
1099 lib Library-based coarray parallelization; a suitable GNU Fortran
1100 coarray library needs to be linked.
1101
1102 -fcheck=<keyword>
1103 Enable the generation of run-time checks; the argument shall be a
1104 comma-delimited list of the following keywords. Prefixing a check
1105 with no- disables it if it was activated by a previous
1106 specification.
1107
1108 all Enable all run-time test of -fcheck.
1109
1110 array-temps
1111 Warns at run time when for passing an actual argument a
1112 temporary array had to be generated. The information generated
1113 by this warning is sometimes useful in optimization, in order
1114 to avoid such temporaries.
1115
1116 Note: The warning is only printed once per location.
1117
1118 bounds
1119 Enable generation of run-time checks for array subscripts and
1120 against the declared minimum and maximum values. It also
1121 checks array indices for assumed and deferred shape arrays
1122 against the actual allocated bounds and ensures that all string
1123 lengths are equal for character array constructors without an
1124 explicit typespec.
1125
1126 Some checks require that -fcheck=bounds is set for the
1127 compilation of the main program.
1128
1129 Note: In the future this may also include other forms of
1130 checking, e.g., checking substring references.
1131
1132 do Enable generation of run-time checks for invalid modification
1133 of loop iteration variables.
1134
1135 mem Enable generation of run-time checks for memory allocation.
1136 Note: This option does not affect explicit allocations using
1137 the "ALLOCATE" statement, which will be always checked.
1138
1139 pointer
1140 Enable generation of run-time checks for pointers and
1141 allocatables.
1142
1143 recursion
1144 Enable generation of run-time checks for recursively called
1145 subroutines and functions which are not marked as recursive.
1146 See also -frecursive. Note: This check does not work for
1147 OpenMP programs and is disabled if used together with
1148 -frecursive and -fopenmp.
1149
1150 Example: Assuming you have a file foo.f90, the command
1151
1152 gfortran -fcheck=all,no-array-temps foo.f90
1153
1154 will compile the file with all checks enabled as specified above
1155 except warnings for generated array temporaries.
1156
1157 -fbounds-check
1158 Deprecated alias for -fcheck=bounds.
1159
1160 -fcheck-array-temporaries
1161 Deprecated alias for -fcheck=array-temps.
1162
1163 -fmax-array-constructor=n
1164 This option can be used to increase the upper limit permitted in
1165 array constructors. The code below requires this option to expand
1166 the array at compile time.
1167
1168 program test
1169 implicit none
1170 integer j
1171 integer, parameter :: n = 100000
1172 integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
1173 print '(10(I0,1X))', i
1174 end program test
1175
1176 Caution: This option can lead to long compile times and
1177 excessively large object files.
1178
1179 The default value for n is 65535.
1180
1181 -fmax-stack-var-size=n
1182 This option specifies the size in bytes of the largest array that
1183 will be put on the stack; if the size is exceeded static memory is
1184 used (except in procedures marked as RECURSIVE). Use the option
1185 -frecursive to allow for recursive procedures which do not have a
1186 RECURSIVE attribute or for parallel programs. Use -fno-automatic to
1187 never use the stack.
1188
1189 This option currently only affects local arrays declared with
1190 constant bounds, and may not apply to all character variables.
1191 Future versions of GNU Fortran may improve this behavior.
1192
1193 The default value for n is 32768.
1194
1195 -fstack-arrays
1196 Adding this option will make the Fortran compiler put all arrays of
1197 unknown size and array temporaries onto stack memory. If your
1198 program uses very large local arrays it is possible that you will
1199 have to extend your runtime limits for stack memory on some
1200 operating systems. This flag is enabled by default at optimization
1201 level -Ofast unless -fmax-stack-var-size is specified.
1202
1203 -fpack-derived
1204 This option tells GNU Fortran to pack derived type members as
1205 closely as possible. Code compiled with this option is likely to
1206 be incompatible with code compiled without this option, and may
1207 execute slower.
1208
1209 -frepack-arrays
1210 In some circumstances GNU Fortran may pass assumed shape array
1211 sections via a descriptor describing a noncontiguous area of
1212 memory. This option adds code to the function prologue to repack
1213 the data into a contiguous block at runtime.
1214
1215 This should result in faster accesses to the array. However it can
1216 introduce significant overhead to the function call, especially
1217 when the passed data is noncontiguous.
1218
1219 -fshort-enums
1220 This option is provided for interoperability with C code that was
1221 compiled with the -fshort-enums option. It will make GNU Fortran
1222 choose the smallest "INTEGER" kind a given enumerator set will fit
1223 in, and give all its enumerators this kind.
1224
1225 -fexternal-blas
1226 This option will make gfortran generate calls to BLAS functions for
1227 some matrix operations like "MATMUL", instead of using our own
1228 algorithms, if the size of the matrices involved is larger than a
1229 given limit (see -fblas-matmul-limit). This may be profitable if
1230 an optimized vendor BLAS library is available. The BLAS library
1231 will have to be specified at link time.
1232
1233 -fblas-matmul-limit=n
1234 Only significant when -fexternal-blas is in effect. Matrix
1235 multiplication of matrices with size larger than (or equal to) n
1236 will be performed by calls to BLAS functions, while others will be
1237 handled by gfortran internal algorithms. If the matrices involved
1238 are not square, the size comparison is performed using the
1239 geometric mean of the dimensions of the argument and result
1240 matrices.
1241
1242 The default value for n is 30.
1243
1244 -finline-matmul-limit=n
1245 When front-end optimiztion is active, some calls to the "MATMUL"
1246 intrinsic function will be inlined. This may result in code size
1247 increase if the size of the matrix cannot be determined at compile
1248 time, as code for both cases is generated. Setting
1249 "-finline-matmul-limit=0" will disable inlining in all cases.
1250 Setting this option with a value of n will produce inline code for
1251 matrices with size up to n. If the matrices involved are not
1252 square, the size comparison is performed using the geometric mean
1253 of the dimensions of the argument and result matrices.
1254
1255 The default value for n is 30. The "-fblas-matmul-limit" can be
1256 used to change this value.
1257
1258 -frecursive
1259 Allow indirect recursion by forcing all local arrays to be
1260 allocated on the stack. This flag cannot be used together with
1261 -fmax-stack-var-size= or -fno-automatic.
1262
1263 -finit-local-zero
1264 -finit-derived
1265 -finit-integer=n
1266 -finit-real=<zero|inf|-inf|nan|snan>
1267 -finit-logical=<true|false>
1268 -finit-character=n
1269 The -finit-local-zero option instructs the compiler to initialize
1270 local "INTEGER", "REAL", and "COMPLEX" variables to zero, "LOGICAL"
1271 variables to false, and "CHARACTER" variables to a string of null
1272 bytes. Finer-grained initialization options are provided by the
1273 -finit-integer=n, -finit-real=<zero|inf|-inf|nan|snan> (which also
1274 initializes the real and imaginary parts of local "COMPLEX"
1275 variables), -finit-logical=<true|false>, and -finit-character=n
1276 (where n is an ASCII character value) options.
1277
1278 With -finit-derived, components of derived type variables will be
1279 initialized according to these flags. Components whose type is not
1280 covered by an explicit -finit-* flag will be treated as described
1281 above with -finit-local-zero.
1282
1283 These options do not initialize
1284
1285 * objects with the POINTER attribute
1286
1287 * allocatable arrays
1288
1289 * variables that appear in an "EQUIVALENCE" statement.
1290
1291 (These limitations may be removed in future releases).
1292
1293 Note that the -finit-real=nan option initializes "REAL" and
1294 "COMPLEX" variables with a quiet NaN. For a signalling NaN use
1295 -finit-real=snan; note, however, that compile-time optimizations
1296 may convert them into quiet NaN and that trapping needs to be
1297 enabled (e.g. via -ffpe-trap).
1298
1299 The -finit-integer option will parse the value into an integer of
1300 type "INTEGER(kind=C_LONG)" on the host. Said value is then
1301 assigned to the integer variables in the Fortran code, which might
1302 result in wraparound if the value is too large for the kind.
1303
1304 Finally, note that enabling any of the -finit-* options will
1305 silence warnings that would have been emitted by -Wuninitialized
1306 for the affected local variables.
1307
1308 -falign-commons
1309 By default, gfortran enforces proper alignment of all variables in
1310 a "COMMON" block by padding them as needed. On certain platforms
1311 this is mandatory, on others it increases performance. If a
1312 "COMMON" block is not declared with consistent data types
1313 everywhere, this padding can cause trouble, and -fno-align-commons
1314 can be used to disable automatic alignment. The same form of this
1315 option should be used for all files that share a "COMMON" block.
1316 To avoid potential alignment issues in "COMMON" blocks, it is
1317 recommended to order objects from largest to smallest.
1318
1319 -fno-protect-parens
1320 By default the parentheses in expression are honored for all
1321 optimization levels such that the compiler does not do any re-
1322 association. Using -fno-protect-parens allows the compiler to
1323 reorder "REAL" and "COMPLEX" expressions to produce faster code.
1324 Note that for the re-association optimization -fno-signed-zeros and
1325 -fno-trapping-math need to be in effect. The parentheses protection
1326 is enabled by default, unless -Ofast is given.
1327
1328 -frealloc-lhs
1329 An allocatable left-hand side of an intrinsic assignment is
1330 automatically (re)allocated if it is either unallocated or has a
1331 different shape. The option is enabled by default except when
1332 -std=f95 is given. See also -Wrealloc-lhs.
1333
1334 -faggressive-function-elimination
1335 Functions with identical argument lists are eliminated within
1336 statements, regardless of whether these functions are marked "PURE"
1337 or not. For example, in
1338
1339 a = f(b,c) + f(b,c)
1340
1341 there will only be a single call to "f". This option only works if
1342 -ffrontend-optimize is in effect.
1343
1344 -ffrontend-optimize
1345 This option performs front-end optimization, based on manipulating
1346 parts the Fortran parse tree. Enabled by default by any -O option
1347 except -O0 and -Og. Optimizations enabled by this option include:
1348
1349 *<inlining calls to "MATMUL",>
1350 *<elimination of identical function calls within expressions,>
1351 *<removing unnecessary calls to "TRIM" in comparisons and
1352 assignments,>
1353 *<replacing TRIM(a) with "a(1:LEN_TRIM(a))" and>
1354 *<short-circuiting of logical operators (".AND." and ".OR.").>
1355
1356 It can be deselected by specifying -fno-frontend-optimize.
1357
1358 -ffrontend-loop-interchange
1359 Attempt to interchange loops in the Fortran front end where
1360 profitable. Enabled by default by any -O option. At the moment,
1361 this option only affects "FORALL" and "DO CONCURRENT" statements
1362 with several forall triplets.
1363
1365 The gfortran compiler currently does not make use of any environment
1366 variables to control its operation above and beyond those that affect
1367 the operation of gcc.
1368
1370 For instructions on reporting bugs, see
1371 <http://bugzilla.redhat.com/bugzilla>.
1372
1374 gpl(7), gfdl(7), fsf-funding(7), cpp(1), gcov(1), gcc(1), as(1), ld(1),
1375 gdb(1), dbx(1) and the Info entries for gcc, cpp, gfortran, as, ld,
1376 binutils and gdb.
1377
1379 See the Info entry for gfortran for contributors to GCC and GNU
1380 Fortran.
1381
1383 Copyright (c) 2004-2019 Free Software Foundation, Inc.
1384
1385 Permission is granted to copy, distribute and/or modify this document
1386 under the terms of the GNU Free Documentation License, Version 1.3 or
1387 any later version published by the Free Software Foundation; with the
1388 Invariant Sections being "Funding Free Software", the Front-Cover Texts
1389 being (a) (see below), and with the Back-Cover Texts being (b) (see
1390 below). A copy of the license is included in the gfdl(7) man page.
1391
1392 (a) The FSF's Front-Cover Text is:
1393
1394 A GNU Manual
1395
1396 (b) The FSF's Back-Cover Text is:
1397
1398 You have freedom to copy and modify this GNU Manual, like GNU
1399 software. Copies published by the Free Software Foundation raise
1400 funds for GNU development.
1401
1402
1403
1404gcc-9 2019-05-03 GFORTRAN(1)