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

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()