|
|
1.1 root 1: .\" Copyright (c) 1991, 1992, 1993 Free Software Foundation -*-Text-*-
2: .\" See section COPYING for conditions for redistribution
3: .\"
4: .\" Set up \*(lq, \*(rq if -man hasn't already set it up.
5: .if @@\*(lq@ \{\
6: . ds lq "
7: . if t .ds lq ``
8: . if !@@\(lq@ .ds lq "\(lq
9: .\}
10: .if @@\*(rq@ \{\
11: . ds rq "
12: . if t .ds rq ''
13: . if !@@\(rq@ .ds rq "\(rq
14: .\}
15: .de Id
16: .ds Rv \\$3
17: .ds Dt \\$4
18: ..
19: .de Sp
20: .if n .sp
21: .if t .sp 0.4
22: ..
23: .Id $Id: gcc.1,v 1.4 1993/10/13 23:19:12 pesch Exp $
24: .TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
25: .SH NAME
26: gcc, g++ \- GNU project C and C++ Compiler (v2.4)
27: .SH SYNOPSIS
28: .B gcc
29: .RI "[ " option " | " filename " ].\|.\|."
30: .br
31: .B g++
32: .RI "[ " option " | " filename " ].\|.\|."
33: .SH WARNING
34: The information in this man page is an extract from the full
35: documentation of the GNU C compiler, and is limited to the meaning of
36: the options.
37: .PP
38: This man page is not kept up to date except when volunteers want to
39: maintain it. If you find a discrepancy between the man page and the
40: software, please check the Info file, which is the authoritative
41: documentation.
42: .PP
43: If we find that the things in this man page that are out of date cause
44: significant confusion or complaints, we will stop distributing the man
45: page. The alternative, updating the man page when we update the Info
46: file, is impossible because the rest of the work of maintaining GNU CC
47: leaves us no time for that. The GNU project regards man pages as
48: obsolete and should not let them take time away from other things.
49: .PP
50: For complete and current documentation, refer to the Info file `\|\c
51: .B gcc\c
52: \&\|' or the manual
53: .I
54: Using and Porting GNU CC (for version 2.0)\c
55: \&. Both are made from the Texinfo source file
56: .BR gcc.texinfo .
57: .SH DESCRIPTION
58: The C and C++ compilers are integrated. Both process input files
59: through one or more of four stages: preprocessing, compilation,
60: assembly, and linking. Source filename suffixes identify the source
61: language, but which name you use for the compiler governs default
62: assumptions:
63: .TP
64: .B gcc
65: assumes preprocessed (\c
66: .B .i\c
67: \&) files are C and assumes C style linking.
68: .TP
69: .B g++
70: assumes preprocessed (\c
71: .B .i\c
72: \&) files are C++ and assumes C++ style linking.
73: .PP
74: Suffixes of source file names indicate the language and kind of
75: processing to be done:
76: .Sp
77: .nf
78: .ta \w'\fB.cxx\fP 'u
79: \&\fB.c\fP C source; preprocess, compile, assemble
80: \&\fB.C\fP C++ source; preprocess, compile, assemble
81: \&\fB.cc\fP C++ source; preprocess, compile, assemble
82: \&\fB.cxx\fP C++ source; preprocess, compile, assemble
83: \&\fB.m\fP Objective-C source; preprocess, compile, assemble
84: \&\fB.i\fP preprocessed C; compile, assemble
85: \&\fB.ii\fP preprocessed C++; compile, assemble
86: \&\fB.s\fP Assembler source; assemble
87: \&\fB.S\fP Assembler source; preprocess, assemble
88: \&\fB.h\fP Preprocessor file; not usually named on command line
89: .Sp
90: .fi
91: Files with other suffixes are passed to the linker. Common cases include:
92: .Sp
93: .nf
94: \&\fB.o\fP Object file
95: \&\fB.a\fP Archive file
96: .br
97: .fi
98: .Sp
99: Linking is always the last stage unless you use one of the
100: .BR \-c ,
101: .BR \-S ,
102: or
103: .B \-E
104: options to avoid it (or unless compilation errors stop the whole
105: process). For the link stage, all
106: .B .o
107: files corresponding to source files,
108: .B \-l
109: libraries, unrecognized filenames (including named
110: .B .o
111: object files and
112: .B .a
113: archives)
114: are passed to the linker in command-line order.
115: .SH OPTIONS
116: Options must be separate: `\|\c
117: .B \-dr\c
118: \&\|' is quite different from `\|\c
119: .B \-d \-r
120: \&\|'.
121: .PP
122: Most `\|\c
123: .B \-f\c
124: \&\|' and `\|\c
125: .B \-W\c
126: \&\|' options have two contrary forms:
127: .BI \-f name
128: and
129: .BI \-fno\- name\c
130: \& (or
131: .BI \-W name
132: and
133: .BI \-Wno\- name\c
134: \&). Only the non-default forms are shown here.
135: .PP
136: Here is a summary of all the options, grouped by type. Explanations are
137: in the following sections.
138: .hy 0
139: .na
140: .TP
141: .B Overall Options
142: .br
143: \-c
144: \-S
145: \-E
146: .RI "\-o " file
147: \-pipe
148: \-v
149: .RI "\-x " language
150: .TP
151: .B Language Options
152: \-ansi
153: \-fall\-virtual
154: \-fcond\-mismatch
155: \-fdollars\-in\-identifiers
156: \-fenum\-int\-equiv
157: \-fexternal\-templates
158: \-fno\-asm
159: \-fno\-builtin
160: \-fno\-strict\-prototype
161: \-fsigned\-bitfields
162: \-fsigned\-char
163: \-fthis\-is\-variable
164: \-funsigned\-bitfields
165: \-funsigned\-char
166: \-fwritable\-strings
167: \-traditional
168: \-traditional\-cpp
169: \-trigraphs
170: .TP
171: .B Warning Options
172: \-fsyntax\-only
173: \-pedantic
174: \-pedantic\-errors
175: \-w
176: \-W
177: \-Wall
178: \-Waggregate\-return
179: \-Wcast\-align
180: \-Wcast\-qual
181: \-Wchar\-subscript
182: \-Wcomment
183: \-Wconversion
184: \-Wenum\-clash
185: \-Werror
186: \-Wformat
187: .RI \-Wid\-clash\- len
188: \-Wimplicit
189: \-Winline
190: \-Wmissing\-prototypes
191: \-Wnested\-externs
192: \-Wno\-import
193: \-Wparentheses
194: \-Wpointer\-arith
195: \-Wredundant\-decls
196: \-Wreturn\-type
197: \-Wshadow
198: \-Wstrict\-prototypes
199: \-Wswitch
200: \-Wtemplate\-debugging
201: \-Wtraditional
202: \-Wtrigraphs
203: \-Wuninitialized
204: \-Wunused
205: \-Wwrite\-strings
206: .TP
207: .B Debugging Options
208: \-a
209: .RI \-d letters
210: \-fpretend\-float
211: \-g
212: .RI \-g level
213: \-gcoff
214: \-gxcoff
215: \-gxcoff+
216: \-gdwarf
217: \-gdwarf+
218: \-gstabs
219: \-gstabs+
220: \-ggdb
221: \-p
222: \-pg
223: \-save\-temps
224: \-print\-libgcc\-file\-name
225: .TP
226: .B Optimization Options
227: \-fcaller\-saves
228: \-fcse\-follow\-jumps
229: \-fcse\-skip\-blocks
230: \-fdelayed\-branch
231: \-felide\-constructors
232: \-fexpensive\-optimizations
233: \-ffast\-math
234: \-ffloat\-store
235: \-fforce\-addr
236: \-fforce\-mem
237: \-finline\-functions
238: \-fkeep\-inline\-functions
239: \-fmemoize\-lookups
240: \-fno\-default\-inline
241: \-fno\-defer\-pop
242: \-fno\-function\-cse
243: \-fno\-inline
244: \-fno\-peephole
245: \-fomit\-frame\-pointer
246: \-frerun\-cse\-after\-loop
247: \-fschedule\-insns
248: \-fschedule\-insns2
249: \-fstrength\-reduce
250: \-fthread\-jumps
251: \-funroll\-all\-loops
252: \-funroll\-loops
253: \-O
254: \-O2
255: .TP
256: .B Preprocessor Options
257: .RI \-A assertion
258: \-C
259: \-dD
260: \-dM
261: \-dN
262: .RI \-D macro [\|= defn \|]
263: \-E
264: \-H
265: .RI "\-idirafter " dir
266: .RI "\-include " file
267: .RI "\-imacros " file
268: .RI "\-iprefix " file
269: .RI "\-iwithprefix " dir
270: \-M
271: \-MD
272: \-MM
273: \-MMD
274: \-nostdinc
275: \-P
276: .RI \-U macro
277: \-undef
278: .TP
279: .B Assembler Option
280: .RI \-Wa, option
281: .TP
282: .B Linker Options
283: .RI \-l library
284: \-nostartfiles
285: \-nostdlib
286: \-static
287: \-shared
288: \-symbolic
289: .RI "\-Xlinker\ " option
290: .RI \-Wl, option
291: .RI "\-u " symbol
292: .TP
293: .B Directory Options
294: .RI \-B prefix
295: .RI \-I dir
296: \-I\-
297: .RI \-L dir
298: .TP
299: .B Target Options
300: .RI "\-b " machine
301: .RI "\-V " version
302: .TP
303: .B Configuration Dependent Options
304: .I M680x0\ Options
305: .br
306: \-m68000
307: \-m68020
308: \-m68020\-40
309: \-m68030
310: \-m68040
311: \-m68881
312: \-mbitfield
313: \-mc68000
314: \-mc68020
315: \-mfpa
316: \-mnobitfield
317: \-mrtd
318: \-mshort
319: \-msoft\-float
320: .Sp
321: .I VAX Options
322: .br
323: \-mg
324: \-mgnu
325: \-munix
326: .Sp
327: .I SPARC Options
328: .br
329: \-mepilogue
330: \-mfpu
331: \-mhard\-float
332: \-mno\-fpu
333: \-mno\-epilogue
334: \-msoft\-float
335: \-msparclite
336: \-mv8
337: .Sp
338: .I Convex Options
339: .br
340: \-margcount
341: \-mc1
342: \-mc2
343: \-mnoargcount
344: .Sp
345: .I AMD29K Options
346: .br
347: \-m29000
348: \-m29050
349: \-mbw
350: \-mdw
351: \-mkernel\-registers
352: \-mlarge
353: \-mnbw
354: \-mnodw
355: \-msmall
356: \-mstack\-check
357: \-muser\-registers
358: .Sp
359: .I M88K Options
360: .br
361: \-m88000
362: \-m88100
363: \-m88110
364: \-mbig\-pic
365: \-mcheck\-zero\-division
366: \-mhandle\-large\-shift
367: \-midentify\-revision
368: \-mno\-check\-zero\-division
369: \-mno\-ocs\-debug\-info
370: \-mno\-ocs\-frame\-position
371: \-mno\-optimize\-arg\-area
372: \-mno\-seriazlize\-volatile
373: \-mno\-underscores
374: \-mocs\-debug\-info
375: \-mocs\-frame\-position
376: \-moptimize\-arg\-area
377: \-mserialize\-volatile
378: .RI \-mshort\-data\- num
379: \-msvr3
380: \-msvr4
381: \-mtrap\-large\-shift
382: \-muse\-div\-instruction
383: \-mversion\-03.00
384: \-mwarn\-passed\-structs
385: .Sp
386: .I RS6000 Options
387: .br
388: \-mfp\-in\-toc
389: \-mno\-fop\-in\-toc
390: .Sp
391: .I RT Options
392: .br
393: \-mcall\-lib\-mul
394: \-mfp\-arg\-in\-fpregs
395: \-mfp\-arg\-in\-gregs
396: \-mfull\-fp\-blocks
397: \-mhc\-struct\-return
398: \-min\-line\-mul
399: \-mminimum\-fp\-blocks
400: \-mnohc\-struct\-return
401: .Sp
402: .I MIPS Options
403: .br
404: \-mcpu=\fIcpu type\fP
405: \-mips2
406: \-mips3
407: \-mint64
408: \-mlong64
409: \-mlonglong128
410: \-mmips\-as
411: \-mgas
412: \-mrnames
413: \-mno\-rnames
414: \-mgpopt
415: \-mno\-gpopt
416: \-mstats
417: \-mno\-stats
418: \-mmemcpy
419: \-mno\-memcpy
420: \-mno\-mips\-tfile
421: \-mmips\-tfile
422: \-msoft\-float
423: \-mhard\-float
424: \-mabicalls
425: \-mno\-abicalls
426: \-mhalf\-pic
427: \-mno\-half\-pic
428: \-G \fInum\fP
429: \-nocpp
430: .Sp
431: .I i386 Options
432: .br
433: \-m486
434: \-mno\-486
435: \-msoft\-float
436: \-mno\-fp\-ret\-in\-387
437: .Sp
438: .I HPPA Options
439: .br
440: \-mpa\-risc\-1\-0
441: \-mpa\-risc\-1\-1
442: \-mkernel
443: \-mshared\-libs
444: \-mno\-shared\-libs
445: \-mlong\-calls
446: \-mdisable\-fpregs
447: \-mdisable\-indexing
448: \-mtrailing\-colon
449: .Sp
450: .I i960 Options
451: .br
452: \-m\fIcpu-type\fP
453: \-mnumerics
454: \-msoft\-float
455: \-mleaf\-procedures
456: \-mno\-leaf\-procedures
457: \-mtail\-call
458: \-mno\-tail\-call
459: \-mcomplex\-addr
460: \-mno\-complex\-addr
461: \-mcode\-align
462: \-mno\-code\-align
463: \-mic\-compat
464: \-mic2.0\-compat
465: \-mic3.0\-compat
466: \-masm\-compat
467: \-mintel\-asm
468: \-mstrict\-align
469: \-mno\-strict\-align
470: \-mold\-align
471: \-mno\-old\-align
472: .Sp
473: .I DEC Alpha Options
474: .br
475: \-mfp\-regs
476: \-mno\-fp\-regs
477: \-mno\-soft\-float
478: \-msoft\-float
479: .Sp
480: .I System V Options
481: .br
482: \-G
483: \-Qy
484: \-Qn
485: .RI \-YP, paths
486: .RI \-Ym, dir
487: .TP
488: .B Code Generation Options
489: .RI \-fcall\-saved\- reg
490: .RI \-fcall\-used\- reg
491: .RI \-ffixed\- reg
492: \-finhibit\-size\-directive
493: \-fnonnull\-objects
494: \-fno\-common
495: \-fno\-ident
496: \-fno\-gnu\-linker
497: \-fpcc\-struct\-return
498: \-fpic
499: \-fPIC
500: \-freg\-struct\-returno
501: \-fshared\-data
502: \-fshort\-enums
503: \-fshort\-double
504: \-fvolatile
505: \-fvolatile\-global
506: \-fverbose\-asm
507: .ad b
508: .hy 1
509: .SH OVERALL OPTIONS
510: .TP
511: .BI "\-x " "language"
512: Specify explicitly the
513: .I language\c
514: \& for the following input files (rather than choosing a default based
515: on the file name suffix) . This option applies to all following input
516: files until the next `\|\c
517: .B \-x\c
518: \&\|' option. Possible values of \c
519: .I language\c
520: \& are
521: `\|\c
522: .B c\c
523: \&\|', `\|\c
524: .B objective\-c\c
525: \&\|', `\|\c
526: .B c\-header\c
527: \&\|', `\|\c
528: .B c++\c
529: \&\|',
530: `\|\c
531: .B cpp\-output\c
532: \&\|', `\|\c
533: .B assembler\c
534: \&\|', and `\|\c
535: .B assembler\-with\-cpp\c
536: \&\|'.
537: .TP
538: .B \-x none
539: Turn off any specification of a language, so that subsequent files are
540: handled according to their file name suffixes (as they are if `\|\c
541: .B \-x\c
542: \&\|'
543: has not been used at all).
544: .PP
545: If you want only some of the four stages (preprocess, compile,
546: assemble, link), you can use
547: `\|\c
548: .B \-x\c
549: \&\|' (or filename suffixes) to tell \c
550: .B gcc\c
551: \& where to start, and
552: one of the options `\|\c
553: .B \-c\c
554: \&\|', `\|\c
555: .B \-S\c
556: \&\|', or `\|\c
557: .B \-E\c
558: \&\|' to say where
559: .B gcc\c
560: \& is to stop. Note that some combinations (for example,
561: `\|\c
562: .B \-x cpp\-output \-E\c
563: \&\|') instruct \c
564: .B gcc\c
565: \& to do nothing at all.
566: .TP
567: .B \-c
568: Compile or assemble the source files, but do not link. The compiler
569: output is an object file corresponding to each source file.
570: .Sp
571: By default, GCC makes the object file name for a source file by replacing
572: the suffix `\|\c
573: .B .c\c
574: \&\|', `\|\c
575: .B .i\c
576: \&\|', `\|\c
577: .B .s\c
578: \&\|', etc., with `\|\c
579: .B .o\c
580: \&\|'. Use
581: .B \-o\c
582: \& to select another name.
583: .Sp
584: GCC ignores any unrecognized input files (those that do not require
585: compilation or assembly) with the
586: .B \-c
587: option.
588: .TP
589: .B \-S
590: Stop after the stage of compilation proper; do not assemble. The output
591: is an assembler code file for each non-assembler input
592: file specified.
593: .Sp
594: By default, GCC makes the assembler file name for a source file by
595: replacing the suffix `\|\c
596: .B .c\c
597: \&\|', `\|\c
598: .B .i\c
599: \&\|', etc., with `\|\c
600: .B .s\c
601: \&\|'. Use
602: .B \-o\c
603: \& to select another name.
604: .Sp
605: GCC ignores any input files that don't require compilation.
606: .TP
607: .B \-E
608: Stop after the preprocessing stage; do not run the compiler proper. The
609: output is preprocessed source code, which is sent to the
610: standard output.
611: .Sp
612: GCC ignores input files which don't require preprocessing.
613: .TP
614: .BI "\-o " file
615: Place output in file \c
616: .I file\c
617: \&. This applies regardless to whatever
618: sort of output GCC is producing, whether it be an executable file,
619: an object file, an assembler file or preprocessed C code.
620: .Sp
621: Since only one output file can be specified, it does not make sense to
622: use `\|\c
623: .B \-o\c
624: \&\|' when compiling more than one input file, unless you are
625: producing an executable file as output.
626: .Sp
627: If you do not specify `\|\c
628: .B \-o\c
629: \&\|', the default is to put an executable file
630: in `\|\c
631: .B a.out\c
632: \&\|', the object file for `\|\c
633: .I source\c
634: .B \&.\c
635: .I suffix\c
636: \&\c
637: \&\|' in
638: `\|\c
639: .I source\c
640: .B \&.o\c
641: \&\|', its assembler file in `\|\c
642: .I source\c
643: .B \&.s\c
644: \&\|', and
645: all preprocessed C source on standard output.
646: .TP
647: .B \-v
648: Print (on standard error output) the commands executed to run the stages
649: of compilation. Also print the version number of the compiler driver
650: program and of the preprocessor and the compiler proper.
651: .TP
652: .B \-pipe
653: Use pipes rather than temporary files for communication between the
654: various stages of compilation. This fails to work on some systems where
655: the assembler cannot read from a pipe; but the GNU assembler has
656: no trouble.
657: .PP
658: .SH LANGUAGE OPTIONS
659: The following options control the dialect of C that the compiler
660: accepts:
661: .TP
662: .B \-ansi
663: Support all ANSI standard C programs.
664: .Sp
665: This turns off certain features of GNU C that are incompatible with
666: ANSI C, such as the \c
667: .B asm\c
668: \&, \c
669: .B inline\c
670: \& and \c
671: .B typeof
672: keywords, and predefined macros such as \c
673: .B unix\c
674: \& and \c
675: .B vax
676: that identify the type of system you are using. It also enables the
677: undesirable and rarely used ANSI trigraph feature, and disallows `\|\c
678: .B $\c
679: \&\|' as part of identifiers.
680: .Sp
681: The alternate keywords \c
682: .B _\|_asm_\|_\c
683: \&, \c
684: .B _\|_extension_\|_\c
685: \&,
686: .B _\|_inline_\|_\c
687: \& and \c
688: .B _\|_typeof_\|_\c
689: \& continue to work despite
690: `\|\c
691: .B \-ansi\c
692: \&\|'. You would not want to use them in an ANSI C program, of
693: course, but it is useful to put them in header files that might be included
694: in compilations done with `\|\c
695: .B \-ansi\c
696: \&\|'. Alternate predefined macros
697: such as \c
698: .B _\|_unix_\|_\c
699: \& and \c
700: .B _\|_vax_\|_\c
701: \& are also available, with or
702: without `\|\c
703: .B \-ansi\c
704: \&\|'.
705: .Sp
706: The `\|\c
707: .B \-ansi\c
708: \&\|' option does not cause non-ANSI programs to be
709: rejected gratuitously. For that, `\|\c
710: .B \-pedantic\c
711: \&\|' is required in
712: addition to `\|\c
713: .B \-ansi\c
714: \&\|'.
715: .Sp
716: The preprocessor predefines a macro \c
717: .B _\|_STRICT_ANSI_\|_\c
718: \& when you use the `\|\c
719: .B \-ansi\c
720: \&\|'
721: option. Some header files may notice this macro and refrain
722: from declaring certain functions or defining certain macros that the
723: ANSI standard doesn't call for; this is to avoid interfering with any
724: programs that might use these names for other things.
725: .TP
726: .B \-fno\-asm
727: Do not recognize \c
728: .B asm\c
729: \&, \c
730: .B inline\c
731: \& or \c
732: .B typeof\c
733: \& as a
734: keyword. These words may then be used as identifiers. You can
735: use \c
736: .B _\|_asm_\|_\c
737: \&, \c
738: .B _\|_inline_\|_\c
739: \& and \c
740: .B _\|_typeof_\|_\c
741: \& instead.
742: `\|\c
743: .B \-ansi\c
744: \&\|' implies `\|\c
745: .B \-fno\-asm\c
746: \&\|'.
747: .TP
748: .B \-fno\-builtin
749: Don't recognize built-in functions that do not begin with two leading
750: underscores. Currently, the functions affected include \c
751: .B _exit\c
752: \&,
753: .B abort\c
754: \&, \c
755: .B abs\c
756: \&, \c
757: .B alloca\c
758: \&, \c
759: .B cos\c
760: \&, \c
761: .B exit\c
762: \&,
763: .B fabs\c
764: \&, \c
765: .B labs\c
766: \&, \c
767: .B memcmp\c
768: \&, \c
769: .B memcpy\c
770: \&, \c
771: .B sin\c
772: \&,
773: .B sqrt\c
774: \&, \c
775: .B strcmp\c
776: \&, \c
777: .B strcpy\c
778: \&, and \c
779: .B strlen\c
780: \&.
781: .Sp
782: The `\|\c
783: .B \-ansi\c
784: \&\|' option prevents \c
785: .B alloca\c
786: \& and \c
787: .B _exit\c
788: \& from
789: being builtin functions.
790: .TP
791: .B \-fno\-strict\-prototype
792: Treat a function declaration with no arguments, such as `\|\c
793: .B int foo
794: ();\c
795: \&\|', as C would treat it\(em\&as saying nothing about the number of
796: arguments or their types (C++ only). Normally, such a declaration in
797: C++ means that the function \c
798: .B foo\c
799: \& takes no arguments.
800: .TP
801: .B \-trigraphs
802: Support ANSI C trigraphs. The `\|\c
803: .B \-ansi\c
804: \&\|' option implies `\|\c
805: .B \-trigraphs\c
806: \&\|'.
807: .TP
808: .B \-traditional
809: Attempt to support some aspects of traditional C compilers.
810: For details, see the GNU C Manual; the duplicate list here
811: has been deleted so that we won't get complaints when it
812: is out of date.
813: .Sp
814: But one note about C++ programs only (not C). `\|\c
815: .B \-traditional\c
816: \&\|' has one additional effect for C++: assignment to
817: .B this
818: is permitted. This is the same as the effect of `\|\c
819: .B \-fthis\-is\-variable\c
820: \&\|'.
821: .TP
822: .B \-traditional\-cpp
823: Attempt to support some aspects of traditional C preprocessors.
824: This includes the items that specifically mention the preprocessor above,
825: but none of the other effects of `\|\c
826: .B \-traditional\c
827: \&\|'.
828: .TP
829: .B \-fdollars\-in\-identifiers
830: Permit the use of `\|\c
831: .B $\c
832: \&\|' in identifiers (C++ only). You can also use
833: `\|\c
834: .B \-fno\-dollars\-in\-identifiers\c
835: \&\|' to explicitly prohibit use of
836: `\|\c
837: .B $\c
838: \&\|'. (GNU C++ allows `\|\c
839: .B $\c
840: \&\|' by default on some target systems
841: but not others.)
842: .TP
843: .B \-fenum\-int\-equiv
844: Permit implicit conversion of \c
845: .B int\c
846: \& to enumeration types (C++
847: only). Normally GNU C++ allows conversion of \c
848: .B enum\c
849: \& to \c
850: .B int\c
851: \&,
852: but not the other way around.
853: .TP
854: .B \-fexternal\-templates
855: Produce smaller code for template declarations, by generating only a
856: single copy of each template function where it is defined (C++ only).
857: To use this option successfully, you must also mark all files that
858: use templates with either `\|\c
859: .B #pragma implementation\c
860: \&\|' (the definition) or
861: `\|\c
862: .B #pragma interface\c
863: \&\|' (declarations).
864:
865: When your code is compiled with `\|\c
866: .B \-fexternal\-templates\c
867: \&\|', all
868: template instantiations are external. You must arrange for all
869: necessary instantiations to appear in the implementation file; you can
870: do this with a \c
871: .B typedef\c
872: \& that references each instantiation needed.
873: Conversely, when you compile using the default option
874: `\|\c
875: .B \-fno\-external\-templates\c
876: \&\|', all template instantiations are
877: explicitly internal.
878: .TP
879: .B \-fall\-virtual
880: Treat all possible member functions as virtual, implicitly. All
881: member functions (except for constructor functions and
882: .B new
883: or
884: .B delete
885: member operators) are treated as virtual functions of the class where
886: they appear.
887: .Sp
888: This does not mean that all calls to these member functions will be
889: made through the internal table of virtual functions. Under some
890: circumstances, the compiler can determine that a call to a given
891: virtual function can be made directly; in these cases the calls are
892: direct in any case.
893: .TP
894: .B \-fcond\-mismatch
895: Allow conditional expressions with mismatched types in the second and
896: third arguments. The value of such an expression is void.
897: .TP
898: .B \-fthis\-is\-variable
899: Permit assignment to \c
900: .B this\c
901: \& (C++ only). The incorporation of
902: user-defined free store management into C++ has made assignment to
903: `\|\c
904: .B this\c
905: \&\|' an anachronism. Therefore, by default it is invalid to
906: assign to \c
907: .B this\c
908: \& within a class member function. However, for
909: backwards compatibility, you can make it valid with
910: `\|\c
911: .B \-fthis-is-variable\c
912: \&\|'.
913: .TP
914: .B \-funsigned\-char
915: Let the type \c
916: .B char\c
917: \& be unsigned, like \c
918: .B unsigned char\c
919: \&.
920: .Sp
921: Each kind of machine has a default for what \c
922: .B char\c
923: \& should
924: be. It is either like \c
925: .B unsigned char\c
926: \& by default or like
927: .B signed char\c
928: \& by default.
929: .Sp
930: Ideally, a portable program should always use \c
931: .B signed char\c
932: \& or
933: .B unsigned char\c
934: \& when it depends on the signedness of an object.
935: But many programs have been written to use plain \c
936: .B char\c
937: \& and
938: expect it to be signed, or expect it to be unsigned, depending on the
939: machines they were written for. This option, and its inverse, let you
940: make such a program work with the opposite default.
941: .Sp
942: The type \c
943: .B char\c
944: \& is always a distinct type from each of
945: .B signed char\c
946: \& and \c
947: .B unsigned char\c
948: \&, even though its behavior
949: is always just like one of those two.
950: .TP
951: .B \-fsigned\-char
952: Let the type \c
953: .B char\c
954: \& be signed, like \c
955: .B signed char\c
956: \&.
957: .Sp
958: Note that this is equivalent to `\|\c
959: .B \-fno\-unsigned\-char\c
960: \&\|', which is
961: the negative form of `\|\c
962: .B \-funsigned\-char\c
963: \&\|'. Likewise,
964: `\|\c
965: .B \-fno\-signed\-char\c
966: \&\|' is equivalent to `\|\c
967: .B \-funsigned\-char\c
968: \&\|'.
969: .TP
970: .B \-fsigned\-bitfields
971: .TP
972: .B \-funsigned\-bitfields
973: .TP
974: .B \-fno\-signed\-bitfields
975: .TP
976: .B \-fno\-unsigned\-bitfields
977: These options control whether a bitfield is
978: signed or unsigned, when declared with no explicit `\|\c
979: .B signed\c
980: \&\|' or `\|\c
981: .B unsigned\c
982: \&\|' qualifier. By default, such a bitfield is
983: signed, because this is consistent: the basic integer types such as
984: .B int\c
985: \& are signed types.
986: .Sp
987: However, when you specify `\|\c
988: .B \-traditional\c
989: \&\|', bitfields are all unsigned
990: no matter what.
991: .TP
992: .B \-fwritable\-strings
993: Store string constants in the writable data segment and don't uniquize
994: them. This is for compatibility with old programs which assume they
995: can write into string constants. `\|\c
996: .B \-traditional\c
997: \&\|' also has this
998: effect.
999: .Sp
1000: Writing into string constants is a very bad idea; \*(lqconstants\*(rq should
1001: be constant.
1002: .SH PREPROCESSOR OPTIONS
1003: These options control the C preprocessor, which is run on each C source
1004: file before actual compilation.
1005: .PP
1006: If you use the `\|\c
1007: .B \-E\c
1008: \&\|' option, GCC does nothing except preprocessing.
1009: Some of these options make sense only together with `\|\c
1010: .B \-E\c
1011: \&\|' because
1012: they cause the preprocessor output to be unsuitable for actual
1013: compilation.
1014: .TP
1015: .BI "\-include " "file"
1016: Process \c
1017: .I file\c
1018: \& as input before processing the regular input file.
1019: In effect, the contents of \c
1020: .I file\c
1021: \& are compiled first. Any `\|\c
1022: .B \-D\c
1023: \&\|'
1024: and `\|\c
1025: .B \-U\c
1026: \&\|' options on the command line are always processed before
1027: `\|\c
1028: .B \-include \c
1029: .I file\c
1030: \&\c
1031: \&\|', regardless of the order in which they are
1032: written. All the `\|\c
1033: .B \-include\c
1034: \&\|' and `\|\c
1035: .B \-imacros\c
1036: \&\|' options are
1037: processed in the order in which they are written.
1038: .TP
1039: .BI "\-imacros " file
1040: Process \c
1041: .I file\c
1042: \& as input, discarding the resulting output, before
1043: processing the regular input file. Because the output generated from
1044: .I file\c
1045: \& is discarded, the only effect of `\|\c
1046: .B \-imacros \c
1047: .I file\c
1048: \&\c
1049: \&\|' is to
1050: make the macros defined in \c
1051: .I file\c
1052: \& available for use in the main
1053: input. The preprocessor evaluates any `\|\c
1054: .B \-D\c
1055: \&\|' and `\|\c
1056: .B \-U\c
1057: \&\|' options
1058: on the command line before processing `\|\c
1059: .B \-imacros\c
1060: .I file\c
1061: \&\|', regardless of the order in
1062: which they are written. All the `\|\c
1063: .B \-include\c
1064: \&\|' and `\|\c
1065: .B \-imacros\c
1066: \&\|'
1067: options are processed in the order in which they are written.
1068: .TP
1069: .BI "\-idirafter " "dir"
1070: Add the directory \c
1071: .I dir\c
1072: \& to the second include path. The directories
1073: on the second include path are searched when a header file is not found
1074: in any of the directories in the main include path (the one that
1075: `\|\c
1076: .B \-I\c
1077: \&\|' adds to).
1078: .TP
1079: .BI "\-iprefix " "prefix"
1080: Specify \c
1081: .I prefix\c
1082: \& as the prefix for subsequent `\|\c
1083: .B \-iwithprefix\c
1084: \&\|'
1085: options.
1086: .TP
1087: .BI "\-iwithprefix " "dir"
1088: Add a directory to the second include path. The directory's name is
1089: made by concatenating \c
1090: .I prefix\c
1091: \& and \c
1092: .I dir\c
1093: \&, where \c
1094: .I prefix
1095: was specified previously with `\|\c
1096: .B \-iprefix\c
1097: \&\|'.
1098: .TP
1099: .B \-nostdinc
1100: Do not search the standard system directories for header files. Only
1101: the directories you have specified with `\|\c
1102: .B \-I\c
1103: \&\|' options (and the
1104: current directory, if appropriate) are searched.
1105: .Sp
1106: By using both `\|\c
1107: .B \-nostdinc\c
1108: \&\|' and `\|\c
1109: .B \-I\-\c
1110: \&\|', you can limit the include-file search file to only those
1111: directories you specify explicitly.
1112: .TP
1113: .B \-nostdinc++
1114: Do not search for header files in the C++\-specific standard directories,
1115: but do still search the other standard directories.
1116: (This option is used when building `\|\c
1117: .B libg++\c
1118: \&\|'.)
1119: .TP
1120: .B \-undef
1121: Do not predefine any nonstandard macros. (Including architecture flags).
1122: .TP
1123: .B \-E
1124: Run only the C preprocessor. Preprocess all the C source files
1125: specified and output the results to standard output or to the
1126: specified output file.
1127: .TP
1128: .B \-C
1129: Tell the preprocessor not to discard comments. Used with the
1130: `\|\c
1131: .B \-E\c
1132: \&\|' option.
1133: .TP
1134: .B \-P
1135: Tell the preprocessor not to generate `\|\c
1136: .B #line\c
1137: \&\|' commands.
1138: Used with the `\|\c
1139: .B \-E\c
1140: \&\|' option.
1141: .TP
1142: .B \-M
1143: Tell the preprocessor to output a rule suitable for \c
1144: .B make
1145: describing the dependencies of each object file. For each source file,
1146: the preprocessor outputs one \c
1147: .B make\c
1148: \&-rule whose target is the object
1149: file name for that source file and whose dependencies are all the files
1150: `\|\c
1151: .B #include\c
1152: \&\|'d in it. This rule may be a single line or may be
1153: continued with `\|\c
1154: .B \e\c
1155: \&\|'-newline if it is long. The list of rules is
1156: printed on standard output instead of the preprocessed C program.
1157: .Sp
1158: `\|\c
1159: .B \-M\c
1160: \&\|' implies `\|\c
1161: .B \-E\c
1162: \&\|'.
1163: .TP
1164: .B \-MM
1165: Like `\|\c
1166: .B \-M\c
1167: \&\|' but the output mentions only the user header files
1168: included with `\|\c
1169: .B #include "\c
1170: .I file\c
1171: \&"\c
1172: \&\|'. System header files
1173: included with `\|\c
1174: .B #include <\c
1175: .I file\c
1176: \&>\c
1177: \&\|' are omitted.
1178: .TP
1179: .B \-MD
1180: Like `\|\c
1181: .B \-M\c
1182: \&\|' but the dependency information is written to files with
1183: names made by replacing `\|\c
1184: .B .o\c
1185: \&\|' with `\|\c
1186: .B .d\c
1187: \&\|' at the end of the
1188: output file names. This is in addition to compiling the file as
1189: specified\(em\&`\|\c
1190: .B \-MD\c
1191: \&\|' does not inhibit ordinary compilation the way
1192: `\|\c
1193: .B \-M\c
1194: \&\|' does.
1195: .Sp
1196: The Mach utility `\|\c
1197: .B md\c
1198: \&\|' can be used to merge the `\|\c
1199: .B .d\c
1200: \&\|' files
1201: into a single dependency file suitable for using with the `\|\c
1202: .B make\c
1203: \&\|'
1204: command.
1205: .TP
1206: .B \-MMD
1207: Like `\|\c
1208: .B \-MD\c
1209: \&\|' except mention only user header files, not system
1210: header files.
1211: .TP
1212: .B \-H
1213: Print the name of each header file used, in addition to other normal
1214: activities.
1215: .TP
1216: .BI "\-A" "question" ( answer )
1217: Assert the answer
1218: .I answer
1219: for
1220: .I question\c
1221: \&, in case it is tested
1222: with a preprocessor conditional such as `\|\c
1223: .BI "#if #" question ( answer )\c
1224: \&\|'. `\|\c
1225: .B \-A\-\c
1226: \&\|' disables the standard
1227: assertions that normally describe the target machine.
1228: .TP
1229: .BI "\-A" "question"\c
1230: \&(\c
1231: .I answer\c
1232: \&)
1233: Assert the answer \c
1234: .I answer\c
1235: \& for \c
1236: .I question\c
1237: \&, in case it is tested
1238: with a preprocessor conditional such as `\|\c
1239: .B #if
1240: #\c
1241: .I question\c
1242: \&(\c
1243: .I answer\c
1244: \&)\c
1245: \&\|'. `\|\c
1246: .B \-A-\c
1247: \&\|' disables the standard
1248: assertions that normally describe the target machine.
1249: .TP
1250: .BI \-D macro
1251: Define macro \c
1252: .I macro\c
1253: \& with the string `\|\c
1254: .B 1\c
1255: \&\|' as its definition.
1256: .TP
1257: .BI \-D macro = defn
1258: Define macro \c
1259: .I macro\c
1260: \& as \c
1261: .I defn\c
1262: \&. All instances of `\|\c
1263: .B \-D\c
1264: \&\|' on
1265: the command line are processed before any `\|\c
1266: .B \-U\c
1267: \&\|' options.
1268: .TP
1269: .BI \-U macro
1270: Undefine macro \c
1271: .I macro\c
1272: \&. `\|\c
1273: .B \-U\c
1274: \&\|' options are evaluated after all `\|\c
1275: .B \-D\c
1276: \&\|' options, but before any `\|\c
1277: .B \-include\c
1278: \&\|' and `\|\c
1279: .B \-imacros\c
1280: \&\|' options.
1281: .TP
1282: .B \-dM
1283: Tell the preprocessor to output only a list of the macro definitions
1284: that are in effect at the end of preprocessing. Used with the `\|\c
1285: .B \-E\c
1286: \&\|'
1287: option.
1288: .TP
1289: .B \-dD
1290: Tell the preprocessor to pass all macro definitions into the output, in
1291: their proper sequence in the rest of the output.
1292: .TP
1293: .B \-dN
1294: Like `\|\c
1295: .B \-dD\c
1296: \&\|' except that the macro arguments and contents are omitted.
1297: Only `\|\c
1298: .B #define \c
1299: .I name\c
1300: \&\c
1301: \&\|' is included in the output.
1302: .SH ASSEMBLER OPTION
1303: .TP
1304: .BI "\-Wa," "option"
1305: Pass \c
1306: .I option\c
1307: \& as an option to the assembler. If \c
1308: .I option
1309: contains commas, it is split into multiple options at the commas.
1310: .SH LINKER OPTIONS
1311: These options come into play when the compiler links object files into
1312: an executable output file. They are meaningless if the compiler is
1313: not doing a link step.
1314: .TP
1315: .I object-file-name
1316: A file name that does not end in a special recognized suffix is
1317: considered to name an object file or library. (Object files are
1318: distinguished from libraries by the linker according to the file
1319: contents.) If GCC does a link step, these object files are used as input
1320: to the linker.
1321: .TP
1322: .BI \-l library
1323: Use the library named \c
1324: .I library\c
1325: \& when linking.
1326: .Sp
1327: The linker searches a standard list of directories for the library,
1328: which is actually a file named `\|\c
1329: .B lib\c
1330: .I library\c
1331: \&.a\c
1332: \&\|'. The linker
1333: then uses this file as if it had been specified precisely by name.
1334: .Sp
1335: The directories searched include several standard system directories
1336: plus any that you specify with `\|\c
1337: .B \-L\c
1338: \&\|'.
1339: .Sp
1340: Normally the files found this way are library files\(em\&archive files
1341: whose members are object files. The linker handles an archive file by
1342: scanning through it for members which define symbols that have so far
1343: been referenced but not defined. However, if the linker finds an
1344: ordinary object file rather than a library, the object file is linked
1345: in the usual fashion. The only difference between using an `\|\c
1346: .B \-l\c
1347: \&\|' option and specifying a file
1348: name is that `\|\c
1349: .B \-l\c
1350: \&\|' surrounds
1351: .I library
1352: with `\|\c
1353: .B lib\c
1354: \&\|' and `\|\c
1355: .B .a\c
1356: \&\|' and searches several directories.
1357: .TP
1358: .B \-lobjc
1359: You need this special case of the
1360: .B \-l
1361: option in order to link an Objective C program.
1362: .TP
1363: .B \-nostartfiles
1364: Do not use the standard system startup files when linking.
1365: The standard libraries are used normally.
1366: .TP
1367: .B \-nostdlib
1368: Don't use the standard system libraries and startup files when linking.
1369: Only the files you specify will be passed to the linker.
1370: .TP
1371: .B \-static
1372: On systems that support dynamic linking, this prevents linking with the shared
1373: libraries. On other systems, this option has no effect.
1374: .TP
1375: .B \-shared
1376: Produce a shared object which can then be linked with other objects to
1377: form an executable. Only a few systems support this option.
1378: .TP
1379: .B \-symbolic
1380: Bind references to global symbols when building a shared object. Warn
1381: about any unresolved references (unless overridden by the link editor
1382: option `\|\c
1383: .B
1384: \-Xlinker \-z \-Xlinker defs\c
1385: \&\|'). Only a few systems support
1386: this option.
1387: .TP
1388: .BI "\-Xlinker " "option"
1389: Pass \c
1390: .I option
1391: as an option to the linker. You can use this to
1392: supply system-specific linker options which GNU CC does not know how to
1393: recognize.
1394: .Sp
1395: If you want to pass an option that takes an argument, you must use
1396: `\|\c
1397: .B \-Xlinker\c
1398: \&\|' twice, once for the option and once for the argument.
1399: For example, to pass `\|\c
1400: .B
1401: \-assert definitions\c
1402: \&\|', you must write
1403: `\|\c
1404: .B
1405: \-Xlinker \-assert \-Xlinker definitions\c
1406: \&\|'. It does not work to write
1407: `\|\c
1408: .B
1409: \-Xlinker "\-assert definitions"\c
1410: \&\|', because this passes the entire
1411: string as a single argument, which is not what the linker expects.
1412: .TP
1413: .BI "\-Wl," "option"
1414: Pass \c
1415: .I option\c
1416: \& as an option to the linker. If \c
1417: .I option\c
1418: \& contains
1419: commas, it is split into multiple options at the commas.
1420: .TP
1421: .BI "\-u " "symbol"
1422: Pretend the symbol
1423: .I symbol
1424: is undefined, to force linking of
1425: library modules to define it. You can use `\|\c
1426: .B \-u\c
1427: \&\|' multiple times with
1428: different symbols to force loading of additional library modules.
1429: .SH DIRECTORY OPTIONS
1430: These options specify directories to search for header files, for
1431: libraries and for parts of the compiler:
1432: .TP
1433: .BI "\-I" "dir"
1434: Append directory \c
1435: .I dir\c
1436: \& to the list of directories searched for include files.
1437: .TP
1438: .B \-I\-
1439: Any directories you specify with `\|\c
1440: .B \-I\c
1441: \&\|' options before the `\|\c
1442: .B \-I\-\c
1443: \&\|'
1444: option are searched only for the case of `\|\c
1445: .B
1446: #include "\c
1447: .I file\c
1448: .B
1449: \&"\c
1450: \&\|';
1451: they are not searched for `\|\c
1452: .B #include <\c
1453: .I file\c
1454: \&>\c
1455: \&\|'.
1456: .Sp
1457: If additional directories are specified with `\|\c
1458: .B \-I\c
1459: \&\|' options after
1460: the `\|\c
1461: .B \-I\-\c
1462: \&\|', these directories are searched for all `\|\c
1463: .B #include\c
1464: \&\|'
1465: directives. (Ordinarily \c
1466: .I all\c
1467: \& `\|\c
1468: .B \-I\c
1469: \&\|' directories are used
1470: this way.)
1471: .Sp
1472: In addition, the `\|\c
1473: .B \-I\-\c
1474: \&\|' option inhibits the use of the current
1475: directory (where the current input file came from) as the first search
1476: directory for `\|\c
1477: .B
1478: #include "\c
1479: .I file\c
1480: .B
1481: \&"\c
1482: \&\|'. There is no way to
1483: override this effect of `\|\c
1484: .B \-I\-\c
1485: \&\|'. With `\|\c
1486: .B \-I.\c
1487: \&\|' you can specify
1488: searching the directory which was current when the compiler was
1489: invoked. That is not exactly the same as what the preprocessor does
1490: by default, but it is often satisfactory.
1491: .Sp
1492: `\|\c
1493: .B \-I\-\c
1494: \&\|' does not inhibit the use of the standard system directories
1495: for header files. Thus, `\|\c
1496: .B \-I\-\c
1497: \&\|' and `\|\c
1498: .B \-nostdinc\c
1499: \&\|' are
1500: independent.
1501: .TP
1502: .BI "\-L" "dir"
1503: Add directory \c
1504: .I dir\c
1505: \& to the list of directories to be searched
1506: for `\|\c
1507: .B \-l\c
1508: \&\|'.
1509: .TP
1510: .BI "\-B" "prefix"
1511: This option specifies where to find the executables, libraries and
1512: data files of the compiler itself.
1513: .Sp
1514: The compiler driver program runs one or more of the subprograms
1515: `\|\c
1516: .B cpp\c
1517: \&\|', `\|\c
1518: .B cc1\c
1519: \&\|' (or, for C++, `\|\c
1520: .B cc1plus\c
1521: \&\|'), `\|\c
1522: .B as\c
1523: \&\|' and `\|\c
1524: .B ld\c
1525: \&\|'. It tries
1526: .I prefix\c
1527: \& as a prefix for each program it tries to run, both with and
1528: without `\|\c
1529: .I machine\c
1530: .B /\c
1531: .I version\c
1532: .B /\c
1533: \&\|'.
1534: .Sp
1535: For each subprogram to be run, the compiler driver first tries the
1536: `\|\c
1537: .B \-B\c
1538: \&\|' prefix, if any. If that name is not found, or if `\|\c
1539: .B \-B\c
1540: \&\|'
1541: was not specified, the driver tries two standard prefixes, which are
1542: `\|\c
1543: .B /usr/lib/gcc/\c
1544: \&\|' and `\|\c
1545: .B /usr/local/lib/gcc-lib/\c
1546: \&\|'. If neither of
1547: those results in a file name that is found, the compiler driver
1548: searches for the unmodified program
1549: name, using the directories specified in your
1550: `\|\c
1551: .B PATH\c
1552: \&\|' environment variable.
1553: .Sp
1554: The run-time support file `\|\c
1555: .B libgcc.a\c
1556: \&\|' is also searched for using the
1557: `\|\c
1558: .B \-B\c
1559: \&\|' prefix, if needed. If it is not found there, the two
1560: standard prefixes above are tried, and that is all. The file is left
1561: out of the link if it is not found by those means. Most of the time,
1562: on most machines, `\|\c
1563: .B libgcc.a\c
1564: \&\|' is not actually necessary.
1565: .Sp
1566: You can get a similar result from the environment variable
1567: .B GCC_EXEC_PREFIX\c
1568: \&; if it is defined, its value is used as a prefix
1569: in the same way. If both the `\|\c
1570: .B \-B\c
1571: \&\|' option and the
1572: .B GCC_EXEC_PREFIX\c
1573: \& variable are present, the `\|\c
1574: .B \-B\c
1575: \&\|' option is
1576: used first and the environment variable value second.
1577: .SH WARNING OPTIONS
1578: Warnings are diagnostic messages that report constructions which
1579: are not inherently erroneous but which are risky or suggest there
1580: may have been an error.
1581: .Sp
1582: These options control the amount and kinds of warnings produced by GNU
1583: CC:
1584: .TP
1585: .B \-fsyntax\-only
1586: Check the code for syntax errors, but don't emit any output.
1587: .TP
1588: .B \-w
1589: Inhibit all warning messages.
1590: .TP
1591: .B \-Wno\-import
1592: Inhibit warning messages about the use of
1593: .BR #import .
1594: .TP
1595: .B \-pedantic
1596: Issue all the warnings demanded by strict ANSI standard C; reject
1597: all programs that use forbidden extensions.
1598: .Sp
1599: Valid ANSI standard C programs should compile properly with or without
1600: this option (though a rare few will require `\|\c
1601: .B \-ansi\c
1602: \&\|'). However,
1603: without this option, certain GNU extensions and traditional C features
1604: are supported as well. With this option, they are rejected. There is
1605: no reason to \c
1606: .I use\c
1607: \& this option; it exists only to satisfy pedants.
1608: .Sp
1609: `\|\c
1610: .B \-pedantic\c
1611: \&\|' does not cause warning messages for use of the
1612: alternate keywords whose names begin and end with `\|\c
1613: .B _\|_\c
1614: \&\|'. Pedantic
1615: warnings are also disabled in the expression that follows
1616: .B _\|_extension_\|_\c
1617: \&. However, only system header files should use
1618: these escape routes; application programs should avoid them.
1619: .TP
1620: .B \-pedantic\-errors
1621: Like `\|\c
1622: .B \-pedantic\c
1623: \&\|', except that errors are produced rather than
1624: warnings.
1625: .TP
1626: .B \-W
1627: Print extra warning messages for these events:
1628: .TP
1629: \ \ \ \(bu
1630: A nonvolatile automatic variable might be changed by a call to
1631: .B longjmp\c
1632: \&. These warnings are possible only in
1633: optimizing compilation.
1634: .Sp
1635: The compiler sees only the calls to \c
1636: .B setjmp\c
1637: \&. It cannot know
1638: where \c
1639: .B longjmp\c
1640: \& will be called; in fact, a signal handler could
1641: call it at any point in the code. As a result, you may get a warning
1642: even when there is in fact no problem because \c
1643: .B longjmp\c
1644: \& cannot
1645: in fact be called at the place which would cause a problem.
1646: .TP
1647: \ \ \ \(bu
1648: A function can return either with or without a value. (Falling
1649: off the end of the function body is considered returning without
1650: a value.) For example, this function would evoke such a
1651: warning:
1652: .Sp
1653: .nf
1654: foo (a)
1655: {
1656: if (a > 0)
1657: return a;
1658: }
1659: .Sp
1660: .fi
1661: Spurious warnings can occur because GNU CC does not realize that
1662: certain functions (including \c
1663: .B abort\c
1664: \& and \c
1665: .B longjmp\c
1666: \&)
1667: will never return.
1668: .TP
1669: \ \ \ \(bu
1670: An expression-statement contains no side effects.
1671: .TP
1672: \ \ \ \(bu
1673: An unsigned value is compared against zero with `\|\c
1674: .B >\c
1675: \&\|' or `\|\c
1676: .B <=\c
1677: \&\|'.
1678: .PP
1679: .TP
1680: .B \-Wimplicit
1681: Warn whenever a function or parameter is implicitly declared.
1682: .TP
1683: .B \-Wreturn\-type
1684: Warn whenever a function is defined with a return-type that defaults
1685: to \c
1686: .B int\c
1687: \&. Also warn about any \c
1688: .B return\c
1689: \& statement with no
1690: return-value in a function whose return-type is not \c
1691: .B void\c
1692: \&.
1693: .TP
1694: .B \-Wunused
1695: Warn whenever a local variable is unused aside from its declaration,
1696: whenever a function is declared static but never defined, and whenever
1697: a statement computes a result that is explicitly not used.
1698: .TP
1699: .B \-Wswitch
1700: Warn whenever a \c
1701: .B switch\c
1702: \& statement has an index of enumeral type
1703: and lacks a \c
1704: .B case\c
1705: \& for one or more of the named codes of that
1706: enumeration. (The presence of a \c
1707: .B default\c
1708: \& label prevents this
1709: warning.) \c
1710: .B case\c
1711: \& labels outside the enumeration range also
1712: provoke warnings when this option is used.
1713: .TP
1714: .B \-Wcomment
1715: Warn whenever a comment-start sequence `\|\c
1716: .B /\(**\c
1717: \&\|' appears in a comment.
1718: .TP
1719: .B \-Wtrigraphs
1720: Warn if any trigraphs are encountered (assuming they are enabled).
1721: .TP
1722: .B \-Wformat
1723: Check calls to \c
1724: .B printf\c
1725: \& and \c
1726: .B scanf\c
1727: \&, etc., to make sure that
1728: the arguments supplied have types appropriate to the format string
1729: specified.
1730: .TP
1731: .B \-Wchar\-subscripts
1732: Warn if an array subscript has type
1733: .BR char .
1734: This is a common cause of error, as programmers often forget that this
1735: type is signed on some machines.
1736: .TP
1737: .B \-Wuninitialized
1738: An automatic variable is used without first being initialized.
1739: .Sp
1740: These warnings are possible only in optimizing compilation,
1741: because they require data flow information that is computed only
1742: when optimizing. If you don't specify `\|\c
1743: .B \-O\c
1744: \&\|', you simply won't
1745: get these warnings.
1746: .Sp
1747: These warnings occur only for variables that are candidates for
1748: register allocation. Therefore, they do not occur for a variable that
1749: is declared \c
1750: .B volatile\c
1751: \&, or whose address is taken, or whose size
1752: is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
1753: structures, unions or arrays, even when they are in registers.
1754: .Sp
1755: Note that there may be no warning about a variable that is used only
1756: to compute a value that itself is never used, because such
1757: computations may be deleted by data flow analysis before the warnings
1758: are printed.
1759: .Sp
1760: These warnings are made optional because GNU CC is not smart
1761: enough to see all the reasons why the code might be correct
1762: despite appearing to have an error. Here is one example of how
1763: this can happen:
1764: .Sp
1765: .nf
1766: {
1767: int x;
1768: switch (y)
1769: {
1770: case 1: x = 1;
1771: break;
1772: case 2: x = 4;
1773: break;
1774: case 3: x = 5;
1775: }
1776: foo (x);
1777: }
1778: .Sp
1779: .fi
1780: If the value of \c
1781: .B y\c
1782: \& is always 1, 2 or 3, then \c
1783: .B x\c
1784: \& is
1785: always initialized, but GNU CC doesn't know this. Here is
1786: another common case:
1787: .Sp
1788: .nf
1789: {
1790: int save_y;
1791: if (change_y) save_y = y, y = new_y;
1792: .\|.\|.
1793: if (change_y) y = save_y;
1794: }
1795: .Sp
1796: .fi
1797: This has no bug because \c
1798: .B save_y\c
1799: \& is used only if it is set.
1800: .Sp
1801: Some spurious warnings can be avoided if you declare as
1802: .B volatile\c
1803: \& all the functions you use that never return.
1804: .TP
1805: .B \-Wparentheses
1806: Warn if parentheses are omitted in certain contexts.
1807: .TP
1808: .B \-Wtemplate\-debugging
1809: When using templates in a C++ program, warn if debugging is not yet
1810: fully available (C++ only).
1811: .TP
1812: .B \-Wall
1813: All of the above `\|\c
1814: .B \-W\c
1815: \&\|' options combined. These are all the
1816: options which pertain to usage that we recommend avoiding and that we
1817: believe is easy to avoid, even in conjunction with macros.
1818: .PP
1819: The remaining `\|\c
1820: .B \-W.\|.\|.\c
1821: \&\|' options are not implied by `\|\c
1822: .B \-Wall\c
1823: \&\|'
1824: because they warn about constructions that we consider reasonable to
1825: use, on occasion, in clean programs.
1826: .TP
1827: .B \-Wtraditional
1828: Warn about certain constructs that behave differently in traditional and
1829: ANSI C.
1830: .TP
1831: \ \ \ \(bu
1832: Macro arguments occurring within string constants in the macro body.
1833: These would substitute the argument in traditional C, but are part of
1834: the constant in ANSI C.
1835: .TP
1836: \ \ \ \(bu
1837: A function declared external in one block and then used after the end of
1838: the block.
1839: .TP
1840: \ \ \ \(bu
1841: A \c
1842: .B switch\c
1843: \& statement has an operand of type \c
1844: .B long\c
1845: \&.
1846: .PP
1847: .TP
1848: .B \-Wshadow
1849: Warn whenever a local variable shadows another local variable.
1850: .TP
1851: .BI "\-Wid\-clash\-" "len"
1852: Warn whenever two distinct identifiers match in the first \c
1853: .I len
1854: characters. This may help you prepare a program that will compile
1855: with certain obsolete, brain-damaged compilers.
1856: .TP
1857: .B \-Wpointer\-arith
1858: Warn about anything that depends on the \*(lqsize of\*(rq a function type or
1859: of \c
1860: .B void\c
1861: \&. GNU C assigns these types a size of 1, for
1862: convenience in calculations with \c
1863: .B void \(**\c
1864: \& pointers and pointers
1865: to functions.
1866: .TP
1867: .B \-Wcast\-qual
1868: Warn whenever a pointer is cast so as to remove a type qualifier from
1869: the target type. For example, warn if a \c
1870: .B const char \(**\c
1871: \& is cast
1872: to an ordinary \c
1873: .B char \(**\c
1874: \&.
1875: .TP
1876: .B \-Wcast\-align
1877: Warn whenever a pointer is cast such that the required alignment of the
1878: target is increased. For example, warn if a \c
1879: .B char \(**\c
1880: \& is cast to
1881: an \c
1882: .B int \(**\c
1883: \& on machines where integers can only be accessed at
1884: two- or four-byte boundaries.
1885: .TP
1886: .B \-Wwrite\-strings
1887: Give string constants the type \c
1888: .B const char[\c
1889: .I length\c
1890: .B ]\c
1891: \& so that
1892: copying the address of one into a non-\c
1893: .B const\c
1894: \& \c
1895: .B char \(**
1896: pointer will get a warning. These warnings will help you find at
1897: compile time code that can try to write into a string constant, but
1898: only if you have been very careful about using \c
1899: .B const\c
1900: \& in
1901: declarations and prototypes. Otherwise, it will just be a nuisance;
1902: this is why we did not make `\|\c
1903: .B \-Wall\c
1904: \&\|' request these warnings.
1905: .TP
1906: .B \-Wconversion
1907: Warn if a prototype causes a type conversion that is different from what
1908: would happen to the same argument in the absence of a prototype. This
1909: includes conversions of fixed point to floating and vice versa, and
1910: conversions changing the width or signedness of a fixed point argument
1911: except when the same as the default promotion.
1912: .TP
1913: .B \-Waggregate\-return
1914: Warn if any functions that return structures or unions are defined or
1915: called. (In languages where you can return an array, this also elicits
1916: a warning.)
1917: .TP
1918: .B \-Wstrict\-prototypes
1919: Warn if a function is declared or defined without specifying the
1920: argument types. (An old-style function definition is permitted without
1921: a warning if preceded by a declaration which specifies the argument
1922: types.)
1923: .TP
1924: .B \-Wmissing\-prototypes
1925: Warn if a global function is defined without a previous prototype
1926: declaration. This warning is issued even if the definition itself
1927: provides a prototype. The aim is to detect global functions that fail
1928: to be declared in header files.
1929: .TP
1930: .B \-Wredundant-decls
1931: Warn if anything is declared more than once in the same scope, even in
1932: cases where multiple declaration is valid and changes nothing.
1933: .TP
1934: .B \-Wnested-externs
1935: Warn if an \c
1936: .B extern\c
1937: \& declaration is encountered within an function.
1938: .TP
1939: .B \-Wenum\-clash
1940: Warn about conversion between different enumeration types (C++ only).
1941: .TP
1942: .B \-Woverloaded\-virtual
1943: (C++ only.)
1944: In a derived class, the definitions of virtual functions must match
1945: the type signature of a virtual function declared in the base class.
1946: Use this option to request warnings when a derived class declares a
1947: function that may be an erroneous attempt to define a virtual
1948: function: that is, warn when a function with the same name as a
1949: virtual function in the base class, but with a type signature that
1950: doesn't match any virtual functions from the base class.
1951: .TP
1952: .B \-Winline
1953: Warn if a function can not be inlined, and either it was declared as inline,
1954: or else the
1955: .B \-finline\-functions
1956: option was given.
1957: .TP
1958: .B \-Werror
1959: Treat warnings as errors; abort compilation after any warning.
1960: .SH DEBUGGING OPTIONS
1961: GNU CC has various special options that are used for debugging
1962: either your program or GCC:
1963: .TP
1964: .B \-g
1965: Produce debugging information in the operating system's native format
1966: (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
1967: information.
1968: .Sp
1969: On most systems that use stabs format, `\|\c
1970: .B \-g\c
1971: \&\|' enables use of extra
1972: debugging information that only GDB can use; this extra information
1973: makes debugging work better in GDB but will probably make other debuggers
1974: crash or
1975: refuse to read the program. If you want to control for certain whether
1976: to generate the extra information, use `\|\c
1977: .B \-gstabs+\c
1978: \&\|', `\|\c
1979: .B \-gstabs\c
1980: \&\|',
1981: `\|\c
1982: .B \-gxcoff+\c
1983: \&\|', `\|\c
1984: .B \-gxcoff\c
1985: \&\|', `\|\c
1986: .B \-gdwarf+\c
1987: \&\|', or `\|\c
1988: .B \-gdwarf\c
1989: \&\|'
1990: (see below).
1991: .Sp
1992: Unlike most other C compilers, GNU CC allows you to use `\|\c
1993: .B \-g\c
1994: \&\|' with
1995: `\|\c
1996: .B \-O\c
1997: \&\|'. The shortcuts taken by optimized code may occasionally
1998: produce surprising results: some variables you declared may not exist
1999: at all; flow of control may briefly move where you did not expect it;
2000: some statements may not be executed because they compute constant
2001: results or their values were already at hand; some statements may
2002: execute in different places because they were moved out of loops.
2003: .Sp
2004: Nevertheless it proves possible to debug optimized output. This makes
2005: it reasonable to use the optimizer for programs that might have bugs.
2006: .PP
2007: The following options are useful when GNU CC is generated with the
2008: capability for more than one debugging format.
2009: .TP
2010: .B \-ggdb
2011: Produce debugging information in the native format (if that is supported),
2012: including GDB extensions if at all possible.
2013: .TP
2014: .B \-gstabs
2015: Produce debugging information in stabs format (if that is supported),
2016: without GDB extensions. This is the format used by DBX on most BSD
2017: systems.
2018: .TP
2019: .B \-gstabs+
2020: Produce debugging information in stabs format (if that is supported),
2021: using GNU extensions understood only by the GNU debugger (GDB). The
2022: use of these extensions is likely to make other debuggers crash or
2023: refuse to read the program.
2024: .TP
2025: .B \-gcoff
2026: Produce debugging information in COFF format (if that is supported).
2027: This is the format used by SDB on most System V systems prior to
2028: System V Release 4.
2029: .TP
2030: .B \-gxcoff
2031: Produce debugging information in XCOFF format (if that is supported).
2032: This is the format used by the DBX debugger on IBM RS/6000 systems.
2033: .TP
2034: .B \-gxcoff+
2035: Produce debugging information in XCOFF format (if that is supported),
2036: using GNU extensions understood only by the GNU debugger (GDB). The
2037: use of these extensions is likely to make other debuggers crash or
2038: refuse to read the program.
2039: .TP
2040: .B \-gdwarf
2041: Produce debugging information in DWARF format (if that is supported).
2042: This is the format used by SDB on most System V Release 4 systems.
2043: .TP
2044: .B \-gdwarf+
2045: Produce debugging information in DWARF format (if that is supported),
2046: using GNU extensions understood only by the GNU debugger (GDB). The
2047: use of these extensions is likely to make other debuggers crash or
2048: refuse to read the program.
2049: .PP
2050: .BI "\-g" "level"
2051: .br
2052: .BI "\-ggdb" "level"
2053: .br
2054: .BI "\-gstabs" "level"
2055: .br
2056: .BI "\-gcoff" "level"
2057: .BI "\-gxcoff" "level"
2058: .TP
2059: .BI "\-gdwarf" "level"
2060: Request debugging information and also use \c
2061: .I level\c
2062: \& to specify how
2063: much information. The default level is 2.
2064: .Sp
2065: Level 1 produces minimal information, enough for making backtraces in
2066: parts of the program that you don't plan to debug. This includes
2067: descriptions of functions and external variables, but no information
2068: about local variables and no line numbers.
2069: .Sp
2070: Level 3 includes extra information, such as all the macro definitions
2071: present in the program. Some debuggers support macro expansion when
2072: you use `\|\c
2073: .B \-g3\c
2074: \&\|'.
2075: .TP
2076: .B \-p
2077: Generate extra code to write profile information suitable for the
2078: analysis program \c
2079: .B prof\c
2080: \&.
2081: .TP
2082: .B \-pg
2083: Generate extra code to write profile information suitable for the
2084: analysis program \c
2085: .B gprof\c
2086: \&.
2087: .TP
2088: .B \-a
2089: Generate extra code to write profile information for basic blocks,
2090: which will record the number of times each basic block is executed.
2091: This data could be analyzed by a program like \c
2092: .B tcov\c
2093: \&. Note,
2094: however, that the format of the data is not what \c
2095: .B tcov\c
2096: \& expects.
2097: Eventually GNU \c
2098: .B gprof\c
2099: \& should be extended to process this data.
2100: .TP
2101: .BI "\-d" "letters"
2102: Says to make debugging dumps during compilation at times specified by
2103: .I letters\c
2104: \&. This is used for debugging the compiler. The file names
2105: for most of the dumps are made by appending a word to the source file
2106: name (e.g. `\|\c
2107: .B foo.c.rtl\c
2108: \&\|' or `\|\c
2109: .B foo.c.jump\c
2110: \&\|').
2111: .TP
2112: .B \-dM
2113: Dump all macro definitions, at the end of preprocessing, and write no
2114: output.
2115: .TP
2116: .B \-dN
2117: Dump all macro names, at the end of preprocessing.
2118: .TP
2119: .B \-dD
2120: Dump all macro definitions, at the end of preprocessing, in addition to
2121: normal output.
2122: .TP
2123: .B \-dy
2124: Dump debugging information during parsing, to standard error.
2125: .TP
2126: .B \-dr
2127: Dump after RTL generation, to `\|\c
2128: .I file\c
2129: .B \&.rtl\c
2130: \&\|'.
2131: .TP
2132: .B \-dx
2133: Just generate RTL for a function instead of compiling it. Usually used
2134: with `\|\c
2135: .B r\c
2136: \&\|'.
2137: .TP
2138: .B \-dj
2139: Dump after first jump optimization, to `\|\c
2140: .I file\c
2141: .B \&.jump\c
2142: \&\|'.
2143: .TP
2144: .B \-ds
2145: Dump after CSE (including the jump optimization that sometimes
2146: follows CSE), to `\|\c
2147: .I file\c
2148: .B \&.cse\c
2149: \&\|'.
2150: .TP
2151: .B \-dL
2152: Dump after loop optimization, to `\|\c
2153: .I file\c
2154: .B \&.loop\c
2155: \&\|'.
2156: .TP
2157: .B \-dt
2158: Dump after the second CSE pass (including the jump optimization that
2159: sometimes follows CSE), to `\|\c
2160: .I file\c
2161: .B \&.cse2\c
2162: \&\|'.
2163: .TP
2164: .B \-df
2165: Dump after flow analysis, to `\|\c
2166: .I file\c
2167: .B \&.flow\c
2168: \&\|'.
2169: .TP
2170: .B \-dc
2171: Dump after instruction combination, to `\|\c
2172: .I file\c
2173: .B \&.combine\c
2174: \&\|'.
2175: .TP
2176: .B \-dS
2177: Dump after the first instruction scheduling pass, to
2178: `\|\c
2179: .I file\c
2180: .B \&.sched\c
2181: \&\|'.
2182: .TP
2183: .B \-dl
2184: Dump after local register allocation, to `\|\c
2185: .I file\c
2186: .B \&.lreg\c
2187: \&\|'.
2188: .TP
2189: .B \-dg
2190: Dump after global register allocation, to `\|\c
2191: .I file\c
2192: .B \&.greg\c
2193: \&\|'.
2194: .TP
2195: .B \-dR
2196: Dump after the second instruction scheduling pass, to
2197: `\|\c
2198: .I file\c
2199: .B \&.sched2\c
2200: \&\|'.
2201: .TP
2202: .B \-dJ
2203: Dump after last jump optimization, to `\|\c
2204: .I file\c
2205: .B \&.jump2\c
2206: \&\|'.
2207: .TP
2208: .B \-dd
2209: Dump after delayed branch scheduling, to `\|\c
2210: .I file\c
2211: .B \&.dbr\c
2212: \&\|'.
2213: .TP
2214: .B \-dk
2215: Dump after conversion from registers to stack, to `\|\c
2216: .I file\c
2217: .B \&.stack\c
2218: \&\|'.
2219: .TP
2220: .B \-da
2221: Produce all the dumps listed above.
2222: .TP
2223: .B \-dm
2224: Print statistics on memory usage, at the end of the run, to
2225: standard error.
2226: .TP
2227: .B \-dp
2228: Annotate the assembler output with a comment indicating which
2229: pattern and alternative was used.
2230: .TP
2231: .B \-fpretend\-float
2232: When running a cross-compiler, pretend that the target machine uses the
2233: same floating point format as the host machine. This causes incorrect
2234: output of the actual floating constants, but the actual instruction
2235: sequence will probably be the same as GNU CC would make when running on
2236: the target machine.
2237: .TP
2238: .B \-save\-temps
2239: Store the usual \*(lqtemporary\*(rq intermediate files permanently; place them
2240: in the current directory and name them based on the source file. Thus,
2241: compiling `\|\c
2242: .B foo.c\c
2243: \&\|' with `\|\c
2244: .B \-c \-save\-temps\c
2245: \&\|' would produce files
2246: `\|\c
2247: .B foo.cpp\c
2248: \&\|' and `\|\c
2249: .B foo.s\c
2250: \&\|', as well as `\|\c
2251: .B foo.o\c
2252: \&\|'.
2253: .TP
2254: .B \-print\-libgcc\-file\-name
2255: Print the full absolute name of the library file `\|\c
2256: .B libgcc.a\c
2257: \&\|' that
2258: would be used when linking\(em\&and do not do anything else. With this
2259: option, GNU CC does not compile or link anything; it just prints the
2260: file name.
2261: .SH OPTIMIZATION OPTIONS
2262: These options control various sorts of optimizations:
2263: .TP
2264: .B \-O
2265: .TP
2266: .B \-O1
2267: Optimize. Optimizing compilation takes somewhat more time, and a lot
2268: more memory for a large function.
2269: .Sp
2270: Without `\|\c
2271: .B \-O\c
2272: \&\|', the compiler's goal is to reduce the cost of
2273: compilation and to make debugging produce the expected results.
2274: Statements are independent: if you stop the program with a breakpoint
2275: between statements, you can then assign a new value to any variable or
2276: change the program counter to any other statement in the function and
2277: get exactly the results you would expect from the source code.
2278: .Sp
2279: Without `\|\c
2280: .B \-O\c
2281: \&\|', only variables declared \c
2282: .B register\c
2283: \& are
2284: allocated in registers. The resulting compiled code is a little worse
2285: than produced by PCC without `\|\c
2286: .B \-O\c
2287: \&\|'.
2288: .Sp
2289: With `\|\c
2290: .B \-O\c
2291: \&\|', the compiler tries to reduce code size and execution
2292: time.
2293: .Sp
2294: When you specify `\|\c
2295: .B \-O\c
2296: \&\|', `\|\c
2297: .B \-fthread\-jumps\c
2298: \&\|' and
2299: `\|\c
2300: .B \-fdelayed\-branch\c
2301: \&\|' are turned on. On some machines other
2302: flags may also be turned on.
2303: .TP
2304: .B \-O2
2305: Optimize even more. Nearly all supported optimizations that do not
2306: involve a space-speed tradeoff are performed. As compared to
2307: .B \-O\c
2308: \&,
2309: this option increases both compilation time and the performance of the
2310: generated code.
2311: .Sp
2312: .B \-O2
2313: turns on all
2314: .BI \-f flag
2315: options that enable more optimization, except for
2316: .B \-funroll\-loops\c
2317: \&,
2318: .B \-funroll\-all\-loops
2319: and
2320: .BR \-fomit\-frame\-pointer .
2321: .TP
2322: .B \-O0
2323: Do not optimize.
2324: .Sp
2325: If you use multiple
2326: .B \-O
2327: options, with or without level numbers, the last such option is the
2328: one that is effective.
2329: .PP
2330: Options of the form `\|\c
2331: .B \-f\c
2332: .I flag\c
2333: \&\c
2334: \&\|' specify machine-independent
2335: flags. Most flags have both positive and negative forms; the negative
2336: form of `\|\c
2337: .B \-ffoo\c
2338: \&\|' would be `\|\c
2339: .B \-fno\-foo\c
2340: \&\|'. The following list shows
2341: only one form\(em\&the one which is not the default.
2342: You can figure out the other form by either removing `\|\c
2343: .B no\-\c
2344: \&\|' or
2345: adding it.
2346: .TP
2347: .B \-ffloat\-store
2348: Do not store floating point variables in registers. This
2349: prevents undesirable excess precision on machines such as the
2350: 68000 where the floating registers (of the 68881) keep more
2351: precision than a \c
2352: .B double\c
2353: \& is supposed to have.
2354: .Sp
2355: For most programs, the excess precision does only good, but a few
2356: programs rely on the precise definition of IEEE floating point.
2357: Use `\|\c
2358: .B \-ffloat\-store\c
2359: \&\|' for such programs.
2360: .TP
2361: .B \-fmemoize\-lookups
2362: .TP
2363: .B \-fsave\-memoized
2364: Use heuristics to compile faster (C++ only). These heuristics are not
2365: enabled by default, since they are only effective for certain input
2366: files. Other input files compile more slowly.
2367: .Sp
2368: The first time the compiler must build a call to a member function (or
2369: reference to a data member), it must (1) determine whether the class
2370: implements member functions of that name; (2) resolve which member
2371: function to call (which involves figuring out what sorts of type
2372: conversions need to be made); and (3) check the visibility of the member
2373: function to the caller. All of this adds up to slower compilation.
2374: Normally, the second time a call is made to that member function (or
2375: reference to that data member), it must go through the same lengthy
2376: process again. This means that code like this
2377: .Sp
2378: \& cout << "This " << p << " has " << n << " legs.\en";
2379: .Sp
2380: makes six passes through all three steps. By using a software cache,
2381: a \*(lqhit\*(rq significantly reduces this cost. Unfortunately, using the
2382: cache introduces another layer of mechanisms which must be implemented,
2383: and so incurs its own overhead. `\|\c
2384: .B \-fmemoize\-lookups\c
2385: \&\|' enables
2386: the software cache.
2387: .Sp
2388: Because access privileges (visibility) to members and member functions
2389: may differ from one function context to the next,
2390: .B g++
2391: may need to flush the cache. With the `\|\c
2392: .B \-fmemoize\-lookups\c
2393: \&\|' flag, the cache is flushed after every
2394: function that is compiled. The `\|\c
2395: \-fsave\-memoized\c
2396: \&\|' flag enables the same software cache, but when the compiler
2397: determines that the context of the last function compiled would yield
2398: the same access privileges of the next function to compile, it
2399: preserves the cache.
2400: This is most helpful when defining many member functions for the same
2401: class: with the exception of member functions which are friends of
2402: other classes, each member function has exactly the same access
2403: privileges as every other, and the cache need not be flushed.
2404: .TP
2405: .B \-fno\-default\-inline
2406: Don't make member functions inline by default merely because they are
2407: defined inside the class scope (C++ only).
2408: .TP
2409: .B \-fno\-defer\-pop
2410: Always pop the arguments to each function call as soon as that
2411: function returns. For machines which must pop arguments after a
2412: function call, the compiler normally lets arguments accumulate on the
2413: stack for several function calls and pops them all at once.
2414: .TP
2415: .B \-fforce\-mem
2416: Force memory operands to be copied into registers before doing
2417: arithmetic on them. This may produce better code by making all
2418: memory references potential common subexpressions. When they are
2419: not common subexpressions, instruction combination should
2420: eliminate the separate register-load. I am interested in hearing
2421: about the difference this makes.
2422: .TP
2423: .B \-fforce\-addr
2424: Force memory address constants to be copied into registers before
2425: doing arithmetic on them. This may produce better code just as
2426: `\|\c
2427: .B \-fforce\-mem\c
2428: \&\|' may. I am interested in hearing about the
2429: difference this makes.
2430: .TP
2431: .B \-fomit\-frame\-pointer
2432: Don't keep the frame pointer in a register for functions that
2433: don't need one. This avoids the instructions to save, set up and
2434: restore frame pointers; it also makes an extra register available
2435: in many functions. \c
2436: .I It also makes debugging impossible on
2437: most machines.
2438: .Sp
2439: On some machines, such as the Vax, this flag has no effect, because
2440: the standard calling sequence automatically handles the frame pointer
2441: and nothing is saved by pretending it doesn't exist. The
2442: machine-description macro \c
2443: .B FRAME_POINTER_REQUIRED\c
2444: \& controls
2445: whether a target machine supports this flag.
2446: .TP
2447: .B \-finline\-functions
2448: Integrate all simple functions into their callers. The compiler
2449: heuristically decides which functions are simple enough to be worth
2450: integrating in this way.
2451: .Sp
2452: If all calls to a given function are integrated, and the function is
2453: declared \c
2454: .B static\c
2455: \&, then GCC normally does not output the function as
2456: assembler code in its own right.
2457: .TP
2458: .B \-fcaller\-saves
2459: Enable values to be allocated in registers that will be clobbered by
2460: function calls, by emitting extra instructions to save and restore the
2461: registers around such calls. Such allocation is done only when it
2462: seems to result in better code than would otherwise be produced.
2463: .Sp
2464: This option is enabled by default on certain machines, usually those
2465: which have no call-preserved registers to use instead.
2466: .TP
2467: .B \-fkeep\-inline\-functions
2468: Even if all calls to a given function are integrated, and the function
2469: is declared \c
2470: .B static\c
2471: \&, nevertheless output a separate run-time
2472: callable version of the function.
2473: .TP
2474: .B \-fno\-function\-cse
2475: Do not put function addresses in registers; make each instruction that
2476: calls a constant function contain the function's address explicitly.
2477: .Sp
2478: This option results in less efficient code, but some strange hacks
2479: that alter the assembler output may be confused by the optimizations
2480: performed when this option is not used.
2481: .TP
2482: .B \-fno\-peephole
2483: Disable any machine-specific peephole optimizations.
2484: .TP
2485: .B \-ffast-math
2486: This option allows GCC to violate some ANSI or IEEE rules/specifications
2487: in the interest of optimizing code for speed. For example, it allows
2488: the compiler to assume arguments to the \c
2489: .B sqrt\c
2490: \& function are
2491: non-negative numbers.
2492: .Sp
2493: This option should never be turned on by any `\|\c
2494: .B \-O\c
2495: \&\|' option since
2496: it can result in incorrect output for programs which depend on
2497: an exact implementation of IEEE or ANSI rules/specifications for
2498: math functions.
2499: .PP
2500: The following options control specific optimizations. The `\|\c
2501: .B \-O2\c
2502: \&\|'
2503: option turns on all of these optimizations except `\|\c
2504: .B \-funroll\-loops\c
2505: \&\|'
2506: and `\|\c
2507: .B \-funroll\-all\-loops\c
2508: \&\|'.
2509: .PP
2510: The `\|\c
2511: .B \-O\c
2512: \&\|' option usually turns on
2513: the `\|\c
2514: .B \-fthread\-jumps\c
2515: \&\|' and `\|\c
2516: .B \-fdelayed\-branch\c
2517: \&\|' options, but
2518: specific machines may change the default optimizations.
2519: .PP
2520: You can use the following flags in the rare cases when \*(lqfine-tuning\*(rq
2521: of optimizations to be performed is desired.
2522: .TP
2523: .B \-fstrength\-reduce
2524: Perform the optimizations of loop strength reduction and
2525: elimination of iteration variables.
2526: .TP
2527: .B \-fthread\-jumps
2528: Perform optimizations where we check to see if a jump branches to a
2529: location where another comparison subsumed by the first is found. If
2530: so, the first branch is redirected to either the destination of the
2531: second branch or a point immediately following it, depending on whether
2532: the condition is known to be true or false.
2533: .TP
2534: .B \-funroll\-loops
2535: Perform the optimization of loop unrolling. This is only done for loops
2536: whose number of iterations can be determined at compile time or run time.
2537: .TP
2538: .B \-funroll\-all\-loops
2539: Perform the optimization of loop unrolling. This is done for all loops.
2540: This usually makes programs run more slowly.
2541: .TP
2542: .B \-fcse\-follow\-jumps
2543: In common subexpression elimination, scan through jump instructions
2544: when the target of the jump is not reached by any other path. For
2545: example, when CSE encounters an \c
2546: .B if\c
2547: \& statement with an
2548: .B else\c
2549: \& clause, CSE will follow the jump when the condition
2550: tested is false.
2551: .TP
2552: .B \-fcse\-skip\-blocks
2553: This is similar to `\|\c
2554: .B \-fcse\-follow\-jumps\c
2555: \&\|', but causes CSE to
2556: follow jumps which conditionally skip over blocks. When CSE
2557: encounters a simple \c
2558: .B if\c
2559: \& statement with no else clause,
2560: `\|\c
2561: .B \-fcse\-skip\-blocks\c
2562: \&\|' causes CSE to follow the jump around the
2563: body of the \c
2564: .B if\c
2565: \&.
2566: .TP
2567: .B \-frerun\-cse\-after\-loop
2568: Re-run common subexpression elimination after loop optimizations has been
2569: performed.
2570: .TP
2571: .B \-felide\-constructors
2572: Elide constructors when this seems plausible (C++ only). With this
2573: flag, GNU C++ initializes \c
2574: .B y\c
2575: \& directly from the call to \c
2576: .B foo
2577: without going through a temporary in the following code:
2578: .Sp
2579: A foo ();
2580: A y = foo ();
2581: .Sp
2582: Without this option, GNU C++ first initializes \c
2583: .B y\c
2584: \& by calling the
2585: appropriate constructor for type \c
2586: .B A\c
2587: \&; then assigns the result of
2588: .B foo\c
2589: \& to a temporary; and, finally, replaces the initial valyue of
2590: `\|\c
2591: .B y\c
2592: \&\|' with the temporary.
2593: .Sp
2594: The default behavior (`\|\c
2595: .B \-fno\-elide\-constructors\c
2596: \&\|') is specified by
2597: the draft ANSI C++ standard. If your program's constructors have side
2598: effects, using `\|\c
2599: .B \-felide-constructors\c
2600: \&\|' can make your program act
2601: differently, since some constructor calls may be omitted.
2602: .TP
2603: .B \-fexpensive\-optimizations
2604: Perform a number of minor optimizations that are relatively expensive.
2605: .TP
2606: .B \-fdelayed\-branch
2607: If supported for the target machine, attempt to reorder instructions
2608: to exploit instruction slots available after delayed branch
2609: instructions.
2610: .TP
2611: .B \-fschedule\-insns
2612: If supported for the target machine, attempt to reorder instructions to
2613: eliminate execution stalls due to required data being unavailable. This
2614: helps machines that have slow floating point or memory load instructions
2615: by allowing other instructions to be issued until the result of the load
2616: or floating point instruction is required.
2617: .TP
2618: .B \-fschedule\-insns2
2619: Similar to `\|\c
2620: .B \-fschedule\-insns\c
2621: \&\|', but requests an additional pass of
2622: instruction scheduling after register allocation has been done. This is
2623: especially useful on machines with a relatively small number of
2624: registers and where memory load instructions take more than one cycle.
2625: .SH TARGET OPTIONS
2626: By default, GNU CC compiles code for the same type of machine that you
2627: are using. However, it can also be installed as a cross-compiler, to
2628: compile for some other type of machine. In fact, several different
2629: configurations of GNU CC, for different target machines, can be
2630: installed side by side. Then you specify which one to use with the
2631: `\|\c
2632: .B \-b\c
2633: \&\|' option.
2634: .PP
2635: In addition, older and newer versions of GNU CC can be installed side
2636: by side. One of them (probably the newest) will be the default, but
2637: you may sometimes wish to use another.
2638: .TP
2639: .BI "\-b " "machine"
2640: The argument \c
2641: .I machine\c
2642: \& specifies the target machine for compilation.
2643: This is useful when you have installed GNU CC as a cross-compiler.
2644: .Sp
2645: The value to use for \c
2646: .I machine\c
2647: \& is the same as was specified as the
2648: machine type when configuring GNU CC as a cross-compiler. For
2649: example, if a cross-compiler was configured with `\|\c
2650: .B configure
2651: i386v\c
2652: \&\|', meaning to compile for an 80386 running System V, then you
2653: would specify `\|\c
2654: .B \-b i386v\c
2655: \&\|' to run that cross compiler.
2656: .Sp
2657: When you do not specify `\|\c
2658: .B \-b\c
2659: \&\|', it normally means to compile for
2660: the same type of machine that you are using.
2661: .TP
2662: .BI "\-V " "version"
2663: The argument \c
2664: .I version\c
2665: \& specifies which version of GNU CC to run.
2666: This is useful when multiple versions are installed. For example,
2667: .I version\c
2668: \& might be `\|\c
2669: .B 2.0\c
2670: \&\|', meaning to run GNU CC version 2.0.
2671: .Sp
2672: The default version, when you do not specify `\|\c
2673: .B \-V\c
2674: \&\|', is controlled
2675: by the way GNU CC is installed. Normally, it will be a version that
2676: is recommended for general use.
2677: .SH MACHINE DEPENDENT OPTIONS
2678: Each of the target machine types can have its own special options,
2679: starting with `\|\c
2680: .B \-m\c
2681: \&\|', to choose among various hardware models or
2682: configurations\(em\&for example, 68010 vs 68020, floating coprocessor or
2683: none. A single installed version of the compiler can compile for any
2684: model or configuration, according to the options specified.
2685: .PP
2686: Some configurations of the compiler also support additional special
2687: options, usually for command-line compatibility with other compilers on
2688: the same platform.
2689: .PP
2690: These are the `\|\c
2691: .B \-m\c
2692: \&\|' options defined for the 68000 series:
2693: .TP
2694: .B \-m68000
2695: .TP
2696: .B \-mc68000
2697: Generate output for a 68000. This is the default when the compiler is
2698: configured for 68000-based systems.
2699: .TP
2700: .B \-m68020
2701: .TP
2702: .B \-mc68020
2703: Generate output for a 68020 (rather than a 68000). This is the
2704: default when the compiler is configured for 68020-based systems.
2705: .TP
2706: .B \-m68881
2707: Generate output containing 68881 instructions for floating point.
2708: This is the default for most 68020-based systems unless
2709: .B \-nfp
2710: was specified when the compiler was configured.
2711: .TP
2712: .B \-m68030
2713: Generate output for a 68030. This is the default when the compiler is
2714: configured for 68030-based systems.
2715: .TP
2716: .B \-m68040
2717: Generate output for a 68040. This is the default when the compiler is
2718: configured for 68040-based systems.
2719: .TP
2720: .B \-m68020\-40
2721: Generate output for a 68040, without using any of the new instructions.
2722: This results in code which can run relatively efficiently on either a
2723: 68020/68881 or a 68030 or a 68040.
2724: .TP
2725: .B \-mfpa
2726: Generate output containing Sun FPA instructions for floating point.
2727: .TP
2728: .B \-msoft\-float
2729: Generate output containing library calls for floating point.
2730: .I
2731: WARNING:
2732: the requisite libraries are not part of GNU CC. Normally the
2733: facilities of the machine's usual C compiler are used, but this can't
2734: be done directly in cross-compilation. You must make your own
2735: arrangements to provide suitable library functions for cross-compilation.
2736: .TP
2737: .B \-mshort
2738: Consider type \c
2739: .B int\c
2740: \& to be 16 bits wide, like \c
2741: .B short int\c
2742: \&.
2743: .TP
2744: .B \-mnobitfield
2745: Do not use the bit-field instructions. `\|\c
2746: .B \-m68000\c
2747: \&\|' implies
2748: `\|\c
2749: .B \-mnobitfield\c
2750: \&\|'.
2751: .TP
2752: .B \-mbitfield
2753: Do use the bit-field instructions. `\|\c
2754: .B \-m68020\c
2755: \&\|' implies
2756: `\|\c
2757: .B \-mbitfield\c
2758: \&\|'. This is the default if you use the unmodified
2759: sources.
2760: .TP
2761: .B \-mrtd
2762: Use a different function-calling convention, in which functions
2763: that take a fixed number of arguments return with the \c
2764: .B rtd
2765: instruction, which pops their arguments while returning. This
2766: saves one instruction in the caller since there is no need to pop
2767: the arguments there.
2768: .Sp
2769: This calling convention is incompatible with the one normally
2770: used on Unix, so you cannot use it if you need to call libraries
2771: compiled with the Unix compiler.
2772: .Sp
2773: Also, you must provide function prototypes for all functions that
2774: take variable numbers of arguments (including \c
2775: .B printf\c
2776: \&);
2777: otherwise incorrect code will be generated for calls to those
2778: functions.
2779: .Sp
2780: In addition, seriously incorrect code will result if you call a
2781: function with too many arguments. (Normally, extra arguments are
2782: harmlessly ignored.)
2783: .Sp
2784: The \c
2785: .B rtd\c
2786: \& instruction is supported by the 68010 and 68020
2787: processors, but not by the 68000.
2788: .PP
2789: These `\|\c
2790: .B \-m\c
2791: \&\|' options are defined for the Vax:
2792: .TP
2793: .B \-munix
2794: Do not output certain jump instructions (\c
2795: .B aobleq\c
2796: \& and so on)
2797: that the Unix assembler for the Vax cannot handle across long
2798: ranges.
2799: .TP
2800: .B \-mgnu
2801: Do output those jump instructions, on the assumption that you
2802: will assemble with the GNU assembler.
2803: .TP
2804: .B \-mg
2805: Output code for g-format floating point numbers instead of d-format.
2806: .PP
2807: These `\|\c
2808: .B \-m\c
2809: \&\|' switches are supported on the SPARC:
2810: .PP
2811: .B \-mfpu
2812: .TP
2813: .B \-mhard\-float
2814: Generate output containing floating point instructions. This is the
2815: default.
2816: .PP
2817: .B \-mno\-fpu
2818: .TP
2819: .B \-msoft\-float
2820: Generate output containing library calls for floating point.
2821: .I Warning:
2822: there is no GNU floating-point library for SPARC.
2823: Normally the facilities of the machine's usual C compiler are used, but
2824: this cannot be done directly in cross-compilation. You must make your
2825: own arrangements to provide suitable library functions for
2826: cross-compilation.
2827: .Sp
2828: .B \-msoft\-float
2829: changes the calling convention in the output file;
2830: therefore, it is only useful if you compile
2831: .I all
2832: of a program with this option.
2833: .PP
2834: .B \-mno\-epilogue
2835: .TP
2836: .B \-mepilogue
2837: With
2838: .B \-mepilogue
2839: (the default), the compiler always emits code for
2840: function exit at the end of each function. Any function exit in
2841: the middle of the function (such as a return statement in C) will
2842: generate a jump to the exit code at the end of the function.
2843: .Sp
2844: With
2845: .BR \-mno\-epilogue ,
2846: the compiler tries to emit exit code inline at every function exit.
2847: .PP
2848: .B \-mv8
2849: .TP
2850: .B \-msparclite
2851: These two options select variations on the SPARC architecture.
2852: .Sp
2853: By default (unless specifically configured for the Fujitsu SPARClite),
2854: GCC generates code for the v7 variant of the SPARC architecture.
2855: .Sp
2856: .B \-mv8
2857: will give you SPARC v8 code. The only difference from v7
2858: code is that the compiler emits the integer multiply and integer
2859: divide instructions which exist in SPARC v8 but not in SPARC v7.
2860: .Sp
2861: .B \-msparclite
2862: will give you SPARClite code. This adds the integer
2863: multiply, integer divide step and scan (ffs) instructions which
2864: exist in SPARClite but not in SPARC v7.
2865: .PP
2866: These `\|\c
2867: .B \-m\c
2868: \&\|' options are defined for the Convex:
2869: .TP
2870: .B \-mc1
2871: Generate output for a C1. This is the default when the compiler is
2872: configured for a C1.
2873: .TP
2874: .B \-mc2
2875: Generate output for a C2. This is the default when the compiler is
2876: configured for a C2.
2877: .TP
2878: .B \-margcount
2879: Generate code which puts an argument count in the word preceding each
2880: argument list. Some nonportable Convex and Vax programs need this word.
2881: (Debuggers don't, except for functions with variable-length argument
2882: lists; this info is in the symbol table.)
2883: .TP
2884: .B \-mnoargcount
2885: Omit the argument count word. This is the default if you use the
2886: unmodified sources.
2887: .PP
2888: These `\|\c
2889: .B \-m\c
2890: \&\|' options are defined for the AMD Am29000:
2891: .TP
2892: .B \-mdw
2893: Generate code that assumes the DW bit is set, i.e., that byte and
2894: halfword operations are directly supported by the hardware. This is the
2895: default.
2896: .TP
2897: .B \-mnodw
2898: Generate code that assumes the DW bit is not set.
2899: .TP
2900: .B \-mbw
2901: Generate code that assumes the system supports byte and halfword write
2902: operations. This is the default.
2903: .TP
2904: .B \-mnbw
2905: Generate code that assumes the systems does not support byte and
2906: halfword write operations. This implies `\|\c
2907: .B \-mnodw\c
2908: \&\|'.
2909: .TP
2910: .B \-msmall
2911: Use a small memory model that assumes that all function addresses are
2912: either within a single 256 KB segment or at an absolute address of less
2913: than 256K. This allows the \c
2914: .B call\c
2915: \& instruction to be used instead
2916: of a \c
2917: .B const\c
2918: \&, \c
2919: .B consth\c
2920: \&, \c
2921: .B calli\c
2922: \& sequence.
2923: .TP
2924: .B \-mlarge
2925: Do not assume that the \c
2926: .B call\c
2927: \& instruction can be used; this is the
2928: default.
2929: .TP
2930: .B \-m29050
2931: Generate code for the Am29050.
2932: .TP
2933: .B \-m29000
2934: Generate code for the Am29000. This is the default.
2935: .TP
2936: .B \-mkernel\-registers
2937: Generate references to registers \c
2938: .B gr64-gr95\c
2939: \& instead of
2940: .B gr96-gr127\c
2941: \&. This option can be used when compiling kernel code
2942: that wants a set of global registers disjoint from that used by
2943: user-mode code.
2944: .Sp
2945: Note that when this option is used, register names in `\|\c
2946: .B \-f\c
2947: \&\|' flags
2948: must use the normal, user-mode, names.
2949: .TP
2950: .B \-muser\-registers
2951: Use the normal set of global registers, \c
2952: .B gr96-gr127\c
2953: \&. This is the
2954: default.
2955: .TP
2956: .B \-mstack\-check
2957: Insert a call to \c
2958: .B _\|_msp_check\c
2959: \& after each stack adjustment. This
2960: is often used for kernel code.
2961: .PP
2962: These `\|\c
2963: .B \-m\c
2964: \&\|' options are defined for Motorola 88K architectures:
2965: .TP
2966: .B \-m88000
2967: Generate code that works well on both the m88100 and the
2968: m88110.
2969: .TP
2970: .B \-m88100
2971: Generate code that works best for the m88100, but that also
2972: runs on the m88110.
2973: .TP
2974: .B \-m88110
2975: Generate code that works best for the m88110, and may not run
2976: on the m88100.
2977: .TP
2978: .B \-midentify\-revision
2979: Include an \c
2980: .B ident\c
2981: \& directive in the assembler output recording the
2982: source file name, compiler name and version, timestamp, and compilation
2983: flags used.
2984: .TP
2985: .B \-mno\-underscores
2986: In assembler output, emit symbol names without adding an underscore
2987: character at the beginning of each name. The default is to use an
2988: underscore as prefix on each name.
2989: .TP
2990: .B \-mno\-check\-zero\-division
2991: .TP
2992: .B \-mcheck\-zero\-division
2993: Early models of the 88K architecture had problems with division by zero;
2994: in particular, many of them didn't trap. Use these options to avoid
2995: including (or to include explicitly) additional code to detect division
2996: by zero and signal an exception. All GCC configurations for the 88K use
2997: `\|\c
2998: .B \-mcheck\-zero\-division\c
2999: \&\|' by default.
3000: .TP
3001: .B \-mocs\-debug\-info
3002: .TP
3003: .B \-mno\-ocs\-debug\-info
3004: Include (or omit) additional debugging information (about
3005: registers used in each stack frame) as specified in the 88Open Object
3006: Compatibility Standard, \*(lqOCS\*(rq. This extra information is not needed
3007: by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to
3008: include this information; other 88k configurations omit this information
3009: by default.
3010: .TP
3011: .B \-mocs\-frame\-position
3012: .TP
3013: .B \-mno\-ocs\-frame\-position
3014: Force (or do not require) register values to be stored in a particular
3015: place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2,
3016: and BCS configurations use `\|\c
3017: .B \-mocs\-frame\-position\c
3018: \&\|'; other 88k
3019: configurations have the default `\|\c
3020: .B \-mno\-ocs\-frame\-position\c
3021: \&\|'.
3022: .TP
3023: .B \-moptimize\-arg\-area
3024: .TP
3025: .B \-mno\-optimize\-arg\-area
3026: Control how to store function arguments in stack frames.
3027: `\|\c
3028: .B \-moptimize\-arg\-area\c
3029: \&\|' saves space, but may break some
3030: debuggers (not GDB). `\|\c
3031: .B \-mno\-optimize\-arg\-area\c
3032: \&\|' conforms better to
3033: standards. By default GCC does not optimize the argument area.
3034: .TP
3035: .BI "\-mshort\-data\-" "num"
3036: .I num
3037: Generate smaller data references by making them relative to \c
3038: .B r0\c
3039: \&,
3040: which allows loading a value using a single instruction (rather than the
3041: usual two). You control which data references are affected by
3042: specifying \c
3043: .I num\c
3044: \& with this option. For example, if you specify
3045: `\|\c
3046: .B \-mshort\-data\-512\c
3047: \&\|', then the data references affected are those
3048: involving displacements of less than 512 bytes.
3049: `\|\c
3050: .B \-mshort\-data\-\c
3051: .I num\c
3052: \&\c
3053: \&\|' is not effective for \c
3054: .I num\c
3055: \& greater
3056: than 64K.
3057: .PP
3058: .B \-mserialize-volatile
3059: .TP
3060: .B \-mno-serialize-volatile
3061: Do, or do not, generate code to guarantee sequential consistency of
3062: volatile memory references.
3063: .Sp
3064: GNU CC always guarantees consistency by default, for the preferred
3065: processor submodel. How this is done depends on the submodel.
3066: .Sp
3067: The m88100 processor does not reorder memory references and so always
3068: provides sequential consistency. If you use `\|\c
3069: .B \-m88100\c
3070: \&\|', GNU CC does
3071: not generate any special instructions for sequential consistency.
3072: .Sp
3073: The order of memory references made by the m88110 processor does not
3074: always match the order of the instructions requesting those references.
3075: In particular, a load instruction may execute before a preceding store
3076: instruction. Such reordering violates sequential consistency of
3077: volatile memory references, when there are multiple processors. When
3078: you use `\|\c
3079: .B \-m88000\c
3080: \&\|' or `\|\c
3081: .B \-m88110\c
3082: \&\|', GNU CC generates special
3083: instructions when appropriate, to force execution in the proper order.
3084: .Sp
3085: The extra code generated to guarantee consistency may affect the
3086: performance of your application. If you know that you can safely forgo
3087: this guarantee, you may use the option `\|\c
3088: .B \-mno-serialize-volatile\c
3089: \&\|'.
3090: .Sp
3091: If you use the `\|\c
3092: .B \-m88100\c
3093: \&\|' option but require sequential consistency
3094: when running on the m88110 processor, you should use
3095: `\|\c
3096: .B \-mserialize-volatile\c
3097: \&\|'.
3098: .PP
3099: .B \-msvr4
3100: .TP
3101: .B \-msvr3
3102: Turn on (`\|\c
3103: .B \-msvr4\c
3104: \&\|') or off (`\|\c
3105: .B \-msvr3\c
3106: \&\|') compiler extensions
3107: related to System V release 4 (SVr4). This controls the following:
3108: .TP
3109: \ \ \ \(bu
3110: Which variant of the assembler syntax to emit (which you can select
3111: independently using `\|\c
3112: .B \-mversion\-03.00\c
3113: \&\|').
3114: .TP
3115: \ \ \ \(bu
3116: `\|\c
3117: .B \-msvr4\c
3118: \&\|' makes the C preprocessor recognize `\|\c
3119: .B #pragma weak\c
3120: \&\|'
3121: .TP
3122: \ \ \ \(bu
3123: `\|\c
3124: .B \-msvr4\c
3125: \&\|' makes GCC issue additional declaration directives used in
3126: SVr4.
3127: .PP
3128: `\|\c
3129: .B \-msvr3\c
3130: \&\|' is the default for all m88K configurations except
3131: the SVr4 configuration.
3132: .TP
3133: .B \-mtrap\-large\-shift
3134: .TP
3135: .B \-mhandle\-large\-shift
3136: Include code to detect bit-shifts of more than 31 bits; respectively,
3137: trap such shifts or emit code to handle them properly. By default GCC
3138: makes no special provision for large bit shifts.
3139: .TP
3140: .B \-muse\-div\-instruction
3141: Very early models of the 88K architecture didn't have a divide
3142: instruction, so GCC avoids that instruction by default. Use this option
3143: to specify that it's safe to use the divide instruction.
3144: .TP
3145: .B \-mversion\-03.00
3146: In the DG/UX configuration, there are two flavors of SVr4. This option
3147: modifies
3148: .B \-msvr4
3149: to select whether the hybrid-COFF or real-ELF
3150: flavor is used. All other configurations ignore this option.
3151: .TP
3152: .B \-mwarn\-passed\-structs
3153: Warn when a function passes a struct as an argument or result.
3154: Structure-passing conventions have changed during the evolution of the C
3155: language, and are often the source of portability problems. By default,
3156: GCC issues no such warning.
3157: .PP
3158: These options are defined for the IBM RS6000:
3159: .PP
3160: .B \-mfp\-in\-toc
3161: .TP
3162: .B \-mno\-fp\-in\-toc
3163: Control whether or not floating-point constants go in the Table of
3164: Contents (TOC), a table of all global variable and function addresses. By
3165: default GCC puts floating-point constants there; if the TOC overflows,
3166: `\|\c
3167: .B \-mno\-fp\-in\-toc\c
3168: \&\|' will reduce the size of the TOC, which may avoid
3169: the overflow.
3170: .PP
3171: These `\|\c
3172: .B \-m\c
3173: \&\|' options are defined for the IBM RT PC:
3174: .TP
3175: .B \-min\-line\-mul
3176: Use an in-line code sequence for integer multiplies. This is the
3177: default.
3178: .TP
3179: .B \-mcall\-lib\-mul
3180: Call \c
3181: .B lmul$$\c
3182: \& for integer multiples.
3183: .TP
3184: .B \-mfull\-fp\-blocks
3185: Generate full-size floating point data blocks, including the minimum
3186: amount of scratch space recommended by IBM. This is the default.
3187: .TP
3188: .B \-mminimum\-fp\-blocks
3189: Do not include extra scratch space in floating point data blocks. This
3190: results in smaller code, but slower execution, since scratch space must
3191: be allocated dynamically.
3192: .TP
3193: .B \-mfp\-arg\-in\-fpregs
3194: Use a calling sequence incompatible with the IBM calling convention in
3195: which floating point arguments are passed in floating point registers.
3196: Note that \c
3197: .B varargs.h\c
3198: \& and \c
3199: .B stdargs.h\c
3200: \& will not work with
3201: floating point operands if this option is specified.
3202: .TP
3203: .B \-mfp\-arg\-in\-gregs
3204: Use the normal calling convention for floating point arguments. This is
3205: the default.
3206: .TP
3207: .B \-mhc\-struct\-return
3208: Return structures of more than one word in memory, rather than in a
3209: register. This provides compatibility with the MetaWare HighC (hc)
3210: compiler. Use `\|\c
3211: .B \-fpcc\-struct\-return\c
3212: \&\|' for compatibility with the
3213: Portable C Compiler (pcc).
3214: .TP
3215: .B \-mnohc\-struct\-return
3216: Return some structures of more than one word in registers, when
3217: convenient. This is the default. For compatibility with the
3218: IBM-supplied compilers, use either `\|\c
3219: .B \-fpcc\-struct\-return\c
3220: \&\|' or
3221: `\|\c
3222: .B \-mhc\-struct\-return\c
3223: \&\|'.
3224: .PP
3225: These `\|\c
3226: .B \-m\c
3227: \&\|' options are defined for the MIPS family of computers:
3228: .TP
3229: .BI "\-mcpu=" "cpu-type"
3230: Assume the defaults for the machine type
3231: .I cpu-type
3232: when
3233: scheduling instructions. The default
3234: .I cpu-type
3235: is
3236: .BR default ,
3237: which picks the longest cycles times for any of the machines, in order
3238: that the code run at reasonable rates on all MIPS cpu's. Other
3239: choices for
3240: .I cpu-type
3241: are
3242: .BR r2000 ,
3243: .BR r3000 ,
3244: .BR r4000 ,
3245: and
3246: .BR r6000 .
3247: While picking a specific
3248: .I cpu-type
3249: will schedule things appropriately for that particular chip, the
3250: compiler will not generate any code that does not meet level 1 of the
3251: MIPS ISA (instruction set architecture) without the
3252: .B \-mips2
3253: or
3254: .B \-mips3
3255: switches being used.
3256: .TP
3257: .B \-mips2
3258: Issue instructions from level 2 of the MIPS ISA (branch likely, square
3259: root instructions). The
3260: .B \-mcpu=r4000
3261: or
3262: .B \-mcpu=r6000
3263: switch must be used in conjunction with
3264: .BR \-mips2 .
3265: .TP
3266: .B \-mips3
3267: Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
3268: The
3269: .B \-mcpu=r4000
3270: switch must be used in conjunction with
3271: .BR \-mips2 .
3272: .TP
3273: .B \-mint64
3274: .TP
3275: .B \-mlong64
3276: .TP
3277: .B \-mlonglong128
3278: These options don't work at present.
3279: .TP
3280: .B \-mmips\-as
3281: Generate code for the MIPS assembler, and invoke
3282: .B mips\-tfile
3283: to add normal debug information. This is the default for all
3284: platforms except for the OSF/1 reference platform, using the OSF/rose
3285: object format. If any of the
3286: .BR \-ggdb ,
3287: .BR \-gstabs ,
3288: or
3289: .B \-gstabs+
3290: switches are used, the
3291: .B mips\-tfile
3292: program will encapsulate the stabs within MIPS ECOFF.
3293: .TP
3294: .B \-mgas
3295: Generate code for the GNU assembler. This is the default on the OSF/1
3296: reference platform, using the OSF/rose object format.
3297: .TP
3298: .B \-mrnames
3299: .TP
3300: .B \-mno\-rnames
3301: The
3302: .B \-mrnames
3303: switch says to output code using the MIPS software names for the
3304: registers, instead of the hardware names (ie,
3305: .B a0
3306: instead of
3307: .BR $4 ).
3308: The GNU assembler does not support the
3309: .B \-mrnames
3310: switch, and the MIPS assembler will be instructed to run the MIPS C
3311: preprocessor over the source file. The
3312: .B \-mno\-rnames
3313: switch is default.
3314: .TP
3315: .B \-mgpopt
3316: .TP
3317: .B \-mno\-gpopt
3318: The
3319: .B \-mgpopt
3320: switch says to write all of the data declarations before the
3321: instructions in the text section, to all the MIPS assembler to
3322: generate one word memory references instead of using two words for
3323: short global or static data items. This is on by default if
3324: optimization is selected.
3325: .TP
3326: .B \-mstats
3327: .TP
3328: .B \-mno\-stats
3329: For each non-inline function processed, the
3330: .B \-mstats
3331: switch causes the compiler to emit one line to the standard error file
3332: to print statistics about the program (number of registers saved,
3333: stack size, etc.).
3334: .TP
3335: .B \-mmemcpy
3336: .TP
3337: .B \-mno\-memcpy
3338: The
3339: .B \-mmemcpy
3340: switch makes all block moves call the appropriate string function
3341: .RB ( memcpy
3342: or
3343: .BR bcopy )
3344: instead of possibly generating inline code.
3345: .TP
3346: .B \-mmips\-tfile
3347: .TP
3348: .B \-mno\-mips\-tfile
3349: The
3350: .B \-mno\-mips\-tfile
3351: switch causes the compiler not postprocess the object file with the
3352: .B mips\-tfile
3353: program, after the MIPS assembler has generated it to add debug
3354: support. If
3355: .B mips\-tfile
3356: is not run, then no local variables will be available to the debugger.
3357: In addition,
3358: .B stage2
3359: and
3360: .B stage3
3361: objects will have the temporary file names passed to the assembler
3362: embedded in the object file, which means the objects will not compare
3363: the same.
3364: .TP
3365: .B \-msoft\-float
3366: Generate output containing library calls for floating point.
3367: .I
3368: WARNING:
3369: the requisite libraries are not part of GNU CC. Normally the
3370: facilities of the machine's usual C compiler are used, but this can't
3371: be done directly in cross-compilation. You must make your own
3372: arrangements to provide suitable library functions for cross-compilation.
3373: .TP
3374: .B \-mhard\-float
3375: Generate output containing floating point instructions. This is the
3376: default if you use the unmodified sources.
3377: .TP
3378: .B \-mfp64
3379: Assume that the
3380: .B FR
3381: bit in the status word is on, and that there are 32 64-bit floating
3382: point registers, instead of 32 32-bit floating point registers. You
3383: must also specify the
3384: .B \-mcpu=r4000
3385: and
3386: .B \-mips3
3387: switches.
3388: .TP
3389: .B \-mfp32
3390: Assume that there are 32 32-bit floating point registers. This is the
3391: default.
3392: .PP
3393: .B \-mabicalls
3394: .TP
3395: .B \-mno\-abicalls
3396: Emit (or do not emit) the
3397: .BR \&.abicalls ,
3398: .BR \&.cpload ,
3399: and
3400: .B \&.cprestore
3401: pseudo operations that some System V.4 ports use for position
3402: independent code.
3403: .TP
3404: .B \-mhalf\-pic
3405: .TP
3406: .B \-mno\-half\-pic
3407: The
3408: .B \-mhalf\-pic
3409: switch says to put pointers to extern references into the data section
3410: and load them up, rather than put the references in the text section.
3411: This option does not work at present.
3412: .B
3413: .BI \-G num
3414: Put global and static items less than or equal to
3415: .I num
3416: bytes into the small data or bss sections instead of the normal data
3417: or bss section. This allows the assembler to emit one word memory
3418: reference instructions based on the global pointer
3419: .RB ( gp
3420: or
3421: .BR $28 ),
3422: instead of the normal two words used. By default,
3423: .I num
3424: is 8 when the MIPS assembler is used, and 0 when the GNU
3425: assembler is used. The
3426: .BI \-G num
3427: switch is also passed to the assembler and linker. All modules should
3428: be compiled with the same
3429: .BI \-G num
3430: value.
3431: .TP
3432: .B \-nocpp
3433: Tell the MIPS assembler to not run it's preprocessor over user
3434: assembler files (with a `\|\c
3435: .B .s\c
3436: \&\|' suffix) when assembling them.
3437: .PP
3438: These `\|\c
3439: .B \-m\c
3440: \&\|' options are defined for the Intel 80386 family of computers:
3441: .B \-m486
3442: .TP
3443: .B \-mno\-486
3444: Control whether or not code is optimized for a 486 instead of an
3445: 386. Code generated for a 486 will run on a 386 and vice versa.
3446: .TP
3447: .B \-msoft\-float
3448: Generate output containing library calls for floating point.
3449: .I Warning:
3450: the requisite libraries are not part of GNU CC.
3451: Normally the facilities of the machine's usual C compiler are used, but
3452: this can't be done directly in cross-compilation. You must make your
3453: own arrangements to provide suitable library functions for
3454: cross-compilation.
3455: .Sp
3456: On machines where a function returns floating point results in the 80387
3457: register stack, some floating point opcodes may be emitted even if
3458: `\|\c
3459: .B \-msoft-float\c
3460: \&\|' is used.
3461: .TP
3462: .B \-mno-fp-ret-in-387
3463: Do not use the FPU registers for return values of functions.
3464: .Sp
3465: The usual calling convention has functions return values of types
3466: .B float\c
3467: \& and \c
3468: .B double\c
3469: \& in an FPU register, even if there
3470: is no FPU. The idea is that the operating system should emulate
3471: an FPU.
3472: .Sp
3473: The option `\|\c
3474: .B \-mno-fp-ret-in-387\c
3475: \&\|' causes such values to be returned
3476: in ordinary CPU registers instead.
3477: .PP
3478: These `\|\c
3479: .B \-m\c
3480: \&\|' options are defined for the HPPA family of computers:
3481: .TP
3482: .B \-mpa-risc-1-0
3483: Generate code for a PA 1.0 processor.
3484: .TP
3485: .B \-mpa-risc-1-1
3486: Generate code for a PA 1.1 processor.
3487: .TP
3488: .B \-mkernel
3489: Generate code which is suitable for use in kernels. Specifically, avoid
3490: .B add\c
3491: \& instructions in which one of the arguments is the DP register;
3492: generate \c
3493: .B addil\c
3494: \& instructions instead. This avoids a rather serious
3495: bug in the HP-UX linker.
3496: .TP
3497: .B \-mshared-libs
3498: Generate code that can be linked against HP-UX shared libraries. This option
3499: is not fully function yet, and is not on by default for any PA target. Using
3500: this option can cause incorrect code to be generated by the compiler.
3501: .TP
3502: .B \-mno-shared-libs
3503: Don't generate code that will be linked against shared libraries. This is
3504: the default for all PA targets.
3505: .TP
3506: .B \-mlong-calls
3507: Generate code which allows calls to functions greater than 256K away from
3508: the caller when the caller and callee are in the same source file. Do
3509: not turn this option on unless code refuses to link with \*(lqbranch out of
3510: range errors\*('' from the linker.
3511: .TP
3512: .B \-mdisable-fpregs
3513: Prevent floating point registers from being used in any manner. This is
3514: necessary for compiling kernels which perform lazy context switching of
3515: floating point registers. If you use this option and attempt to perform
3516: floating point operations, the compiler will abort.
3517: .TP
3518: .B \-mdisable-indexing
3519: Prevent the compiler from using indexing address modes. This avoids some
3520: rather obscure problems when compiling MIG generated code under MACH.
3521: .TP
3522: .B \-mtrailing-colon
3523: Add a colon to the end of label definitions (for ELF assemblers).
3524: .PP
3525: These `\|\c
3526: .B \-m\c
3527: \&\|' options are defined for the Intel 80960 family of computers:
3528: .TP
3529: .BI "\-m" "cpu-type"
3530: Assume the defaults for the machine type
3531: .I cpu-type
3532: for instruction and addressing-mode availability and alignment.
3533: The default
3534: .I cpu-type
3535: is
3536: .BR kb ;
3537: other choices are
3538: .BR ka ,
3539: .BR mc ,
3540: .BR ca ,
3541: .BR cf ,
3542: .BR sa ,
3543: and
3544: .BR sb .
3545: .TP
3546: .B \-mnumerics
3547: .TP
3548: .B \-msoft\-float
3549: The
3550: .B \-mnumerics
3551: option indicates that the processor does support
3552: floating-point instructions. The
3553: .B \-msoft\-float
3554: option indicates
3555: that floating-point support should not be assumed.
3556: .TP
3557: .B \-mleaf\-procedures
3558: .TP
3559: .B \-mno\-leaf\-procedures
3560: Do (or do not) attempt to alter leaf procedures to be callable with the
3561: .I bal
3562: instruction as well as
3563: .IR call .
3564: This will result in more
3565: efficient code for explicit calls when the
3566: .I bal
3567: instruction can be
3568: substituted by the assembler or linker, but less efficient code in other
3569: cases, such as calls via function pointers, or using a linker that doesn't
3570: support this optimization.
3571: .TP
3572: .B \-mtail\-call
3573: .TP
3574: .B \-mno\-tail\-call
3575: Do (or do not) make additional attempts (beyond those of the
3576: machine-independent portions of the compiler) to optimize tail-recursive
3577: calls into branches. You may not want to do this because the detection of
3578: cases where this is not valid is not totally complete. The default is
3579: .BR \-mno\-tail\-call .
3580: .TP
3581: .B \-mcomplex\-addr
3582: .TP
3583: .B \-mno\-complex\-addr
3584: Assume (or do not assume) that the use of a complex addressing mode is a
3585: win on this implementation of the i960. Complex addressing modes may not
3586: be worthwhile on the K-series, but they definitely are on the C-series.
3587: The default is currently
3588: .B \-mcomplex\-addr
3589: for all processors except
3590: the CB and CC.
3591: .TP
3592: .B \-mcode\-align
3593: .TP
3594: .B \-mno\-code\-align
3595: Align code to 8-byte boundaries for faster fetching (or don't bother).
3596: Currently turned on by default for C-series implementations only.
3597: .TP
3598: .B \-mic\-compat
3599: .TP
3600: .B \-mic2.0\-compat
3601: .TP
3602: .B \-mic3.0\-compat
3603: Enable compatibility with iC960 v2.0 or v3.0.
3604: .TP
3605: .B \-masm\-compat
3606: .TP
3607: .B \-mintel\-asm
3608: Enable compatibility with the iC960 assembler.
3609: .TP
3610: .B \-mstrict\-align
3611: .TP
3612: .B \-mno\-strict\-align
3613: Do not permit (do permit) unaligned accesses.
3614: .TP
3615: .B \-mold\-align
3616: Enable structure-alignment compatibility with Intel's gcc release version
3617: 1.3 (based on gcc 1.37). Currently this is buggy in that
3618: .B #pragma align 1
3619: is always assumed as well, and cannot be turned off.
3620: .PP
3621: These `\|\c
3622: .B \-m\c
3623: \&\|' options are defined for the DEC Alpha implementations:
3624: .TP
3625: .B \-mno-soft-float
3626: .TP
3627: .B \-msoft-float
3628: Use (do not use) the hardware floating-point instructions for
3629: floating-point operations. When \c
3630: .B \-msoft-float\c
3631: \& is specified,
3632: functions in `\|\c
3633: .B libgcc1.c\c
3634: \&\|' will be used to perform floating-point
3635: operations. Unless they are replaced by routines that emulate the
3636: floating-point operations, or compiled in such a way as to call such
3637: emulations routines, these routines will issue floating-point
3638: operations. If you are compiling for an Alpha without floating-point
3639: operations, you must ensure that the library is built so as not to call
3640: them.
3641: .Sp
3642: Note that Alpha implementations without floating-point operations are
3643: required to have floating-point registers.
3644: .TP
3645: .B \-mfp-reg
3646: .TP
3647: .B \-mno-fp-regs
3648: Generate code that uses (does not use) the floating-point register set.
3649: .B \-mno-fp-regs\c
3650: \& implies \c
3651: .B \-msoft-float\c
3652: \&. If the floating-point
3653: register set is not used, floating point operands are passed in integer
3654: registers as if they were integers and floating-point results are passed
3655: in $0 instead of $f0. This is a non-standard calling sequence, so any
3656: function with a floating-point argument or return value called by code
3657: compiled with \c
3658: .B \-mno-fp-regs\c
3659: \& must also be compiled with that
3660: option.
3661: .Sp
3662: A typical use of this option is building a kernel that does not use,
3663: and hence need not save and restore, any floating-point registers.
3664: .PP
3665: These additional options are available on System V Release 4 for
3666: compatibility with other compilers on those systems:
3667: .TP
3668: .B \-G
3669: On SVr4 systems, \c
3670: .B gcc\c
3671: \& accepts the option `\|\c
3672: .B \-G\c
3673: \&\|' (and passes
3674: it to the system linker), for compatibility with other compilers.
3675: However, we suggest you use `\|\c
3676: .B \-symbolic\c
3677: \&\|' or `\|\c
3678: .B \-shared\c
3679: \&\|' as
3680: appropriate, instead of supplying linker options on the \c
3681: .B gcc
3682: command line.
3683: .TP
3684: .B \-Qy
3685: Identify the versions of each tool used by the compiler, in a
3686: .B .ident\c
3687: \& assembler directive in the output.
3688: .TP
3689: .B \-Qn
3690: Refrain from adding \c
3691: .B .ident\c
3692: \& directives to the output file (this is
3693: the default).
3694: .TP
3695: .BI "\-YP," "dirs"
3696: Search the directories \c
3697: .I dirs\c
3698: \&, and no others, for libraries
3699: specified with `\|\c
3700: .B \-l\c
3701: \&\|'. You can separate directory entries in
3702: .I dirs\c
3703: \& from one another with colons.
3704: .TP
3705: .BI "\-Ym," "dir"
3706: Look in the directory \c
3707: .I dir\c
3708: \& to find the M4 preprocessor.
3709: The assembler uses this option.
3710: .SH CODE GENERATION OPTIONS
3711: These machine-independent options control the interface conventions
3712: used in code generation.
3713: .PP
3714: Most of them begin with `\|\c
3715: \-f\c
3716: \&\|'. These options have both positive and negative forms; the negative form
3717: of `\|\c
3718: .B \-ffoo\c
3719: \&\|' would be `\|\c
3720: .B \-fno\-foo\c
3721: \&\|'. In the table below, only
3722: one of the forms is listed\(em\&the one which is not the default. You
3723: can figure out the other form by either removing `\|\c
3724: .B no\-\c
3725: \&\|' or adding
3726: it.
3727: .TP
3728: .B \-fnonnull\-objects
3729: Assume that objects reached through references are not null
3730: (C++ only).
3731: .Sp
3732: Normally, GNU C++ makes conservative assumptions about objects reached
3733: through references. For example, the compiler must check that \c
3734: .B a
3735: is not null in code like the following:
3736: .Sp
3737: obj &a = g ();
3738: a.f (2);
3739: .Sp
3740: Checking that references of this sort have non-null values requires
3741: extra code, however, and it is unnecessary for many programs. You can
3742: use `\|\c
3743: .B \-fnonnull-objects\c
3744: \&\|' to omit the checks for null, if your
3745: program doesn't require checking.
3746: .TP
3747: .B \-fpcc\-struct\-return
3748: Use the same convention for returning \c
3749: .B struct\c
3750: \& and \c
3751: .B union
3752: values that is used by the usual C compiler on your system. This
3753: convention is less efficient for small structures, and on many
3754: machines it fails to be reentrant; but it has the advantage of
3755: allowing intercallability between GCC-compiled code and PCC-compiled
3756: code.
3757: .TP
3758: .B \-freg\-struct\-return
3759: Use the convention that
3760: .B struct
3761: and
3762: .B union
3763: values are returned in registers when possible. This is more
3764: efficient for small structures than
3765: .BR \-fpcc\-struct\-return .
3766: .Sp
3767: If you specify neither
3768: .B \-fpcc\-struct\-return
3769: nor
3770: .BR \-freg\-struct\-return ,
3771: GNU CC defaults to whichever convention is standard for the target.
3772: If there is no standard convention, GNU CC defaults to
3773: .BR \-fpcc\-struct\-return .
3774: .TP
3775: .B \-fshort\-enums
3776: Allocate to an \c
3777: .B enum\c
3778: \& type only as many bytes as it needs for the
3779: declared range of possible values. Specifically, the \c
3780: .B enum\c
3781: \& type
3782: will be equivalent to the smallest integer type which has enough room.
3783: .TP
3784: .B \-fshort\-double
3785: Use the same size for
3786: .B double
3787: as for
3788: .B float
3789: \&.
3790: .TP
3791: .B \-fshared\-data
3792: Requests that the data and non-\c
3793: .B const\c
3794: \& variables of this
3795: compilation be shared data rather than private data. The distinction
3796: makes sense only on certain operating systems, where shared data is
3797: shared between processes running the same program, while private data
3798: exists in one copy per process.
3799: .TP
3800: .B \-fno\-common
3801: Allocate even uninitialized global variables in the bss section of the
3802: object file, rather than generating them as common blocks. This has the
3803: effect that if the same variable is declared (without \c
3804: .B extern\c
3805: \&) in
3806: two different compilations, you will get an error when you link them.
3807: The only reason this might be useful is if you wish to verify that the
3808: program will work on other systems which always work this way.
3809: .TP
3810: .B \-fno\-ident
3811: Ignore the `\|\c
3812: .B #ident\c
3813: \&\|' directive.
3814: .TP
3815: .B \-fno\-gnu\-linker
3816: Do not output global initializations (such as C++ constructors and
3817: destructors) in the form used by the GNU linker (on systems where the GNU
3818: linker is the standard method of handling them). Use this option when
3819: you want to use a non-GNU linker, which also requires using the
3820: .B collect2\c
3821: \& program to make sure the system linker includes
3822: constructors and destructors. (\c
3823: .B collect2\c
3824: \& is included in the GNU CC
3825: distribution.) For systems which \c
3826: .I must\c
3827: \& use \c
3828: .B collect2\c
3829: \&, the
3830: compiler driver \c
3831: .B gcc\c
3832: \& is configured to do this automatically.
3833: .TP
3834: .B \-finhibit-size-directive
3835: Don't output a \c
3836: .B .size\c
3837: \& assembler directive, or anything else that
3838: would cause trouble if the function is split in the middle, and the
3839: two halves are placed at locations far apart in memory. This option is
3840: used when compiling `\|\c
3841: .B crtstuff.c\c
3842: \&\|'; you should not need to use it
3843: for anything else.
3844: .TP
3845: .B \-fverbose-asm
3846: Put extra commentary information in the generated assembly code to
3847: make it more readable. This option is generally only of use to those
3848: who actually need to read the generated assembly code (perhaps while
3849: debugging the compiler itself).
3850: .TP
3851: .B \-fvolatile
3852: Consider all memory references through pointers to be volatile.
3853: .TP
3854: .B \-fvolatile\-global
3855: Consider all memory references to extern and global data items to
3856: be volatile.
3857: .TP
3858: .B \-fpic
3859: If supported for the target machines, generate position-independent code,
3860: suitable for use in a shared library.
3861: .TP
3862: .B \-fPIC
3863: If supported for the target machine, emit position-independent code,
3864: suitable for dynamic linking, even if branches need large displacements.
3865: .TP
3866: .BI "\-ffixed\-" "reg"
3867: Treat the register named \c
3868: .I reg\c
3869: \& as a fixed register; generated code
3870: should never refer to it (except perhaps as a stack pointer, frame
3871: pointer or in some other fixed role).
3872: .Sp
3873: .I reg\c
3874: \& must be the name of a register. The register names accepted
3875: are machine-specific and are defined in the \c
3876: .B REGISTER_NAMES
3877: macro in the machine description macro file.
3878: .Sp
3879: This flag does not have a negative form, because it specifies a
3880: three-way choice.
3881: .TP
3882: .BI "\-fcall\-used\-" "reg"
3883: Treat the register named \c
3884: .I reg\c
3885: \& as an allocatable register that is
3886: clobbered by function calls. It may be allocated for temporaries or
3887: variables that do not live across a call. Functions compiled this way
3888: will not save and restore the register \c
3889: .I reg\c
3890: \&.
3891: .Sp
3892: Use of this flag for a register that has a fixed pervasive role in the
3893: machine's execution model, such as the stack pointer or frame pointer,
3894: will produce disastrous results.
3895: .Sp
3896: This flag does not have a negative form, because it specifies a
3897: three-way choice.
3898: .TP
3899: .BI "\-fcall\-saved\-" "reg"
3900: Treat the register named \c
3901: .I reg\c
3902: \& as an allocatable register saved by
3903: functions. It may be allocated even for temporaries or variables that
3904: live across a call. Functions compiled this way will save and restore
3905: the register \c
3906: .I reg\c
3907: \& if they use it.
3908: .Sp
3909: Use of this flag for a register that has a fixed pervasive role in the
3910: machine's execution model, such as the stack pointer or frame pointer,
3911: will produce disastrous results.
3912: .Sp
3913: A different sort of disaster will result from the use of this flag for
3914: a register in which function values may be returned.
3915: .Sp
3916: This flag does not have a negative form, because it specifies a
3917: three-way choice.
3918: .SH PRAGMAS
3919: Two `\|\c
3920: .B #pragma\c
3921: \&\|' directives are supported for GNU C++, to permit using the same
3922: header file for two purposes: as a definition of interfaces to a given
3923: object class, and as the full definition of the contents of that object class.
3924: .TP
3925: .B #pragma interface
3926: (C++ only.)
3927: Use this directive in header files that define object classes, to save
3928: space in most of the object files that use those classes. Normally,
3929: local copies of certain information (backup copies of inline member
3930: functions, debugging information, and the internal tables that
3931: implement virtual functions) must be kept in each object file that
3932: includes class definitions. You can use this pragma to avoid such
3933: duplication. When a header file containing `\|\c
3934: .B #pragma interface\c
3935: \&\|' is included in a compilation, this auxiliary information
3936: will not be generated (unless the main input source file itself uses
3937: `\|\c
3938: .B #pragma implementation\c
3939: \&\|'). Instead, the object files will contain references to be
3940: resolved at link time.
3941: .TP
3942: .B #pragma implementation
3943: .TP
3944: \fB#pragma implementation "\fP\fIobjects\fP\fB.h"\fP
3945: (C++ only.)
3946: Use this pragma in a main input file, when you want full output from
3947: included header files to be generated (and made globally visible).
3948: The included header file, in turn, should use `\|\c
3949: .B #pragma interface\c
3950: \&\|'.
3951: Backup copies of inline member functions, debugging information, and
3952: the internal tables used to implement virtual functions are all
3953: generated in implementation files.
3954: .Sp
3955: If you use `\|\c
3956: .B #pragma implementation\c
3957: \&\|' with no argument, it applies to an include file with the same
3958: basename as your source file; for example, in `\|\c
3959: .B allclass.cc\c
3960: \&\|', `\|\c
3961: .B #pragma implementation\c
3962: \&\|' by itself is equivalent to `\|\c
3963: .B
3964: #pragma implementation "allclass.h"\c
3965: \&\|'. Use the string argument if you want a single implementation
3966: file to include code from multiple header files.
3967: .Sp
3968: There is no way to split up the contents of a single header file into
3969: multiple implementation files.
3970: .SH FILES
3971: .nf
3972: .ta \w'LIBDIR/g++\-include 'u
3973: file.c C source file
3974: file.h C header (preprocessor) file
3975: file.i preprocessed C source file
3976: file.C C++ source file
3977: file.cc C++ source file
3978: file.cxx C++ source file
3979: file.m Objective-C source file
3980: file.s assembly language file
3981: file.o object file
3982: a.out link edited output
3983: \fITMPDIR\fR/cc\(** temporary files
3984: \fILIBDIR\fR/cpp preprocessor
3985: \fILIBDIR\fR/cc1 compiler for C
3986: \fILIBDIR\fR/cc1plus compiler for C++
3987: \fILIBDIR\fR/collect linker front end needed on some machines
3988: \fILIBDIR\fR/libgcc.a GCC subroutine library
3989: /lib/crt[01n].o start-up routine
3990: \fILIBDIR\fR/ccrt0 additional start-up routine for C++
3991: /lib/libc.a standard C library, see
3992: .IR intro (3)
3993: /usr/include standard directory for \fB#include\fP files
3994: \fILIBDIR\fR/include standard gcc directory for \fB#include\fP files
3995: \fILIBDIR\fR/g++\-include additional g++ directory for \fB#include\fP
3996: .Sp
3997: .fi
3998: .I LIBDIR
3999: is usually
4000: .B /usr/local/lib/\c
4001: .IR machine / version .
4002: .br
4003: .I TMPDIR
4004: comes from the environment variable
4005: .B TMPDIR
4006: (default
4007: .B /usr/tmp
4008: if available, else
4009: .B /tmp\c
4010: \&).
4011: .SH "SEE ALSO"
4012: cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
4013: .br
4014: .RB "`\|" gcc "\|', `\|" cpp \|',
4015: .RB "`\|" as "\|', `\|" ld \|',
4016: and
4017: .RB `\| gdb \|'
4018: entries in
4019: .B info\c
4020: \&.
4021: .br
4022: .I
4023: Using and Porting GNU CC (for version 2.0)\c
4024: , Richard M. Stallman;
4025: .I
4026: The C Preprocessor\c
4027: , Richard M. Stallman;
4028: .I
4029: Debugging with GDB: the GNU Source-Level Debugger\c
4030: , Richard M. Stallman and Roland H. Pesch;
4031: .I
4032: Using as: the GNU Assembler\c
4033: , Dean Elsner, Jay Fenlason & friends;
4034: .I
4035: ld: the GNU linker\c
4036: , Steve Chamberlain and Roland Pesch.
4037: .SH BUGS
4038: For instructions on reporting bugs, see the GCC manual.
4039: .SH COPYING
4040: Copyright
4041: .if t \(co
4042: 1991, 1992, 1993 Free Software Foundation, Inc.
4043: .PP
4044: Permission is granted to make and distribute verbatim copies of
4045: this manual provided the copyright notice and this permission notice
4046: are preserved on all copies.
4047: .PP
4048: Permission is granted to copy and distribute modified versions of this
4049: manual under the conditions for verbatim copying, provided that the
4050: entire resulting derived work is distributed under the terms of a
4051: permission notice identical to this one.
4052: .PP
4053: Permission is granted to copy and distribute translations of this
4054: manual into another language, under the above conditions for modified
4055: versions, except that this permission notice may be included in
4056: translations approved by the Free Software Foundation instead of in
4057: the original English.
4058: .SH AUTHORS
4059: See the GNU CC Manual for the contributors to GNU CC.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.