Update the GCC3 infrastructure Stage 1/2. This commit generates the basic
[dragonfly.git] / gnu / usr.bin / cc3 / f77 / g77.1
1 .\" $DragonFly: src/gnu/usr.bin/cc3/f77/Attic/g77.1,v 1.1 2004/02/02 23:35:11 dillon Exp $
2 .\" Automatically generated by Pod::Man version 1.15
3 .\" Wed Feb  5 03:13:59 2003
4 .\"
5 .\" Standard preamble:
6 .\" ======================================================================
7 .de Sh \" Subsection heading
8 .br
9 .if t .Sp
10 .ne 5
11 .PP
12 \fB\\$1\fR
13 .PP
14 ..
15 .de Sp \" Vertical space (when we can't use .PP)
16 .if t .sp .5v
17 .if n .sp
18 ..
19 .de Ip \" List item
20 .br
21 .ie \\n(.$>=3 .ne \\$3
22 .el .ne 3
23 .IP "\\$1" \\$2
24 ..
25 .de Vb \" Begin verbatim text
26 .ft CW
27 .nf
28 .ne \\$1
29 ..
30 .de Ve \" End verbatim text
31 .ft R
32
33 .fi
34 ..
35 .\" Set up some character translations and predefined strings.  \*(-- will
36 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
37 .\" double quote, and \*(R" will give a right double quote.  | will give a
38 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used
39 .\" to do unbreakable dashes and therefore won't be available.  \*(C` and
40 .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
41 .tr \(*W-|\(bv\*(Tr
42 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
43 .ie n \{\
44 .    ds -- \(*W-
45 .    ds PI pi
46 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
47 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
48 .    ds L" ""
49 .    ds R" ""
50 .    ds C` ""
51 .    ds C' ""
52 'br\}
53 .el\{\
54 .    ds -- \|\(em\|
55 .    ds PI \(*p
56 .    ds L" ``
57 .    ds R" ''
58 'br\}
59 .\"
60 .\" If the F register is turned on, we'll generate index entries on stderr
61 .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
62 .\" index entries marked with X<> in POD.  Of course, you'll have to process
63 .\" the output yourself in some meaningful fashion.
64 .if \nF \{\
65 .    de IX
66 .    tm Index:\\$1\t\\n%\t"\\$2"
67 ..
68 .    nr % 0
69 .    rr F
70 .\}
71 .\"
72 .\" For nroff, turn off justification.  Always turn off hyphenation; it
73 .\" makes way too many mistakes in technical documents.
74 .hy 0
75 .if n .na
76 .\"
77 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
78 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
79 .bd B 3
80 .    \" fudge factors for nroff and troff
81 .if n \{\
82 .    ds #H 0
83 .    ds #V .8m
84 .    ds #F .3m
85 .    ds #[ \f1
86 .    ds #] \fP
87 .\}
88 .if t \{\
89 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
90 .    ds #V .6m
91 .    ds #F 0
92 .    ds #[ \&
93 .    ds #] \&
94 .\}
95 .    \" simple accents for nroff and troff
96 .if n \{\
97 .    ds ' \&
98 .    ds ` \&
99 .    ds ^ \&
100 .    ds , \&
101 .    ds ~ ~
102 .    ds /
103 .\}
104 .if t \{\
105 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
106 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
107 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
108 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
109 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
110 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
111 .\}
112 .    \" troff and (daisy-wheel) nroff accents
113 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
114 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
115 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
116 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
117 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
118 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
119 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
120 .ds ae a\h'-(\w'a'u*4/10)'e
121 .ds Ae A\h'-(\w'A'u*4/10)'E
122 .    \" corrections for vroff
123 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
124 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
125 .    \" for low resolution devices (crt and lpr)
126 .if \n(.H>23 .if \n(.V>19 \
127 \{\
128 .    ds : e
129 .    ds 8 ss
130 .    ds o a
131 .    ds d- d\h'-1'\(ga
132 .    ds D- D\h'-1'\(hy
133 .    ds th \o'bp'
134 .    ds Th \o'LP'
135 .    ds ae ae
136 .    ds Ae AE
137 .\}
138 .rm #[ #] #H #V #F C
139 .\" ======================================================================
140 .\"
141 .IX Title "G77 1"
142 .TH G77 1 "gcc-3.2.2" "2003-02-05" "GNU"
143 .UC
144 .SH "NAME"
145 g77 \- \s-1GNU\s0 project Fortran 77 compiler
146 .SH "SYNOPSIS"
147 .IX Header "SYNOPSIS"
148 g77 [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR]
149     [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
150     [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
151     [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
152     [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
153     [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...]
154     [\fB\-o\fR \fIoutfile\fR] \fIinfile\fR...
155 .PP
156 Only the most useful options are listed here; see below for the
157 remainder.
158 .SH "DESCRIPTION"
159 .IX Header "DESCRIPTION"
160 The \fBg77\fR command supports all the options supported by the
161 \&\fBgcc\fR command.
162 .PP
163 All \fBgcc\fR and \fBg77\fR options
164 are accepted both by \fBg77\fR and by \fBgcc\fR
165 (as well as any other drivers built at the same time,
166 such as \fBg++\fR),
167 since adding \fBg77\fR to the \fBgcc\fR distribution
168 enables acceptance of \fBg77\fR options
169 by all of the relevant drivers.
170 .PP
171 In some cases, options have positive and negative forms;
172 the negative form of \fB\-ffoo\fR would be \fB\-fno-foo\fR.
173 This manual documents only one of these two forms, whichever
174 one is not the default.
175 .SH "OPTIONS"
176 .IX Header "OPTIONS"
177 Here is a summary of all the options specific to \s-1GNU\s0 Fortran, grouped
178 by type.  Explanations are in the following sections.
179 .Ip "\fIOverall Options\fR" 4
180 .IX Item "Overall Options"
181 \&\fB\-fversion  \-fset-g77\-defaults  \-fno-silent\fR
182 .Ip "\fIShorthand Options\fR" 4
183 .IX Item "Shorthand Options"
184 \&\fB\-ff66  \-fno-f66  \-ff77  \-fno-f77  \-fno-ugly\fR
185 .Ip "\fIFortran Language Options\fR" 4
186 .IX Item "Fortran Language Options"
187 \&\fB\-ffree-form  \-fno-fixed-form  \-ff90 
188 \&\-fvxt  \-fdollar-ok  \-fno-backslash 
189 \&\-fno-ugly-args  \-fno-ugly-assign  \-fno-ugly-assumed 
190 \&\-fugly-comma  \-fugly-complex  \-fugly-init  \-fugly-logint 
191 \&\-fonetrip  \-ftypeless-boz 
192 \&\-fintrin-case-initcap  \-fintrin-case-upper 
193 \&\-fintrin-case-lower  \-fintrin-case-any 
194 \&\-fmatch-case-initcap  \-fmatch-case-upper 
195 \&\-fmatch-case-lower  \-fmatch-case-any 
196 \&\-fsource-case-upper  \-fsource-case-lower 
197 \&\-fsource-case-preserve 
198 \&\-fsymbol-case-initcap  \-fsymbol-case-upper 
199 \&\-fsymbol-case-lower  \-fsymbol-case-any 
200 \&\-fcase-strict-upper  \-fcase-strict-lower 
201 \&\-fcase-initcap  \-fcase-upper  \-fcase-lower  \-fcase-preserve 
202 \&\-ff2c-intrinsics-delete  \-ff2c-intrinsics-hide 
203 \&\-ff2c-intrinsics-disable  \-ff2c-intrinsics-enable 
204 \&\-fbadu77\-intrinsics-delete  \-fbadu77\-intrinsics-hide 
205 \&\-fbadu77\-intrinsics-disable  \-fbadu77\-intrinsics-enable 
206 \&\-ff90\-intrinsics-delete  \-ff90\-intrinsics-hide 
207 \&\-ff90\-intrinsics-disable  \-ff90\-intrinsics-enable 
208 \&\-fgnu-intrinsics-delete  \-fgnu-intrinsics-hide 
209 \&\-fgnu-intrinsics-disable  \-fgnu-intrinsics-enable 
210 \&\-fmil-intrinsics-delete  \-fmil-intrinsics-hide 
211 \&\-fmil-intrinsics-disable  \-fmil-intrinsics-enable 
212 \&\-funix-intrinsics-delete  \-funix-intrinsics-hide 
213 \&\-funix-intrinsics-disable  \-funix-intrinsics-enable 
214 \&\-fvxt-intrinsics-delete  \-fvxt-intrinsics-hide 
215 \&\-fvxt-intrinsics-disable  \-fvxt-intrinsics-enable 
216 \&\-ffixed-line-length-\fR\fIn\fR  \fB\-ffixed-line-length-none\fR
217 .Ip "\fIWarning Options\fR" 4
218 .IX Item "Warning Options"
219 \&\fB\-fsyntax-only  \-pedantic  \-pedantic-errors  \-fpedantic 
220 \&\-w  \-Wno-globals  \-Wimplicit  \-Wunused  \-Wuninitialized 
221 \&\-Wall  \-Wsurprising 
222 \&\-Werror  \-W\fR
223 .Ip "\fIDebugging Options\fR" 4
224 .IX Item "Debugging Options"
225 \&\fB\-g\fR
226 .Ip "\fIOptimization Options\fR" 4
227 .IX Item "Optimization Options"
228 \&\fB\-malign-double 
229 \&\-ffloat-store  \-fforce-mem  \-fforce-addr  \-fno-inline 
230 \&\-ffast-math  \-fstrength-reduce  \-frerun-cse-after-loop 
231 \&\-funsafe-math-optimizations \-fno-trapping-math 
232 \&\-fexpensive-optimizations  \-fdelayed-branch 
233 \&\-fschedule-insns  \-fschedule-insn2  \-fcaller-saves 
234 \&\-funroll-loops  \-funroll-all-loops 
235 \&\-fno-move-all-movables  \-fno-reduce-all-givs 
236 \&\-fno-rerun-loop-opt\fR
237 .Ip "\fIDirectory Options\fR" 4
238 .IX Item "Directory Options"
239 \&\fB\-I\fR\fIdir\fR  \fB\-I-\fR
240 .Ip "\fICode Generation Options\fR" 4
241 .IX Item "Code Generation Options"
242 \&\fB\-fno-automatic  \-finit-local-zero  \-fno-f2c 
243 \&\-ff2c-library  \-fno-underscoring  \-fno-ident 
244 \&\-fpcc-struct-return  \-freg-struct-return 
245 \&\-fshort-double  \-fno-common  \-fpack-struct 
246 \&\-fzeros  \-fno-second-underscore 
247 \&\-femulate-complex 
248 \&\-falias-check  \-fargument-alias 
249 \&\-fargument-noalias  \-fno-argument-noalias-global 
250 \&\-fno-globals  \-fflatten-arrays 
251 \&\-fbounds-check  \-ffortran-bounds-check\fR
252 .PP
253 Compilation can involve as many as four stages: preprocessing, code
254 generation (often what is really meant by the term ``compilation''),
255 assembly, and linking, always in that order.  The first three
256 stages apply to an individual source file, and end by producing an
257 object file; linking combines all the object files (those newly
258 compiled, and those specified as input) into an executable file.
259 .PP
260 For any given input file, the file name suffix determines what kind of
261 program is contained in the file\-\-\-that is, the language in which the
262 program is written is generally indicated by the suffix.
263 Suffixes specific to \s-1GNU\s0 Fortran are listed below.
264 .Ip "\fIfile\fR\fB.f\fR" 4
265 .IX Item "file.f"
266 .PD 0
267 .Ip "\fIfile\fR\fB.for\fR" 4
268 .IX Item "file.for"
269 .Ip "\fIfile\fR\fB.FOR\fR" 4
270 .IX Item "file.FOR"
271 .PD
272 Fortran source code that should not be preprocessed.
273 .Sp
274 Such source code cannot contain any preprocessor directives, such
275 as \f(CW\*(C`#include\*(C'\fR, \f(CW\*(C`#define\*(C'\fR, \f(CW\*(C`#if\*(C'\fR, and so on.
276 .Sp
277 You can force \fB.f\fR files to be preprocessed by \fBcpp\fR by using
278 \&\fB\-x f77\-cpp-input\fR.
279 .Ip "\fIfile\fR\fB.F\fR" 4
280 .IX Item "file.F"
281 .PD 0
282 .Ip "\fIfile\fR\fB.fpp\fR" 4
283 .IX Item "file.fpp"
284 .Ip "\fIfile\fR\fB.FPP\fR" 4
285 .IX Item "file.FPP"
286 .PD
287 Fortran source code that must be preprocessed (by the C preprocessor
288 \&\fBcpp\fR, which is part of \s-1GNU\s0 \s-1CC\s0).
289 .Sp
290 Note that preprocessing is not extended to the contents of
291 files included by the \f(CW\*(C`INCLUDE\*(C'\fR directive\-\-\-the \f(CW\*(C`#include\*(C'\fR
292 preprocessor directive must be used instead.
293 .Ip "\fIfile\fR\fB.r\fR" 4
294 .IX Item "file.r"
295 Ratfor source code, which must be preprocessed by the \fBratfor\fR
296 command, which is available separately (as it is not yet part of the \s-1GNU\s0
297 Fortran distribution).
298 One version in Fortran, adapted for use with \fBg77\fR is at
299 <\fBftp://members.aol.com/n8tm/rat7.uue\fR> (of uncertain copyright
300 status).  Another, public domain version in C is at
301 <\fBhttp://sepwww.stanford.edu/sep/prof/ratfor.shar.2\fR>.
302 .PP
303 \&\s-1UNIX\s0 users typically use the \fI\fIfile\fI.f\fR and \fI\fIfile\fI.F\fR
304 nomenclature.
305 Users of other operating systems, especially those that cannot
306 distinguish upper-case
307 letters from lower-case letters in their file names, typically use
308 the \fI\fIfile\fI.for\fR and \fI\fIfile\fI.fpp\fR nomenclature.
309 .PP
310 Use of the preprocessor \fBcpp\fR allows use of C-like
311 constructs such as \f(CW\*(C`#define\*(C'\fR and \f(CW\*(C`#include\*(C'\fR, but can
312 lead to unexpected, even mistaken, results due to Fortran's source file
313 format.
314 It is recommended that use of the C preprocessor
315 be limited to \f(CW\*(C`#include\*(C'\fR and, in
316 conjunction with \f(CW\*(C`#define\*(C'\fR, only \f(CW\*(C`#if\*(C'\fR and related directives,
317 thus avoiding in-line macro expansion entirely.
318 This recommendation applies especially
319 when using the traditional fixed source form.
320 With free source form,
321 fewer unexpected transformations are likely to happen, but use of
322 constructs such as Hollerith and character constants can nevertheless
323 present problems, especially when these are continued across multiple
324 source lines.
325 These problems result, primarily, from differences between the way
326 such constants are interpreted by the C preprocessor and by a Fortran
327 compiler.
328 .PP
329 Another example of a problem that results from using the C preprocessor
330 is that a Fortran comment line that happens to contain any
331 characters ``interesting'' to the C preprocessor,
332 such as a backslash at the end of the line,
333 is not recognized by the preprocessor as a comment line,
334 so instead of being passed through ``raw'',
335 the line is edited according to the rules for the preprocessor.
336 For example, the backslash at the end of the line is removed,
337 along with the subsequent newline, resulting in the next
338 line being effectively commented out\-\-\-unfortunate if that
339 line is a non-comment line of important code!
340 .PP
341 \&\fINote:\fR The \fB\-traditional\fR and \fB\-undef\fR flags are supplied
342 to \fBcpp\fR by default, to help avoid unpleasant surprises.
343 .PP
344 This means that \s-1ANSI\s0 C preprocessor features (such as the \fB#\fR
345 operator) aren't available, and only variables in the C reserved
346 namespace (generally, names with a leading underscore) are liable to
347 substitution by C predefines.
348 Thus, if you want to do system-specific
349 tests, use, for example, \fB#ifdef _\|_linux_\|_\fR rather than \fB#ifdef linux\fR.
350 Use the \fB\-v\fR option to see exactly how the preprocessor is invoked.
351 .PP
352 Unfortunately, the \fB\-traditional\fR flag will not avoid an error from
353 anything that \fBcpp\fR sees as an unterminated C comment, such as:
354 .PP
355 .Vb 2
356 \&        C Some Fortran compilers accept /* as starting
357 \&        C an inline comment.
358 .Ve
359 The following options that affect overall processing are recognized
360 by the \fBg77\fR and \fBgcc\fR commands in a \s-1GNU\s0 Fortran installation:
361 .Ip "\fB\-fversion\fR" 4
362 .IX Item "-fversion"
363 Ensure that the \fBg77\fR version of the compiler phase is reported,
364 if run,
365 and, starting in \f(CW\*(C`egcs\*(C'\fR version 1.1,
366 that internal consistency checks in the \fIf771\fR program are run.
367 .Sp
368 This option is supplied automatically when \fB\-v\fR or \fB\*(--verbose\fR
369 is specified as a command-line option for \fBg77\fR or \fBgcc\fR
370 and when the resulting commands compile Fortran source files.
371 .Sp
372 In \s-1GCC\s0 3.1, this is changed back to the behaviour \fBgcc\fR displays
373 for \fB.c\fR files.
374 .Ip "\fB\-fset-g77\-defaults\fR" 4
375 .IX Item "-fset-g77-defaults"
376 \&\fIVersion info:\fR
377 This option was obsolete as of \f(CW\*(C`egcs\*(C'\fR
378 version 1.1.
379 The effect is instead achieved
380 by the \f(CW\*(C`lang_init_options\*(C'\fR routine
381 in \fIgcc/gcc/f/com.c\fR.
382 .Sp
383 Set up whatever \fBgcc\fR options are to apply to Fortran
384 compilations, and avoid running internal consistency checks
385 that might take some time.
386 .Sp
387 This option is supplied automatically when compiling Fortran code
388 via the \fBg77\fR or \fBgcc\fR command.
389 The description of this option is provided so that users seeing
390 it in the output of, say, \fBg77 \-v\fR understand why it is
391 there.
392 .Sp
393 Also, developers who run \f(CW\*(C`f771\*(C'\fR directly might want to specify it
394 by hand to get the same defaults as they would running \f(CW\*(C`f771\*(C'\fR
395 via \fBg77\fR or \fBgcc\fR
396 However, such developers should, after linking a new \f(CW\*(C`f771\*(C'\fR
397 executable, invoke it without this option once,
398 e.g. via \f(CW\*(C`./f771 \-quiet < /dev/null\*(C'\fR,
399 to ensure that they have not introduced any
400 internal inconsistencies (such as in the table of
401 intrinsics) before proceeding\-\--\fBg77\fR will crash
402 with a diagnostic if it detects an inconsistency.
403 .Ip "\fB\-fno-silent\fR" 4
404 .IX Item "-fno-silent"
405 Print (to \f(CW\*(C`stderr\*(C'\fR) the names of the program units as
406 they are compiled, in a form similar to that used by popular
407 \&\s-1UNIX\s0 \fBf77\fR implementations and \fBf2c\fR
408 .Sh "Shorthand Options"
409 .IX Subsection "Shorthand Options"
410 The following options serve as ``shorthand''
411 for other options accepted by the compiler:
412 .Ip "\fB\-fugly\fR" 4
413 .IX Item "-fugly"
414 \&\fINote:\fR This option is no longer supported.
415 The information, below, is provided to aid
416 in the conversion of old scripts.
417 .Sp
418 Specify that certain ``ugly'' constructs are to be quietly accepted.
419 Same as:
420 .Sp
421 .Vb 3
422 \&        -fugly-args -fugly-assign -fugly-assumed
423 \&        -fugly-comma -fugly-complex -fugly-init
424 \&        -fugly-logint
425 .Ve
426 These constructs are considered inappropriate to use in new
427 or well-maintained portable Fortran code, but widely used
428 in old code.
429 .Ip "\fB\-fno-ugly\fR" 4
430 .IX Item "-fno-ugly"
431 Specify that all ``ugly'' constructs are to be noisily rejected.
432 Same as:
433 .Sp
434 .Vb 3
435 \&        -fno-ugly-args -fno-ugly-assign -fno-ugly-assumed
436 \&        -fno-ugly-comma -fno-ugly-complex -fno-ugly-init
437 \&        -fno-ugly-logint
438 .Ve
439 .Ip "\fB\-ff66\fR" 4
440 .IX Item "-ff66"
441 Specify that the program is written in idiomatic \s-1FORTRAN\s0 66.
442 Same as \fB\-fonetrip \-fugly-assumed\fR.
443 .Sp
444 The \fB\-fno-f66\fR option is the inverse of \fB\-ff66\fR.
445 As such, it is the same as \fB\-fno-onetrip \-fno-ugly-assumed\fR.
446 .Sp
447 The meaning of this option is likely to be refined as future
448 versions of \fBg77\fR provide more compatibility with other
449 existing and obsolete Fortran implementations.
450 .Ip "\fB\-ff77\fR" 4
451 .IX Item "-ff77"
452 Specify that the program is written in idiomatic \s-1UNIX\s0 \s-1FORTRAN\s0 77
453 and/or the dialect accepted by the \fBf2c\fR product.
454 Same as \fB\-fbackslash \-fno-typeless-boz\fR.
455 .Sp
456 The meaning of this option is likely to be refined as future
457 versions of \fBg77\fR provide more compatibility with other
458 existing and obsolete Fortran implementations.
459 .Ip "\fB\-fno-f77\fR" 4
460 .IX Item "-fno-f77"
461 The \fB\-fno-f77\fR option is \fInot\fR the inverse
462 of \fB\-ff77\fR.
463 It specifies that the program is not written in idiomatic \s-1UNIX\s0
464 \&\s-1FORTRAN\s0 77 or \fBf2c\fR but in a more widely portable dialect.
465 \&\fB\-fno-f77\fR is the same as \fB\-fno-backslash\fR.
466 .Sp
467 The meaning of this option is likely to be refined as future
468 versions of \fBg77\fR provide more compatibility with other
469 existing and obsolete Fortran implementations.
470 .Sh "Options Controlling Fortran Dialect"
471 .IX Subsection "Options Controlling Fortran Dialect"
472 The following options control the dialect of Fortran
473 that the compiler accepts:
474 .Ip "\fB\-ffree-form\fR" 4
475 .IX Item "-ffree-form"
476 .PD 0
477 .Ip "\fB\-fno-fixed-form\fR" 4
478 .IX Item "-fno-fixed-form"
479 .PD
480 Specify that the source file is written in free form
481 (introduced in Fortran 90) instead of the more-traditional fixed form.
482 .Ip "\fB\-ff90\fR" 4
483 .IX Item "-ff90"
484 Allow certain Fortran-90 constructs.
485 .Sp
486 This option controls whether certain
487 Fortran 90 constructs are recognized.
488 (Other Fortran 90 constructs
489 might or might not be recognized depending on other options such as
490 \&\fB\-fvxt\fR, \fB\-ff90\-intrinsics-enable\fR, and the
491 current level of support for Fortran 90.)
492 .Ip "\fB\-fvxt\fR" 4
493 .IX Item "-fvxt"
494 Specify the treatment of certain constructs that have different
495 meanings depending on whether the code is written in
496 \&\s-1GNU\s0 Fortran (based on \s-1FORTRAN\s0 77 and akin to Fortran 90)
497 or \s-1VXT\s0 Fortran (more like \s-1VAX\s0 \s-1FORTRAN\s0).
498 .Sp
499 The default is \fB\-fno-vxt\fR.
500 \&\fB\-fvxt\fR specifies that the \s-1VXT\s0 Fortran interpretations
501 for those constructs are to be chosen.
502 .Ip "\fB\-fdollar-ok\fR" 4
503 .IX Item "-fdollar-ok"
504 Allow \fB$\fR as a valid character in a symbol name.
505 .Ip "\fB\-fno-backslash\fR" 4
506 .IX Item "-fno-backslash"
507 Specify that \fB\e\fR is not to be specially interpreted in character
508 and Hollerith constants a la C and many \s-1UNIX\s0 Fortran compilers.
509 .Sp
510 For example, with \fB\-fbackslash\fR in effect, \fBA\enB\fR specifies
511 three characters, with the second one being newline.
512 With \fB\-fno-backslash\fR, it specifies four characters,
513 \&\fBA\fR, \fB\e\fR, \fBn\fR, and \fBB\fR.
514 .Sp
515 Note that \fBg77\fR implements a fairly general form of backslash
516 processing that is incompatible with the narrower forms supported
517 by some other compilers.
518 For example, \fB'A\e003B'\fR is a three-character string in \fBg77\fR
519 whereas other compilers that support backslash might not support
520 the three-octal-digit form, and thus treat that string as longer
521 than three characters.
522 .Ip "\fB\-fno-ugly-args\fR" 4
523 .IX Item "-fno-ugly-args"
524 Disallow passing Hollerith and typeless constants as actual
525 arguments (for example, \fB\s-1CALL\s0 FOO(4HABCD)\fR).
526 .Ip "\fB\-fugly-assign\fR" 4
527 .IX Item "-fugly-assign"
528 Use the same storage for a given variable regardless of
529 whether it is used to hold an assigned-statement label
530 (as in \fB\s-1ASSIGN\s0 10 \s-1TO\s0 I\fR) or used to hold numeric data
531 (as in \fBI = 3\fR).
532 .Ip "\fB\-fugly-assumed\fR" 4
533 .IX Item "-fugly-assumed"
534 Assume any dummy array with a final dimension specified as \fB1\fR
535 is really an assumed-size array, as if \fB*\fR had been specified
536 for the final dimension instead of \fB1\fR.
537 .Sp
538 For example, \fB\s-1DIMENSION\s0 X(1)\fR is treated as if it
539 had read \fB\s-1DIMENSION\s0 X(*)\fR.
540 .Ip "\fB\-fugly-comma\fR" 4
541 .IX Item "-fugly-comma"
542 In an external-procedure invocation,
543 treat a trailing comma in the argument list
544 as specification of a trailing null argument,
545 and treat an empty argument list
546 as specification of a single null argument.
547 .Sp
548 For example, \fB\s-1CALL\s0 \f(BIFOO\fB\|(,)\fR is treated as
549 \&\fB\s-1CALL\s0 FOO(%\f(BIVAL\fB\|(0), %\f(BIVAL\fB\|(0))\fR.
550 That is, \fItwo\fR null arguments are specified
551 by the procedure call when \fB\-fugly-comma\fR is in force.
552 And \fBF = \f(BIFUNC()\fB\fR is treated as \fBF = FUNC(%\f(BIVAL\fB\|(0))\fR.
553 .Sp
554 The default behavior, \fB\-fno-ugly-comma\fR, is to ignore
555 a single trailing comma in an argument list.
556 So, by default, \fB\s-1CALL\s0 FOO(X,)\fR is treated
557 exactly the same as \fB\s-1CALL\s0 \f(BIFOO\fB\|(X)\fR.
558 .Ip "\fB\-fugly-complex\fR" 4
559 .IX Item "-fugly-complex"
560 Do not complain about \fBREAL(\fR\fIexpr\fR\fB)\fR or
561 \&\fBAIMAG(\fR\fIexpr\fR\fB)\fR when \fIexpr\fR is a \f(CW\*(C`COMPLEX\*(C'\fR
562 type other than \f(CW\*(C`COMPLEX(KIND=1)\*(C'\fR\-\-\-usually
563 this is used to permit \f(CW\*(C`COMPLEX(KIND=2)\*(C'\fR
564 (\f(CW\*(C`DOUBLE COMPLEX\*(C'\fR) operands.
565 .Sp
566 The \fB\-ff90\fR option controls the interpretation
567 of this construct.
568 .Ip "\fB\-fno-ugly-init\fR" 4
569 .IX Item "-fno-ugly-init"
570 Disallow use of Hollerith and typeless constants as initial
571 values (in \f(CW\*(C`PARAMETER\*(C'\fR and \f(CW\*(C`DATA\*(C'\fR statements), and
572 use of character constants to
573 initialize numeric types and vice versa.
574 .Sp
575 For example, \fB\s-1DATA\s0 I/'F'/, \s-1CHRVAR/65/\s0, J/4HABCD/\fR is disallowed by
576 \&\fB\-fno-ugly-init\fR.
577 .Ip "\fB\-fugly-logint\fR" 4
578 .IX Item "-fugly-logint"
579 Treat \f(CW\*(C`INTEGER\*(C'\fR and \f(CW\*(C`LOGICAL\*(C'\fR variables and
580 expressions as potential stand-ins for each other.
581 .Sp
582 For example, automatic conversion between \f(CW\*(C`INTEGER\*(C'\fR and
583 \&\f(CW\*(C`LOGICAL\*(C'\fR is enabled, for many contexts, via this option.
584 .Ip "\fB\-fonetrip\fR" 4
585 .IX Item "-fonetrip"
586 Executable iterative \f(CW\*(C`DO\*(C'\fR loops are to be executed at
587 least once each time they are reached.
588 .Sp
589 \&\s-1ANSI\s0 \s-1FORTRAN\s0 77 and more recent versions of the Fortran standard
590 specify that the body of an iterative \f(CW\*(C`DO\*(C'\fR loop is not executed
591 if the number of iterations calculated from the parameters of the
592 loop is less than 1.
593 (For example, \fB\s-1DO\s0 10 I = 1, 0\fR.)
594 Such a loop is called a \fIzero-trip loop\fR.
595 .Sp
596 Prior to \s-1ANSI\s0 \s-1FORTRAN\s0 77, many compilers implemented \f(CW\*(C`DO\*(C'\fR loops
597 such that the body of a loop would be executed at least once, even
598 if the iteration count was zero.
599 Fortran code written assuming this behavior is said to require
600 \&\fIone-trip loops\fR.
601 For example, some code written to the \s-1FORTRAN\s0 66 standard
602 expects this behavior from its \f(CW\*(C`DO\*(C'\fR loops, although that
603 standard did not specify this behavior.
604 .Sp
605 The \fB\-fonetrip\fR option specifies that the source \fIfile\fR\|(s) being
606 compiled require one-trip loops.
607 .Sp
608 This option affects only those loops specified by the (iterative) \f(CW\*(C`DO\*(C'\fR
609 statement and by implied-\f(CW\*(C`DO\*(C'\fR lists in I/O statements.
610 Loops specified by implied-\f(CW\*(C`DO\*(C'\fR lists in \f(CW\*(C`DATA\*(C'\fR and
611 specification (non-executable) statements are not affected.
612 .Ip "\fB\-ftypeless-boz\fR" 4
613 .IX Item "-ftypeless-boz"
614 Specifies that prefix-radix non-decimal constants, such as
615 \&\fBZ'\s-1ABCD\s0'\fR, are typeless instead of \f(CW\*(C`INTEGER(KIND=1)\*(C'\fR.
616 .Sp
617 You can test for yourself whether a particular compiler treats
618 the prefix form as \f(CW\*(C`INTEGER(KIND=1)\*(C'\fR or typeless by running the
619 following program:
620 .Sp
621 .Vb 6
622 \&        EQUIVALENCE (I, R)
623 \&        R = Z'ABCD1234'
624 \&        J = Z'ABCD1234'
625 \&        IF (J .EQ. I) PRINT *, 'Prefix form is TYPELESS'
626 \&        IF (J .NE. I) PRINT *, 'Prefix form is INTEGER'
627 \&        END
628 .Ve
629 Reports indicate that many compilers process this form as
630 \&\f(CW\*(C`INTEGER(KIND=1)\*(C'\fR, though a few as typeless, and at least one
631 based on a command-line option specifying some kind of
632 compatibility.
633 .Ip "\fB\-fintrin-case-initcap\fR" 4
634 .IX Item "-fintrin-case-initcap"
635 .PD 0
636 .Ip "\fB\-fintrin-case-upper\fR" 4
637 .IX Item "-fintrin-case-upper"
638 .Ip "\fB\-fintrin-case-lower\fR" 4
639 .IX Item "-fintrin-case-lower"
640 .Ip "\fB\-fintrin-case-any\fR" 4
641 .IX Item "-fintrin-case-any"
642 .PD
643 Specify expected case for intrinsic names.
644 \&\fB\-fintrin-case-lower\fR is the default.
645 .Ip "\fB\-fmatch-case-initcap\fR" 4
646 .IX Item "-fmatch-case-initcap"
647 .PD 0
648 .Ip "\fB\-fmatch-case-upper\fR" 4
649 .IX Item "-fmatch-case-upper"
650 .Ip "\fB\-fmatch-case-lower\fR" 4
651 .IX Item "-fmatch-case-lower"
652 .Ip "\fB\-fmatch-case-any\fR" 4
653 .IX Item "-fmatch-case-any"
654 .PD
655 Specify expected case for keywords.
656 \&\fB\-fmatch-case-lower\fR is the default.
657 .Ip "\fB\-fsource-case-upper\fR" 4
658 .IX Item "-fsource-case-upper"
659 .PD 0
660 .Ip "\fB\-fsource-case-lower\fR" 4
661 .IX Item "-fsource-case-lower"
662 .Ip "\fB\-fsource-case-preserve\fR" 4
663 .IX Item "-fsource-case-preserve"
664 .PD
665 Specify whether source text other than character and Hollerith constants
666 is to be translated to uppercase, to lowercase, or preserved as is.
667 \&\fB\-fsource-case-lower\fR is the default.
668 .Ip "\fB\-fsymbol-case-initcap\fR" 4
669 .IX Item "-fsymbol-case-initcap"
670 .PD 0
671 .Ip "\fB\-fsymbol-case-upper\fR" 4
672 .IX Item "-fsymbol-case-upper"
673 .Ip "\fB\-fsymbol-case-lower\fR" 4
674 .IX Item "-fsymbol-case-lower"
675 .Ip "\fB\-fsymbol-case-any\fR" 4
676 .IX Item "-fsymbol-case-any"
677 .PD
678 Specify valid cases for user-defined symbol names.
679 \&\fB\-fsymbol-case-any\fR is the default.
680 .Ip "\fB\-fcase-strict-upper\fR" 4
681 .IX Item "-fcase-strict-upper"
682 Same as \fB\-fintrin-case-upper \-fmatch-case-upper \-fsource-case-preserve
683 \&\-fsymbol-case-upper\fR.
684 (Requires all pertinent source to be in uppercase.)
685 .Ip "\fB\-fcase-strict-lower\fR" 4
686 .IX Item "-fcase-strict-lower"
687 Same as \fB\-fintrin-case-lower \-fmatch-case-lower \-fsource-case-preserve
688 \&\-fsymbol-case-lower\fR.
689 (Requires all pertinent source to be in lowercase.)
690 .Ip "\fB\-fcase-initcap\fR" 4
691 .IX Item "-fcase-initcap"
692 Same as \fB\-fintrin-case-initcap \-fmatch-case-initcap \-fsource-case-preserve
693 \&\-fsymbol-case-initcap\fR.
694 (Requires all pertinent source to be in initial capitals,
695 as in \fBPrint *,SqRt(Value)\fR.)
696 .Ip "\fB\-fcase-upper\fR" 4
697 .IX Item "-fcase-upper"
698 Same as \fB\-fintrin-case-any \-fmatch-case-any \-fsource-case-upper
699 \&\-fsymbol-case-any\fR.
700 (Maps all pertinent source to uppercase.)
701 .Ip "\fB\-fcase-lower\fR" 4
702 .IX Item "-fcase-lower"
703 Same as \fB\-fintrin-case-any \-fmatch-case-any \-fsource-case-lower
704 \&\-fsymbol-case-any\fR.
705 (Maps all pertinent source to lowercase.)
706 .Ip "\fB\-fcase-preserve\fR" 4
707 .IX Item "-fcase-preserve"
708 Same as \fB\-fintrin-case-any \-fmatch-case-any \-fsource-case-preserve
709 \&\-fsymbol-case-any\fR.
710 (Preserves all case in user-defined symbols,
711 while allowing any-case matching of intrinsics and keywords.
712 For example, \fBcall Foo(i,I)\fR would pass two \fIdifferent\fR
713 variables named \fBi\fR and \fBI\fR to a procedure named \fBFoo\fR.)
714 .Ip "\fB\-fbadu77\-intrinsics-delete\fR" 4
715 .IX Item "-fbadu77-intrinsics-delete"
716 .PD 0
717 .Ip "\fB\-fbadu77\-intrinsics-hide\fR" 4
718 .IX Item "-fbadu77-intrinsics-hide"
719 .Ip "\fB\-fbadu77\-intrinsics-disable\fR" 4
720 .IX Item "-fbadu77-intrinsics-disable"
721 .Ip "\fB\-fbadu77\-intrinsics-enable\fR" 4
722 .IX Item "-fbadu77-intrinsics-enable"
723 .PD
724 Specify status of \s-1UNIX\s0 intrinsics having inappropriate forms.
725 \&\fB\-fbadu77\-intrinsics-enable\fR is the default.
726 .Ip "\fB\-ff2c-intrinsics-delete\fR" 4
727 .IX Item "-ff2c-intrinsics-delete"
728 .PD 0
729 .Ip "\fB\-ff2c-intrinsics-hide\fR" 4
730 .IX Item "-ff2c-intrinsics-hide"
731 .Ip "\fB\-ff2c-intrinsics-disable\fR" 4
732 .IX Item "-ff2c-intrinsics-disable"
733 .Ip "\fB\-ff2c-intrinsics-enable\fR" 4
734 .IX Item "-ff2c-intrinsics-enable"
735 .PD
736 Specify status of f2c-specific intrinsics.
737 \&\fB\-ff2c-intrinsics-enable\fR is the default.
738 .Ip "\fB\-ff90\-intrinsics-delete\fR" 4
739 .IX Item "-ff90-intrinsics-delete"
740 .PD 0
741 .Ip "\fB\-ff90\-intrinsics-hide\fR" 4
742 .IX Item "-ff90-intrinsics-hide"
743 .Ip "\fB\-ff90\-intrinsics-disable\fR" 4
744 .IX Item "-ff90-intrinsics-disable"
745 .Ip "\fB\-ff90\-intrinsics-enable\fR" 4
746 .IX Item "-ff90-intrinsics-enable"
747 .PD
748 Specify status of F90\-specific intrinsics.
749 \&\fB\-ff90\-intrinsics-enable\fR is the default.
750 .Ip "\fB\-fgnu-intrinsics-delete\fR" 4
751 .IX Item "-fgnu-intrinsics-delete"
752 .PD 0
753 .Ip "\fB\-fgnu-intrinsics-hide\fR" 4
754 .IX Item "-fgnu-intrinsics-hide"
755 .Ip "\fB\-fgnu-intrinsics-disable\fR" 4
756 .IX Item "-fgnu-intrinsics-disable"
757 .Ip "\fB\-fgnu-intrinsics-enable\fR" 4
758 .IX Item "-fgnu-intrinsics-enable"
759 .PD
760 Specify status of Digital's COMPLEX-related intrinsics.
761 \&\fB\-fgnu-intrinsics-enable\fR is the default.
762 .Ip "\fB\-fmil-intrinsics-delete\fR" 4
763 .IX Item "-fmil-intrinsics-delete"
764 .PD 0
765 .Ip "\fB\-fmil-intrinsics-hide\fR" 4
766 .IX Item "-fmil-intrinsics-hide"
767 .Ip "\fB\-fmil-intrinsics-disable\fR" 4
768 .IX Item "-fmil-intrinsics-disable"
769 .Ip "\fB\-fmil-intrinsics-enable\fR" 4
770 .IX Item "-fmil-intrinsics-enable"
771 .PD
772 Specify status of MIL-STD-1753\-specific intrinsics.
773 \&\fB\-fmil-intrinsics-enable\fR is the default.
774 .Ip "\fB\-funix-intrinsics-delete\fR" 4
775 .IX Item "-funix-intrinsics-delete"
776 .PD 0
777 .Ip "\fB\-funix-intrinsics-hide\fR" 4
778 .IX Item "-funix-intrinsics-hide"
779 .Ip "\fB\-funix-intrinsics-disable\fR" 4
780 .IX Item "-funix-intrinsics-disable"
781 .Ip "\fB\-funix-intrinsics-enable\fR" 4
782 .IX Item "-funix-intrinsics-enable"
783 .PD
784 Specify status of \s-1UNIX\s0 intrinsics.
785 \&\fB\-funix-intrinsics-enable\fR is the default.
786 .Ip "\fB\-fvxt-intrinsics-delete\fR" 4
787 .IX Item "-fvxt-intrinsics-delete"
788 .PD 0
789 .Ip "\fB\-fvxt-intrinsics-hide\fR" 4
790 .IX Item "-fvxt-intrinsics-hide"
791 .Ip "\fB\-fvxt-intrinsics-disable\fR" 4
792 .IX Item "-fvxt-intrinsics-disable"
793 .Ip "\fB\-fvxt-intrinsics-enable\fR" 4
794 .IX Item "-fvxt-intrinsics-enable"
795 .PD
796 Specify status of \s-1VXT\s0 intrinsics.
797 \&\fB\-fvxt-intrinsics-enable\fR is the default.
798 .Ip "\fB\-ffixed-line-length-\fR\fIn\fR" 4
799 .IX Item "-ffixed-line-length-n"
800 Set column after which characters are ignored in typical fixed-form
801 lines in the source file, and through which spaces are assumed (as
802 if padded to that length) after the ends of short fixed-form lines.
803 .Sp
804 Popular values for \fIn\fR include 72 (the
805 standard and the default), 80 (card image), and 132 (corresponds
806 to ``extended-source'' options in some popular compilers).
807 \&\fIn\fR may be \fBnone\fR, meaning that the entire line is meaningful
808 and that continued character constants never have implicit spaces appended
809 to them to fill out the line.
810 \&\fB\-ffixed-line-length-0\fR means the same thing as
811 \&\fB\-ffixed-line-length-none\fR.
812 .Sh "Options to Request or Suppress Warnings"
813 .IX Subsection "Options to Request or Suppress Warnings"
814 Warnings are diagnostic messages that report constructions which
815 are not inherently erroneous but which are risky or suggest there
816 might have been an error.
817 .PP
818 You can request many specific warnings with options beginning \fB\-W\fR,
819 for example \fB\-Wimplicit\fR to request warnings on implicit
820 declarations.  Each of these specific warning options also has a
821 negative form beginning \fB\-Wno-\fR to turn off warnings;
822 for example, \fB\-Wno-implicit\fR.  This manual lists only one of the
823 two forms, whichever is not the default.
824 .PP
825 These options control the amount and kinds of warnings produced by \s-1GNU\s0
826 Fortran:
827 .Ip "\fB\-fsyntax-only\fR" 4
828 .IX Item "-fsyntax-only"
829 Check the code for syntax errors, but don't do anything beyond that.
830 .Ip "\fB\-pedantic\fR" 4
831 .IX Item "-pedantic"
832 Issue warnings for uses of extensions to \s-1ANSI\s0 \s-1FORTRAN\s0 77.
833 \&\fB\-pedantic\fR also applies to C-language constructs where they
834 occur in \s-1GNU\s0 Fortran source files, such as use of \fB\ee\fR in a
835 character constant within a directive like \fB#include\fR.
836 .Sp
837 Valid \s-1ANSI\s0 \s-1FORTRAN\s0 77 programs should compile properly with or without
838 this option.
839 However, without this option, certain \s-1GNU\s0 extensions and traditional
840 Fortran features are supported as well.
841 With this option, many of them are rejected.
842 .Sp
843 Some users try to use \fB\-pedantic\fR to check programs for strict \s-1ANSI\s0
844 conformance.
845 They soon find that it does not do quite what they want\-\-\-it finds some
846 non-ANSI practices, but not all.
847 However, improvements to \fBg77\fR in this area are welcome.
848 .Ip "\fB\-pedantic-errors\fR" 4
849 .IX Item "-pedantic-errors"
850 Like \fB\-pedantic\fR, except that errors are produced rather than
851 warnings.
852 .Ip "\fB\-fpedantic\fR" 4
853 .IX Item "-fpedantic"
854 Like \fB\-pedantic\fR, but applies only to Fortran constructs.
855 .Ip "\fB\-w\fR" 4
856 .IX Item "-w"
857 Inhibit all warning messages.
858 .Ip "\fB\-Wno-globals\fR" 4
859 .IX Item "-Wno-globals"
860 Inhibit warnings about use of a name as both a global name
861 (a subroutine, function, or block data program unit, or a
862 common block) and implicitly as the name of an intrinsic
863 in a source file.
864 .Sp
865 Also inhibit warnings about inconsistent invocations and/or
866 definitions of global procedures (function and subroutines).
867 Such inconsistencies include different numbers of arguments
868 and different types of arguments.
869 .Ip "\fB\-Wimplicit\fR" 4
870 .IX Item "-Wimplicit"
871 Warn whenever a variable, array, or function is implicitly
872 declared.
873 Has an effect similar to using the \f(CW\*(C`IMPLICIT NONE\*(C'\fR statement
874 in every program unit.
875 (Some Fortran compilers provide this feature by an option
876 named \fB\-u\fR or \fB/WARNINGS=DECLARATIONS\fR.)
877 .Ip "\fB\-Wunused\fR" 4
878 .IX Item "-Wunused"
879 Warn whenever a variable is unused aside from its declaration.
880 .Ip "\fB\-Wuninitialized\fR" 4
881 .IX Item "-Wuninitialized"
882 Warn whenever an automatic variable is used without first being initialized.
883 .Sp
884 These warnings are possible only in optimizing compilation,
885 because they require data-flow information that is computed only
886 when optimizing.  If you don't specify \fB\-O\fR, you simply won't
887 get these warnings.
888 .Sp
889 These warnings occur only for variables that are candidates for
890 register allocation.  Therefore, they do not occur for a variable
891 whose address is taken, or whose size
892 is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
893 arrays, even when they are in registers.
894 .Sp
895 Note that there might be no warning about a variable that is used only
896 to compute a value that itself is never used, because such
897 computations may be deleted by data-flow analysis before the warnings
898 are printed.
899 .Sp
900 These warnings are made optional because \s-1GNU\s0 Fortran is not smart
901 enough to see all the reasons why the code might be correct
902 despite appearing to have an error.  Here is one example of how
903 this can happen:
904 .Sp
905 .Vb 6
906 \&        SUBROUTINE DISPAT(J)
907 \&        IF (J.EQ.1) I=1
908 \&        IF (J.EQ.2) I=4
909 \&        IF (J.EQ.3) I=5
910 \&        CALL FOO(I)
911 \&        END
912 .Ve
913 If the value of \f(CW\*(C`J\*(C'\fR is always 1, 2 or 3, then \f(CW\*(C`I\*(C'\fR is
914 always initialized, but \s-1GNU\s0 Fortran doesn't know this.  Here is
915 another common case:
916 .Sp
917 .Vb 6
918 \&        SUBROUTINE MAYBE(FLAG)
919 \&        LOGICAL FLAG
920 \&        IF (FLAG) VALUE = 9.4
921 \&        ...
922 \&        IF (FLAG) PRINT *, VALUE
923 \&        END
924 .Ve
925 This has no bug because \f(CW\*(C`VALUE\*(C'\fR is used only if it is set.
926 .Ip "\fB\-Wall\fR" 4
927 .IX Item "-Wall"
928 The \fB\-Wunused\fR and \fB\-Wuninitialized\fR options combined.
929 These are all the
930 options which pertain to usage that we recommend avoiding and that we
931 believe is easy to avoid.
932 (As more warnings are added to \fBg77\fR some might
933 be added to the list enabled by \fB\-Wall\fR.)
934 .PP
935 The remaining \fB\-W...\fR options are not implied by \fB\-Wall\fR
936 because they warn about constructions that we consider reasonable to
937 use, on occasion, in clean programs.
938 .Ip "\fB\-Wsurprising\fR" 4
939 .IX Item "-Wsurprising"
940 Warn about ``suspicious'' constructs that are interpreted
941 by the compiler in a way that might well be surprising to
942 someone reading the code.
943 These differences can result in subtle, compiler-dependent
944 (even machine-dependent) behavioral differences.
945 The constructs warned about include:
946 .RS 4
947 .Ip "\(bu" 4
948 Expressions having two arithmetic operators in a row, such
949 as \fBX*\-Y\fR.
950 Such a construct is nonstandard, and can produce
951 unexpected results in more complicated situations such
952 as \fBX**\-Y*Z\fR.
953 \&\fBg77\fR along with many other compilers, interprets
954 this example differently than many programmers, and a few
955 other compilers.
956 Specifically, \fBg77\fR interprets \fBX**\-Y*Z\fR as
957 \&\fB(X**(\-Y))*Z\fR, while others might think it should
958 be interpreted as \fBX**(\-(Y*Z))\fR.
959 .Sp
960 A revealing example is the constant expression \fB2**\-2*1.\fR,
961 which \fBg77\fR evaluates to .25, while others might evaluate
962 it to 0., the difference resulting from the way precedence affects
963 type promotion.
964 .Sp
965 (The \fB\-fpedantic\fR option also warns about expressions
966 having two arithmetic operators in a row.)
967 .Ip "\(bu" 4
968 Expressions with a unary minus followed by an operand and then
969 a binary operator other than plus or minus.
970 For example, \fB\-2**2\fR produces a warning, because
971 the precedence is \fB\-(2**2)\fR, yielding \-4, not
972 \&\fB(\-2)**2\fR, which yields 4, and which might represent
973 what a programmer expects.
974 .Sp
975 An example of an expression producing different results
976 in a surprising way is \fB\-I*S\fR, where \fII\fR holds
977 the value \fB\-2147483648\fR and \fIS\fR holds \fB0.5\fR.
978 On many systems, negating \fII\fR results in the same
979 value, not a positive number, because it is already the
980 lower bound of what an \f(CW\*(C`INTEGER(KIND=1)\*(C'\fR variable can hold.
981 So, the expression evaluates to a positive number, while
982 the ``expected'' interpretation, \fB(\-I)*S\fR, would
983 evaluate to a negative number.
984 .Sp
985 Even cases such as \fB\-I*J\fR produce warnings,
986 even though, in most configurations and situations,
987 there is no computational difference between the
988 results of the two interpretations\-\-\-the purpose
989 of this warning is to warn about differing interpretations
990 and encourage a better style of coding, not to identify
991 only those places where bugs might exist in the user's
992 code.
993 .Ip "\(bu" 4
994 \&\f(CW\*(C`DO\*(C'\fR loops with \f(CW\*(C`DO\*(C'\fR variables that are not
995 of integral type\-\-\-that is, using \f(CW\*(C`REAL\*(C'\fR
996 variables as loop control variables.
997 Although such loops can be written to work in the
998 ``obvious'' way, the way \fBg77\fR is required by the
999 Fortran standard to interpret such code is likely to
1000 be quite different from the way many programmers expect.
1001 (This is true of all \f(CW\*(C`DO\*(C'\fR loops, but the differences
1002 are pronounced for non-integral loop control variables.)
1003 .RE
1004 .RS 4
1005 .RE
1006 .Ip "\fB\-Werror\fR" 4
1007 .IX Item "-Werror"
1008 Make all warnings into errors.
1009 .Ip "\fB\-W\fR" 4
1010 .IX Item "-W"
1011 Turns on ``extra warnings'' and, if optimization is specified
1012 via \fB\-O\fR, the \fB\-Wuninitialized\fR option.
1013 (This might change in future versions of \fBg77\fR
1014 .Sp
1015 ``Extra warnings'' are issued for:
1016 .RS 4
1017 .Ip "\(bu" 4
1018 Unused parameters to a procedure (when \fB\-Wunused\fR also is
1019 specified).
1020 .Ip "\(bu" 4
1021 Overflows involving floating-point constants (not available
1022 for certain configurations).
1023 .RE
1024 .RS 4
1025 .RE
1026 .PP
1027 Some of these have no effect when compiling programs written in Fortran:
1028 .Ip "\fB\-Wcomment\fR" 4
1029 .IX Item "-Wcomment"
1030 .PD 0
1031 .Ip "\fB\-Wformat\fR" 4
1032 .IX Item "-Wformat"
1033 .Ip "\fB\-Wparentheses\fR" 4
1034 .IX Item "-Wparentheses"
1035 .Ip "\fB\-Wswitch\fR" 4
1036 .IX Item "-Wswitch"
1037 .Ip "\fB\-Wtraditional\fR" 4
1038 .IX Item "-Wtraditional"
1039 .Ip "\fB\-Wshadow\fR" 4
1040 .IX Item "-Wshadow"
1041 .Ip "\fB\-Wid-clash-\fR\fIlen\fR" 4
1042 .IX Item "-Wid-clash-len"
1043 .Ip "\fB\-Wlarger-than-\fR\fIlen\fR" 4
1044 .IX Item "-Wlarger-than-len"
1045 .Ip "\fB\-Wconversion\fR" 4
1046 .IX Item "-Wconversion"
1047 .Ip "\fB\-Waggregate-return\fR" 4
1048 .IX Item "-Waggregate-return"
1049 .Ip "\fB\-Wredundant-decls\fR" 4
1050 .IX Item "-Wredundant-decls"
1051 .PD
1052 These options all could have some relevant meaning for
1053 \&\s-1GNU\s0 Fortran programs, but are not yet supported.
1054 .Sh "Options for Debugging Your Program or \s-1GNU\s0 Fortran"
1055 .IX Subsection "Options for Debugging Your Program or GNU Fortran"
1056 \&\s-1GNU\s0 Fortran has various special options that are used for debugging
1057 either your program or \fBg77\fR
1058 .Ip "\fB\-g\fR" 4
1059 .IX Item "-g"
1060 Produce debugging information in the operating system's native format
1061 (stabs, \s-1COFF\s0, \s-1XCOFF\s0, or \s-1DWARF\s0).  \s-1GDB\s0 can work with this debugging
1062 information.
1063 .Sp
1064 A sample debugging session looks like this (note the use of the breakpoint):
1065 .Sp
1066 .Vb 24
1067 \&        $ cat gdb.f
1068 \&              PROGRAM PROG
1069 \&              DIMENSION A(10)
1070 \&              DATA A /1.,2.,3.,4.,5.,6.,7.,8.,9.,10./
1071 \&              A(5) = 4.
1072 \&              PRINT*,A
1073 \&              END
1074 \&        $ g77 -g -O gdb.f
1075 \&        $ gdb a.out
1076 \&        ...
1077 \&        (gdb) break MAIN__ 
1078 \&        Breakpoint 1 at 0x8048e96: file gdb.f, line 4.
1079 \&        (gdb) run
1080 \&        Starting program: /home/toon/g77-bugs/./a.out 
1081 \&        Breakpoint 1, MAIN__ () at gdb.f:4
1082 \&        4             A(5) = 4.
1083 \&        Current language:  auto; currently fortran
1084 \&        (gdb) print a(5)
1085 \&        $1 = 5
1086 \&        (gdb) step 
1087 \&        5             PRINT*,A
1088 \&        (gdb) print a(5)
1089 \&        $2 = 4
1090 \&        ...
1091 .Ve
1092 One could also add the setting of the breakpoint and the first run command
1093 to the file \fI.gdbinit\fR in the current directory, to simplify the debugging
1094 session.
1095 .Sh "Options That Control Optimization"
1096 .IX Subsection "Options That Control Optimization"
1097 Most Fortran users will want to use no optimization when
1098 developing and testing programs, and use \fB\-O\fR or \fB\-O2\fR when
1099 compiling programs for late-cycle testing and for production use.
1100 However, note that certain diagnostics\-\-\-such as for uninitialized
1101 variables\-\-\-depend on the flow analysis done by \fB\-O\fR, i.e. you
1102 must use \fB\-O\fR or \fB\-O2\fR to get such diagnostics.
1103 .PP
1104 The following flags have particular applicability when
1105 compiling Fortran programs:
1106 .Ip "\fB\-malign-double\fR" 4
1107 .IX Item "-malign-double"
1108 (Intel x86 architecture only.)
1109 .Sp
1110 Noticeably improves performance of \fBg77\fR programs making
1111 heavy use of \f(CW\*(C`REAL(KIND=2)\*(C'\fR (\f(CW\*(C`DOUBLE PRECISION\*(C'\fR) data
1112 on some systems.
1113 In particular, systems using Pentium, Pentium Pro, 586, and
1114 686 implementations
1115 of the i386 architecture execute programs faster when
1116 \&\f(CW\*(C`REAL(KIND=2)\*(C'\fR (\f(CW\*(C`DOUBLE PRECISION\*(C'\fR) data are
1117 aligned on 64\-bit boundaries
1118 in memory.
1119 .Sp
1120 This option can, at least, make benchmark results more consistent
1121 across various system configurations, versions of the program,
1122 and data sets.
1123 .Sp
1124 \&\fINote:\fR The warning in the \fBgcc\fR documentation about
1125 this option does not apply, generally speaking, to Fortran
1126 code compiled by \fBg77\fR
1127 .Sp
1128 \&\fIAlso also note:\fR The negative form of \fB\-malign-double\fR
1129 is \fB\-mno-align-double\fR, not \fB\-benign-double\fR.
1130 .Ip "\fB\-ffloat-store\fR" 4
1131 .IX Item "-ffloat-store"
1132 Might help a Fortran program that depends on exact \s-1IEEE\s0 conformance on
1133 some machines, but might slow down a program that doesn't.
1134 .Sp
1135 This option is effective when the floating-point unit is set to work in
1136 \&\s-1IEEE\s0 854 `extended precision'\-\-\-as it typically is on x86 and m68k \s-1GNU\s0
1137 systems\-\-\-rather than \s-1IEEE\s0 754 double precision.  \fB\-ffloat-store\fR
1138 tries to remove the extra precision by spilling data from floating-point
1139 registers into memory and this typically involves a big performance
1140 hit.  However, it doesn't affect intermediate results, so that it is
1141 only partially effective.  `Excess precision' is avoided in code like:
1142 .Sp
1143 .Vb 2
1144 \&        a = b + c
1145 \&        d = a * e
1146 .Ve
1147 but not in code like:
1148 .Sp
1149 .Vb 1
1150 \&              d = (b + c) * e
1151 .Ve
1152 For another, potentially better, way of controlling the precision,
1153 see \f(CW@ref\fR{Floating-point precision}.
1154 .Ip "\fB\-fforce-mem\fR" 4
1155 .IX Item "-fforce-mem"
1156 .PD 0
1157 .Ip "\fB\-fforce-addr\fR" 4
1158 .IX Item "-fforce-addr"
1159 .PD
1160 Might improve optimization of loops.
1161 .Ip "\fB\-fno-inline\fR" 4
1162 .IX Item "-fno-inline"
1163 Don't compile statement functions inline.
1164 Might reduce the size of a program unit\-\-\-which might be at
1165 expense of some speed (though it should compile faster).
1166 Note that if you are not optimizing, no functions can be expanded inline.
1167 .Ip "\fB\-ffast-math\fR" 4
1168 .IX Item "-ffast-math"
1169 Might allow some programs designed to not be too dependent
1170 on \s-1IEEE\s0 behavior for floating-point to run faster, or die trying.
1171 Sets \fB\-funsafe-math-optimizations\fR, and
1172 \&\fB\-fno-trapping-math\fR.
1173 .Ip "\fB\-funsafe-math-optimizations\fR" 4
1174 .IX Item "-funsafe-math-optimizations"
1175 Allow optimizations that may be give incorrect results
1176 for certain \s-1IEEE\s0 inputs.
1177 .Ip "\fB\-fno-trapping-math\fR" 4
1178 .IX Item "-fno-trapping-math"
1179 Allow the compiler to assume that floating-point arithmetic
1180 will not generate traps on any inputs.  This is useful, for
1181 example, when running a program using \s-1IEEE\s0 \*(L"non-stop\*(R"
1182 floating-point arithmetic.
1183 .Ip "\fB\-fstrength-reduce\fR" 4
1184 .IX Item "-fstrength-reduce"
1185 Might make some loops run faster.
1186 .Ip "\fB\-frerun-cse-after-loop\fR" 4
1187 .IX Item "-frerun-cse-after-loop"
1188 .PD 0
1189 .Ip "\fB\-fexpensive-optimizations\fR" 4
1190 .IX Item "-fexpensive-optimizations"
1191 .Ip "\fB\-fdelayed-branch\fR" 4
1192 .IX Item "-fdelayed-branch"
1193 .Ip "\fB\-fschedule-insns\fR" 4
1194 .IX Item "-fschedule-insns"
1195 .Ip "\fB\-fschedule-insns2\fR" 4
1196 .IX Item "-fschedule-insns2"
1197 .Ip "\fB\-fcaller-saves\fR" 4
1198 .IX Item "-fcaller-saves"
1199 .PD
1200 Might improve performance on some code.
1201 .Ip "\fB\-funroll-loops\fR" 4
1202 .IX Item "-funroll-loops"
1203 Typically improves performance on code using iterative \f(CW\*(C`DO\*(C'\fR loops by
1204 unrolling them and is probably generally appropriate for Fortran, though
1205 it is not turned on at any optimization level.
1206 Note that outer loop unrolling isn't done specifically; decisions about
1207 whether to unroll a loop are made on the basis of its instruction count.
1208 .Sp
1209 Also, no `loop discovery'[1] is done, so only loops written with \f(CW\*(C`DO\*(C'\fR
1210 benefit from loop optimizations, including\-\-\-but not limited
1211 to\-\-\-unrolling.  Loops written with \f(CW\*(C`IF\*(C'\fR and \f(CW\*(C`GOTO\*(C'\fR are not
1212 currently recognized as such.  This option unrolls only iterative
1213 \&\f(CW\*(C`DO\*(C'\fR loops, not \f(CW\*(C`DO WHILE\*(C'\fR loops.
1214 .Ip "\fB\-funroll-all-loops\fR" 4
1215 .IX Item "-funroll-all-loops"
1216 Probably improves performance on code using \f(CW\*(C`DO WHILE\*(C'\fR loops by
1217 unrolling them in addition to iterative \f(CW\*(C`DO\*(C'\fR loops.  In the absence
1218 of \f(CW\*(C`DO WHILE\*(C'\fR, this option is equivalent to \fB\-funroll-loops\fR
1219 but possibly slower.
1220 .Ip "\fB\-fno-move-all-movables\fR" 4
1221 .IX Item "-fno-move-all-movables"
1222 .PD 0
1223 .Ip "\fB\-fno-reduce-all-givs\fR" 4
1224 .IX Item "-fno-reduce-all-givs"
1225 .Ip "\fB\-fno-rerun-loop-opt\fR" 4
1226 .IX Item "-fno-rerun-loop-opt"
1227 .PD
1228 In general, the optimizations enabled with these options will lead to
1229 faster code being generated by \s-1GNU\s0 Fortran; hence they are enabled by default
1230 when issuing the \fBg77\fR command.
1231 .Sp
1232 \&\fB\-fmove-all-movables\fR and \fB\-freduce-all-givs\fR will enable
1233 loop optimization to move all loop-invariant index computations in nested
1234 loops over multi-rank array dummy arguments out of these loops.
1235 .Sp
1236 \&\fB\-frerun-loop-opt\fR will move offset calculations resulting
1237 from the fact that Fortran arrays by default have a lower bound of 1
1238 out of the loops.
1239 .Sp
1240 These three options are intended to be removed someday, once
1241 loop optimization is sufficiently advanced to perform all those
1242 transformations without help from these options.
1243 .Sh "Options Controlling the Preprocessor"
1244 .IX Subsection "Options Controlling the Preprocessor"
1245 These options control the C preprocessor, which is run on each C source
1246 file before actual compilation.
1247 .PP
1248 Some of these options also affect how \fBg77\fR processes the
1249 \&\f(CW\*(C`INCLUDE\*(C'\fR directive.
1250 Since this directive is processed even when preprocessing
1251 is not requested, it is not described in this section.
1252 .PP
1253 However, the \f(CW\*(C`INCLUDE\*(C'\fR directive does not apply
1254 preprocessing to the contents of the included file itself.
1255 .PP
1256 Therefore, any file that contains preprocessor directives
1257 (such as \f(CW\*(C`#include\*(C'\fR, \f(CW\*(C`#define\*(C'\fR, and \f(CW\*(C`#if\*(C'\fR)
1258 must be included via the \f(CW\*(C`#include\*(C'\fR directive, not
1259 via the \f(CW\*(C`INCLUDE\*(C'\fR directive.
1260 Therefore, any file containing preprocessor directives,
1261 if included, is necessarily included by a file that itself
1262 contains preprocessor directives.
1263 .Sh "Options for Directory Search"
1264 .IX Subsection "Options for Directory Search"
1265 These options affect how the \fBcpp\fR preprocessor searches
1266 for files specified via the \f(CW\*(C`#include\*(C'\fR directive.
1267 Therefore, when compiling Fortran programs, they are meaningful
1268 when the preprocessor is used.
1269 .PP
1270 Some of these options also affect how \fBg77\fR searches
1271 for files specified via the \f(CW\*(C`INCLUDE\*(C'\fR directive,
1272 although files included by that directive are not,
1273 themselves, preprocessed.
1274 These options are:
1275 .Ip "\fB\-I-\fR" 4
1276 .IX Item "-I-"
1277 .PD 0
1278 .Ip "\fB\-I\fR\fIdir\fR" 4
1279 .IX Item "-Idir"
1280 .PD
1281 These affect interpretation of the \f(CW\*(C`INCLUDE\*(C'\fR directive
1282 (as well as of the \f(CW\*(C`#include\*(C'\fR directive of the \fBcpp\fR
1283 preprocessor).
1284 .Sp
1285 Note that \fB\-I\fR\fIdir\fR must be specified \fIwithout\fR any
1286 spaces between \fB\-I\fR and the directory name\-\-\-that is,
1287 \&\fB\-Ifoo/bar\fR is valid, but \fB\-I foo/bar\fR
1288 is rejected by the \fBg77\fR compiler (though the preprocessor supports
1289 the latter form).
1290 Also note that the general behavior of \fB\-I\fR and
1291 \&\f(CW\*(C`INCLUDE\*(C'\fR is pretty much the same as of \fB\-I\fR with
1292 \&\f(CW\*(C`#include\*(C'\fR in the \fBcpp\fR preprocessor, with regard to
1293 looking for \fIheader.gcc\fR files and other such things.
1294 .Sh "Options for Code Generation Conventions"
1295 .IX Subsection "Options for Code Generation Conventions"
1296 These machine-independent options control the interface conventions
1297 used in code generation.
1298 .PP
1299 Most of them have both positive and negative forms; the negative form
1300 of \fB\-ffoo\fR would be \fB\-fno-foo\fR.  In the table below, only
1301 one of the forms is listed\-\-\-the one which is not the default.  You
1302 can figure out the other form by either removing \fBno-\fR or adding
1303 it.
1304 .Ip "\fB\-fno-automatic\fR" 4
1305 .IX Item "-fno-automatic"
1306 Treat each program unit as if the \f(CW\*(C`SAVE\*(C'\fR statement was specified
1307 for every local variable and array referenced in it.
1308 Does not affect common blocks.
1309 (Some Fortran compilers provide this option under
1310 the name \fB\-static\fR.)
1311 .Ip "\fB\-finit-local-zero\fR" 4
1312 .IX Item "-finit-local-zero"
1313 Specify that variables and arrays that are local to a program unit
1314 (not in a common block and not passed as an argument) are to be initialized
1315 to binary zeros.
1316 .Sp
1317 Since there is a run-time penalty for initialization of variables
1318 that are not given the \f(CW\*(C`SAVE\*(C'\fR attribute, it might be a
1319 good idea to also use \fB\-fno-automatic\fR with \fB\-finit-local-zero\fR.
1320 .Ip "\fB\-fno-f2c\fR" 4
1321 .IX Item "-fno-f2c"
1322 Do not generate code designed to be compatible with code generated
1323 by \fBf2c\fR use the \s-1GNU\s0 calling conventions instead.
1324 .Sp
1325 The \fBf2c\fR calling conventions require functions that return
1326 type \f(CW\*(C`REAL(KIND=1)\*(C'\fR to actually return the C type \f(CW\*(C`double\*(C'\fR,
1327 and functions that return type \f(CW\*(C`COMPLEX\*(C'\fR to return the
1328 values via an extra argument in the calling sequence that points
1329 to where to store the return value.
1330 Under the \s-1GNU\s0 calling conventions, such functions simply return
1331 their results as they would in \s-1GNU\s0 C\-\--\f(CW\*(C`REAL(KIND=1)\*(C'\fR functions
1332 return the C type \f(CW\*(C`float\*(C'\fR, and \f(CW\*(C`COMPLEX\*(C'\fR functions
1333 return the \s-1GNU\s0 C type \f(CW\*(C`complex\*(C'\fR (or its \f(CW\*(C`struct\*(C'\fR
1334 equivalent).
1335 .Sp
1336 This does not affect the generation of code that interfaces with the
1337 \&\f(CW\*(C`libg2c\*(C'\fR library.
1338 .Sp
1339 However, because the \f(CW\*(C`libg2c\*(C'\fR library uses \fBf2c\fR
1340 calling conventions, \fBg77\fR rejects attempts to pass
1341 intrinsics implemented by routines in this library as actual
1342 arguments when \fB\-fno-f2c\fR is used, to avoid bugs when
1343 they are actually called by code expecting the \s-1GNU\s0 calling
1344 conventions to work.
1345 .Sp
1346 For example, \fB\s-1INTRINSIC\s0 \s-1ABS\s0;CALL FOO(\s-1ABS\s0)\fR is
1347 rejected when \fB\-fno-f2c\fR is in force.
1348 (Future versions of the \fBg77\fR run-time library might
1349 offer routines that provide GNU-callable versions of the
1350 routines that implement the \fBf2c\fR intrinsics
1351 that may be passed as actual arguments, so that
1352 valid programs need not be rejected when \fB\-fno-f2c\fR
1353 is used.)
1354 .Sp
1355 \&\fBCaution:\fR If \fB\-fno-f2c\fR is used when compiling any
1356 source file used in a program, it must be used when compiling
1357 \&\fIall\fR Fortran source files used in that program.
1358 .Ip "\fB\-ff2c-library\fR" 4
1359 .IX Item "-ff2c-library"
1360 Specify that use of \f(CW\*(C`libg2c\*(C'\fR (or the original \f(CW\*(C`libf2c\*(C'\fR)
1361 is required.
1362 This is the default for the current version of \fBg77\fR
1363 .Sp
1364 Currently it is not
1365 valid to specify \fB\-fno-f2c-library\fR.
1366 This option is provided so users can specify it in shell
1367 scripts that build programs and libraries that require the
1368 \&\f(CW\*(C`libf2c\*(C'\fR library, even when being compiled by future
1369 versions of \fBg77\fR that might otherwise default to
1370 generating code for an incompatible library.
1371 .Ip "\fB\-fno-underscoring\fR" 4
1372 .IX Item "-fno-underscoring"
1373 Do not transform names of entities specified in the Fortran
1374 source file by appending underscores to them.
1375 .Sp
1376 With \fB\-funderscoring\fR in effect, \fBg77\fR appends two underscores
1377 to names with underscores and one underscore to external names with
1378 no underscores.  (\fBg77\fR also appends two underscores to internal
1379 names with underscores to avoid naming collisions with external names.
1380 The \fB\-fno-second-underscore\fR option disables appending of the
1381 second underscore in all cases.)
1382 .Sp
1383 This is done to ensure compatibility with code produced by many
1384 \&\s-1UNIX\s0 Fortran compilers, including \fBf2c\fR which perform the
1385 same transformations.
1386 .Sp
1387 Use of \fB\-fno-underscoring\fR is not recommended unless you are
1388 experimenting with issues such as integration of (\s-1GNU\s0) Fortran into
1389 existing system environments (vis-a-vis existing libraries, tools, and
1390 so on).
1391 .Sp
1392 For example, with \fB\-funderscoring\fR, and assuming other defaults like
1393 \&\fB\-fcase-lower\fR and that \fB\f(BIj()\fB\fR and \fB\f(BImax_count()\fB\fR are
1394 external functions while \fBmy_var\fR and \fBlvar\fR are local variables,
1395 a statement like
1396 .Sp
1397 .Vb 1
1398 \&        I = J() + MAX_COUNT (MY_VAR, LVAR)
1399 .Ve
1400 is implemented as something akin to:
1401 .Sp
1402 .Vb 1
1403 \&        i = j_() + max_count__(&my_var__, &lvar);
1404 .Ve
1405 With \fB\-fno-underscoring\fR, the same statement is implemented as:
1406 .Sp
1407 .Vb 1
1408 \&        i = j() + max_count(&my_var, &lvar);
1409 .Ve
1410 Use of \fB\-fno-underscoring\fR allows direct specification of
1411 user-defined names while debugging and when interfacing \fBg77\fR
1412 code with other languages.
1413 .Sp
1414 Note that just because the names match does \fInot\fR mean that the
1415 interface implemented by \fBg77\fR for an external name matches the
1416 interface implemented by some other language for that same name.
1417 That is, getting code produced by \fBg77\fR to link to code produced
1418 by some other compiler using this or any other method can be only a
1419 small part of the overall solution\-\-\-getting the code generated by
1420 both compilers to agree on issues other than naming can require
1421 significant effort, and, unlike naming disagreements, linkers normally
1422 cannot detect disagreements in these other areas.
1423 .Sp
1424 Also, note that with \fB\-fno-underscoring\fR, the lack of appended
1425 underscores introduces the very real possibility that a user-defined
1426 external name will conflict with a name in a system library, which
1427 could make finding unresolved-reference bugs quite difficult in some
1428 cases\-\-\-they might occur at program run time, and show up only as
1429 buggy behavior at run time.
1430 .Sp
1431 In future versions of \fBg77\fR we hope to improve naming and linking
1432 issues so that debugging always involves using the names as they appear
1433 in the source, even if the names as seen by the linker are mangled to
1434 prevent accidental linking between procedures with incompatible
1435 interfaces.
1436 .Ip "\fB\-fno-second-underscore\fR" 4
1437 .IX Item "-fno-second-underscore"
1438 Do not append a second underscore to names of entities specified
1439 in the Fortran source file.
1440 .Sp
1441 This option has no effect if \fB\-fno-underscoring\fR is
1442 in effect.
1443 .Sp
1444 Otherwise, with this option, an external name such as \fB\s-1MAX_COUNT\s0\fR
1445 is implemented as a reference to the link-time external symbol
1446 \&\fBmax_count_\fR, instead of \fBmax_count_\|_\fR.
1447 .Ip "\fB\-fno-ident\fR" 4
1448 .IX Item "-fno-ident"
1449 Ignore the \fB#ident\fR directive.
1450 .Ip "\fB\-fzeros\fR" 4
1451 .IX Item "-fzeros"
1452 Treat initial values of zero as if they were any other value.
1453 .Sp
1454 As of version 0.5.18, \fBg77\fR normally treats \f(CW\*(C`DATA\*(C'\fR and
1455 other statements that are used to specify initial values of zero
1456 for variables and arrays as if no values were actually specified,
1457 in the sense that no diagnostics regarding multiple initializations
1458 are produced.
1459 .Sp
1460 This is done to speed up compiling of programs that initialize
1461 large arrays to zeros.
1462 .Sp
1463 Use \fB\-fzeros\fR to revert to the simpler, slower behavior
1464 that can catch multiple initializations by keeping track of
1465 all initializations, zero or otherwise.
1466 .Sp
1467 \&\fICaution:\fR Future versions of \fBg77\fR might disregard this option
1468 (and its negative form, the default) or interpret it somewhat
1469 differently.
1470 The interpretation changes will affect only non-standard
1471 programs; standard-conforming programs should not be affected.
1472 .Ip "\fB\-femulate-complex\fR" 4
1473 .IX Item "-femulate-complex"
1474 Implement \f(CW\*(C`COMPLEX\*(C'\fR arithmetic via emulation,
1475 instead of using the facilities of
1476 the \fBgcc\fR back end that provide direct support of
1477 \&\f(CW\*(C`complex\*(C'\fR arithmetic.
1478 .Sp
1479 (\fBgcc\fR had some bugs in its back-end support
1480 for \f(CW\*(C`complex\*(C'\fR arithmetic, due primarily to the support not being
1481 completed as of version 2.8.1 and \f(CW\*(C`egcs\*(C'\fR 1.1.2.)
1482 .Sp
1483 Use \fB\-femulate-complex\fR if you suspect code-generation bugs,
1484 or experience compiler crashes,
1485 that might result from \fBg77\fR using the \f(CW\*(C`COMPLEX\*(C'\fR support
1486 in the \fBgcc\fR back end.
1487 If using that option fixes the bugs or crashes you are seeing,
1488 that indicates a likely \fBg77\fR bugs
1489 (though, all compiler crashes are considered bugs),
1490 so, please report it.
1491 (Note that the known bugs, now believed fixed, produced compiler crashes
1492 rather than causing the generation of incorrect code.)
1493 .Sp
1494 Use of this option should not affect how Fortran code compiled
1495 by \fBg77\fR works in terms of its interfaces to other code,
1496 e.g. that compiled by \fBf2c\fR
1497 .Sp
1498 As of \s-1GCC\s0 version 3.0, this option is not necessary anymore.
1499 .Sp
1500 \&\fICaution:\fR Future versions of \fBg77\fR might ignore both forms
1501 of this option.
1502 .Ip "\fB\-falias-check\fR" 4
1503 .IX Item "-falias-check"
1504 .PD 0
1505 .Ip "\fB\-fargument-alias\fR" 4
1506 .IX Item "-fargument-alias"
1507 .Ip "\fB\-fargument-noalias\fR" 4
1508 .IX Item "-fargument-noalias"
1509 .Ip "\fB\-fno-argument-noalias-global\fR" 4
1510 .IX Item "-fno-argument-noalias-global"
1511 .PD
1512 \&\fIVersion info:\fR
1513 These options are not supported by
1514 versions of \fBg77\fR based on \fBgcc\fR version 2.8.
1515 .Sp
1516 These options specify to what degree aliasing
1517 (overlap)
1518 is permitted between
1519 arguments (passed as pointers) and \f(CW\*(C`COMMON\*(C'\fR (external, or
1520 public) storage.
1521 .Sp
1522 The default for Fortran code, as mandated by the \s-1FORTRAN\s0 77 and
1523 Fortran 90 standards, is \fB\-fargument-noalias-global\fR.
1524 The default for code written in the C language family is
1525 \&\fB\-fargument-alias\fR.
1526 .Sp
1527 Note that, on some systems, compiling with \fB\-fforce-addr\fR in
1528 effect can produce more optimal code when the default aliasing
1529 options are in effect (and when optimization is enabled).
1530 .Ip "\fB\-fno-globals\fR" 4
1531 .IX Item "-fno-globals"
1532 Disable diagnostics about inter-procedural
1533 analysis problems, such as disagreements about the
1534 type of a function or a procedure's argument,
1535 that might cause a compiler crash when attempting
1536 to inline a reference to a procedure within a
1537 program unit.
1538 (The diagnostics themselves are still produced, but
1539 as warnings, unless \fB\-Wno-globals\fR is specified,
1540 in which case no relevant diagnostics are produced.)
1541 .Sp
1542 Further, this option disables such inlining, to
1543 avoid compiler crashes resulting from incorrect
1544 code that would otherwise be diagnosed.
1545 .Sp
1546 As such, this option might be quite useful when
1547 compiling existing, ``working'' code that happens
1548 to have a few bugs that do not generally show themselves,
1549 but which \fBg77\fR diagnoses.
1550 .Sp
1551 Use of this option therefore has the effect of
1552 instructing \fBg77\fR to behave more like it did
1553 up through version 0.5.19.1, when it paid little or
1554 no attention to disagreements between program units
1555 about a procedure's type and argument information,
1556 and when it performed no inlining of procedures
1557 (except statement functions).
1558 .Sp
1559 Without this option, \fBg77\fR defaults to performing
1560 the potentially inlining procedures as it started doing
1561 in version 0.5.20, but as of version 0.5.21, it also
1562 diagnoses disagreements that might cause such inlining
1563 to crash the compiler as (fatal) errors,
1564 and warns about similar disagreements
1565 that are currently believed to not
1566 likely to result in the compiler later crashing
1567 or producing incorrect code.
1568 .Ip "\fB\-fflatten-arrays\fR" 4
1569 .IX Item "-fflatten-arrays"
1570 Use back end's C-like constructs
1571 (pointer plus offset)
1572 instead of its \f(CW\*(C`ARRAY_REF\*(C'\fR construct
1573 to handle all array references.
1574 .Sp
1575 \&\fINote:\fR This option is not supported.
1576 It is intended for use only by \fBg77\fR developers,
1577 to evaluate code-generation issues.
1578 It might be removed at any time.
1579 .Ip "\fB\-fbounds-check\fR" 4
1580 .IX Item "-fbounds-check"
1581 .PD 0
1582 .Ip "\fB\-ffortran-bounds-check\fR" 4
1583 .IX Item "-ffortran-bounds-check"
1584 .PD
1585 Enable generation of run-time checks for array subscripts
1586 and substring start and end points
1587 against the (locally) declared minimum and maximum values.
1588 .Sp
1589 The current implementation uses the \f(CW\*(C`libf2c\*(C'\fR
1590 library routine \f(CW\*(C`s_rnge\*(C'\fR to print the diagnostic.
1591 .Sp
1592 However, whereas \fBf2c\fR generates a single check per
1593 reference for a multi-dimensional array, of the computed
1594 offset against the valid offset range (0 through the size of the array),
1595 \&\fBg77\fR generates a single check per \fIsubscript\fR expression.
1596 This catches some cases of potential bugs that \fBf2c\fR does not,
1597 such as references to below the beginning of an assumed-size array.
1598 .Sp
1599 \&\fBg77\fR also generates checks for \f(CW\*(C`CHARACTER\*(C'\fR substring references,
1600 something \fBf2c\fR currently does not do.
1601 .Sp
1602 Use the new \fB\-ffortran-bounds-check\fR option
1603 to specify bounds-checking for only the Fortran code you are compiling,
1604 not necessarily for code written in other languages.
1605 .Sp
1606 \&\fINote:\fR To provide more detailed information on the offending subscript,
1607 \&\fBg77\fR provides the \f(CW\*(C`libg2c\*(C'\fR run-time library routine \f(CW\*(C`s_rnge\*(C'\fR
1608 with somewhat differently-formatted information.
1609 Here's a sample diagnostic:
1610 .Sp
1611 .Vb 3
1612 \&        Subscript out of range on file line 4, procedure rnge.f/bf.
1613 \&        Attempt to access the -6-th element of variable b[subscript-2-of-2].
1614 \&        Aborted
1615 .Ve
1616 The above message indicates that the offending source line is
1617 line 4 of the file \fIrnge.f\fR,
1618 within the program unit (or statement function) named \fBbf\fR.
1619 The offended array is named \fBb\fR.
1620 The offended array dimension is the second for a two-dimensional array,
1621 and the offending, computed subscript expression was \fB\-6\fR.
1622 .Sp
1623 For a \f(CW\*(C`CHARACTER\*(C'\fR substring reference, the second line has
1624 this appearance:
1625 .Sp
1626 .Vb 1
1627 \&        Attempt to access the 11-th element of variable a[start-substring].
1628 .Ve
1629 This indicates that the offended \f(CW\*(C`CHARACTER\*(C'\fR variable or array
1630 is named \fBa\fR,
1631 the offended substring position is the starting (leftmost) position,
1632 and the offending substring expression is \fB11\fR.
1633 .Sp
1634 (Though the verbage of \f(CW\*(C`s_rnge\*(C'\fR is not ideal
1635 for the purpose of the \fBg77\fR compiler,
1636 the above information should provide adequate diagnostic abilities
1637 to it users.)
1638 .PP
1639 Some of these do \fInot\fR work when compiling programs written in Fortran:
1640 .Ip "\fB\-fpcc-struct-return\fR" 4
1641 .IX Item "-fpcc-struct-return"
1642 .PD 0
1643 .Ip "\fB\-freg-struct-return\fR" 4
1644 .IX Item "-freg-struct-return"
1645 .PD
1646 You should not use these except strictly the same way as you
1647 used them to build the version of \f(CW\*(C`libg2c\*(C'\fR with which
1648 you will be linking all code compiled by \fBg77\fR with the
1649 same option.
1650 .Ip "\fB\-fshort-double\fR" 4
1651 .IX Item "-fshort-double"
1652 This probably either has no effect on Fortran programs, or
1653 makes them act loopy.
1654 .Ip "\fB\-fno-common\fR" 4
1655 .IX Item "-fno-common"
1656 Do not use this when compiling Fortran programs,
1657 or there will be Trouble.
1658 .Ip "\fB\-fpack-struct\fR" 4
1659 .IX Item "-fpack-struct"
1660 This probably will break any calls to the \f(CW\*(C`libg2c\*(C'\fR library,
1661 at the very least, even if it is built with the same option.
1662 .SH "ENVIRONMENT"
1663 .IX Header "ENVIRONMENT"
1664 \&\s-1GNU\s0 Fortran currently does not make use of any environment
1665 variables to control its operation above and beyond those
1666 that affect the operation of \fBgcc\fR.
1667 .SH "BUGS"
1668 .IX Header "BUGS"
1669 For instructions on reporting bugs, see
1670 <\fBhttp://gcc.gnu.org/bugs.html\fR>.  Use of the \fBgccbug\fR  
1671 script to report bugs is recommended.
1672 .SH "FOOTNOTES"
1673 .IX Header "FOOTNOTES"
1674 .Ip "1." 4
1675 \&\fIloop discovery\fR refers to the
1676 process by which a compiler, or indeed any reader of a program,
1677 determines which portions of the program are more likely to be executed
1678 repeatedly as it is being run.  Such discovery typically is done early
1679 when compiling using optimization techniques, so the ``discovered''
1680 loops get more attention\-\-\-and more run-time resources, such as
1681 registers\-\-\-from the compiler.  It is easy to ``discover'' loops that are
1682 constructed out of looping constructs in the language
1683 (such as Fortran's \f(CW\*(C`DO\*(C'\fR).  For some programs, ``discovering'' loops
1684 constructed out of lower-level constructs (such as \f(CW\*(C`IF\*(C'\fR and
1685 \&\f(CW\*(C`GOTO\*(C'\fR) can lead to generation of more optimal code
1686 than otherwise.
1687 .SH "SEE ALSO"
1688 .IX Header "SEE ALSO"
1689 \&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf-funding\fR\|(7),
1690 \&\fIcpp\fR\|(1), \fIgcov\fR\|(1), \fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), \fIgdb\fR\|(1), \fIadb\fR\|(1), \fIdbx\fR\|(1), \fIsdb\fR\|(1)
1691 and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIg77\fR, \fIas\fR,
1692 \&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
1693 .SH "AUTHOR"
1694 .IX Header "AUTHOR"
1695 See the Info entry for \fBg77\fR for contributors to \s-1GCC\s0 and G77.
1696 .SH "COPYRIGHT"
1697 .IX Header "COPYRIGHT"
1698 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
1699 Free Software Foundation, Inc.
1700 .PP
1701 Permission is granted to copy, distribute and/or modify this document
1702 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or
1703 any later version published by the Free Software Foundation; with the
1704 Invariant Sections being ``\s-1GNU\s0 General Public License'' and ``Funding
1705 Free Software'', the Front-Cover texts being (a) (see below), and with
1706 the Back-Cover Texts being (b) (see below).  A copy of the license is
1707 included in the \fIgfdl\fR\|(7) man page.
1708 .PP
1709 (a) The \s-1FSF\s0's Front-Cover Text is:
1710 .PP
1711 .Vb 1
1712 \&     A GNU Manual
1713 .Ve
1714 (b) The \s-1FSF\s0's Back-Cover Text is:
1715 .PP
1716 .Vb 3
1717 \&     You have freedom to copy and modify this GNU Manual, like GNU
1718 \&     software.  Copies published by the Free Software Foundation raise
1719 \&     funds for GNU development.
1720 .Ve