aarch64-none-linux-gnu-gfortran.1 81 KB

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