1 .\" $FreeBSD: src/contrib/gcc/gcc.1,v 1.15.2.2 2003/02/05 03:06:26 trhodes Exp $
2 .\" $DragonFly: src/contrib/gcc/Attic/gcc.1,v 1.2 2003/06/17 04:24:01 dillon Exp $
3 .\" Copyright (c) 1991, 1992, 1993, 1994 Free Software Foundation -*-Text-*-
4 .\" See section COPYING for conditions for redistribution
6 .\" Set up \*(lq, \*(rq if -man hasn't already set it up.
10 . if !@@\(lq@ .ds lq "\(lq
15 . if !@@\(rq@ .ds rq "\(rq
25 .Id $Id: gcc.1,v 1.9 1998/12/16 20:55:57 law Exp $
26 .TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
28 gcc, g++ \- GNU project C and C++ Compiler (gcc-2.95.3)
31 .RI "[ " option " | " filename " ].\|.\|."
34 .RI "[ " option " | " filename " ].\|.\|."
36 The information in this man page is an extract from the full
37 documentation of the GNU C compiler, and is limited to the meaning of
40 This man page is not kept up to date except when volunteers want to
41 maintain it. If you find a discrepancy between the man page and the
42 software, please check the Info file, which is the authoritative
45 If we find that the things in this man page that are out of date cause
46 significant confusion or complaints, we will stop distributing the man
47 page. The alternative, updating the man page when we update the Info
48 file, is impossible because the rest of the work of maintaining GNU CC
49 leaves us no time for that. The GNU project regards man pages as
50 obsolete and should not let them take time away from other things.
52 For complete and current documentation, refer to the Info file `\|\c
56 Using and Porting GNU CC (for version 2.0)\c
57 \&. Both are made from the Texinfo source file
60 The C and C++ compilers are integrated. Both process input files
61 through one or more of four stages: preprocessing, compilation,
62 assembly, and linking. Source filename suffixes identify the source
63 language, but which name you use for the compiler governs default
67 assumes preprocessed (\c
69 \&) files are C and assumes C style linking.
72 assumes preprocessed (\c
74 \&) files are C++ and assumes C++ style linking.
76 Suffixes of source file names indicate the language and kind of
77 processing to be done:
81 \&\fB.c\fP C source; preprocess, compile, assemble
82 \&\fB.C\fP C++ source; preprocess, compile, assemble
83 \&\fB.cc\fP C++ source; preprocess, compile, assemble
84 \&\fB.cxx\fP C++ source; preprocess, compile, assemble
85 \&\fB.m\fP Objective-C source; preprocess, compile, assemble
86 \&\fB.i\fP preprocessed C; compile, assemble
87 \&\fB.ii\fP preprocessed C++; compile, assemble
88 \&\fB.s\fP Assembler source; assemble
89 \&\fB.S\fP Assembler source; preprocess, assemble
90 \&\fB.h\fP Preprocessor file; not usually named on command line
93 Files with other suffixes are passed to the linker. Common cases include:
96 \&\fB.o\fP Object file
97 \&\fB.a\fP Archive file
101 Linking is always the last stage unless you use one of the
106 options to avoid it (or unless compilation errors stop the whole
107 process). For the link stage, all
109 files corresponding to source files,
111 libraries, unrecognized filenames (including named
116 are passed to the linker in command-line order.
118 Options must be separate: `\|\c
120 \&\|' is quite different from `\|\c
128 \&\|' options have two contrary forms:
136 \&). Only the non-default forms are shown here.
138 Here is a summary of all the options, grouped by type. Explanations are
139 in the following sections.
157 \-fdollars\-in\-identifiers
159 \-fexternal\-templates
166 \-fno\-strict\-prototype
169 \-fthis\-is\-variable
170 \-funsigned\-bitfields
193 .RI \-Wid\-clash\- len
196 \-Wimplicit\-function\-declaration
200 \-Wmissing\-prototypes
201 \-Wmissing\-declarations
209 \-Wstrict\-prototypes
211 \-Wtemplate\-debugging
235 .RI \-print\-file\-name= library
236 \-print\-libgcc\-file\-name
237 .RI \-print\-prog\-name= program
239 .B Optimization Options
241 \-fcse\-follow\-jumps
244 \-felide\-constructors
245 \-fexpensive\-optimizations
251 \-fkeep\-inline\-functions
253 \-fno\-default\-inline
258 \-fomit\-frame\-pointer
259 \-frerun\-cse\-after\-loop
264 \-funroll\-all\-loops
272 .B Preprocessor Options
278 .RI \-D macro [\|= defn \|]
281 .RI "\-idirafter " dir
282 .RI "\-include " file
283 .RI "\-imacros " file
284 .RI "\-iprefix " file
285 .RI "\-iwithprefix " dir
305 .RI "\-Xlinker\ " option
319 .B Configuration Dependent Options
383 \-mcheck\-zero\-division
384 \-mhandle\-large\-shift
385 \-midentify\-revision
386 \-mno\-check\-zero\-division
387 \-mno\-ocs\-debug\-info
388 \-mno\-ocs\-frame\-position
389 \-mno\-optimize\-arg\-area
390 \-mno\-serialize\-volatile
393 \-mocs\-frame\-position
394 \-moptimize\-arg\-area
395 \-mserialize\-volatile
396 .RI \-mshort\-data\- num
399 \-mtrap\-large\-shift
400 \-muse\-div\-instruction
402 \-mwarn\-passed\-structs
412 \-mfp\-arg\-in\-fpregs
413 \-mfp\-arg\-in\-gregs
415 \-mhc\-struct\-return
417 \-mminimum\-fp\-blocks
418 \-mnohc\-struct\-return
422 \-mcpu=\fIcpu type\fP
456 \-mcpu=\fIcpu type\fP
457 \-march=\fIcpu type\fP
463 \-mno\-fp\-ret\-in\-387
465 \-mno\-wide\-multiply
468 \-mprofiler\-epilogue
489 \-mno\-leaf\-procedures
521 .B Code Generation Options
522 .RI \-fcall\-saved\- reg
523 .RI \-fcall\-used\- reg
525 \-finhibit\-size\-directive
530 \-fpcc\-struct\-return
533 \-freg\-struct\-return
542 .SH FreeBSD SPECIFIC OPTIONS
545 Link a user-threaded process against libc_r instead of libc. Objects linked
546 into user-threaded processes should be compiled with -D_THREAD_SAFE.
549 .BI "\-x " "language"
550 Specify explicitly the
552 \& for the following input files (rather than choosing a default based
553 on the file name suffix) . This option applies to all following input
554 files until the next `\|\c
556 \&\|' option. Possible values of \c
573 .B assembler\-with\-cpp\c
577 Turn off any specification of a language, so that subsequent files are
578 handled according to their file name suffixes (as they are if `\|\c
581 has not been used at all).
583 If you want only some of the four stages (preprocess, compile,
584 assemble, link), you can use
587 \&\|' (or filename suffixes) to tell \c
589 \& where to start, and
590 one of the options `\|\c
598 \& is to stop. Note that some combinations (for example,
600 .B \-x cpp\-output \-E\c
603 \& to do nothing at all.
606 Compile or assemble the source files, but do not link. The compiler
607 output is an object file corresponding to each source file.
609 By default, GCC makes the object file name for a source file by replacing
616 \&\|', etc., with `\|\c
620 \& to select another name.
622 GCC ignores any unrecognized input files (those that do not require
623 compilation or assembly) with the
628 Stop after the stage of compilation proper; do not assemble. The output
629 is an assembler code file for each non-assembler input
632 By default, GCC makes the assembler file name for a source file by
633 replacing the suffix `\|\c
637 \&\|', etc., with `\|\c
641 \& to select another name.
643 GCC ignores any input files that don't require compilation.
646 Stop after the preprocessing stage; do not run the compiler proper. The
647 output is preprocessed source code, which is sent to the
650 GCC ignores input files which don't require preprocessing.
653 Place output in file \c
655 \&. This applies regardless to whatever
656 sort of output GCC is producing, whether it be an executable file,
657 an object file, an assembler file or preprocessed C code.
659 Since only one output file can be specified, it does not make sense to
662 \&\|' when compiling more than one input file, unless you are
663 producing an executable file as output.
665 If you do not specify `\|\c
667 \&\|', the default is to put an executable file
670 \&\|', the object file for `\|\c
679 \&\|', its assembler file in `\|\c
683 all preprocessed C source on standard output.
686 Print (on standard error output) the commands executed to run the stages
687 of compilation. Also print the version number of the compiler driver
688 program and of the preprocessor and the compiler proper.
691 Use pipes rather than temporary files for communication between the
692 various stages of compilation. This fails to work on some systems where
693 the assembler cannot read from a pipe; but the GNU assembler has
697 The following options control the dialect of C that the compiler
701 Support all ANSI standard C programs.
703 This turns off certain features of GNU C that are incompatible with
704 ANSI C, such as the \c
710 keywords, and predefined macros such as \c
714 that identify the type of system you are using. It also enables the
715 undesirable and rarely used ANSI trigraph feature, and disallows `\|\c
717 \&\|' as part of identifiers.
719 The alternate keywords \c
722 .B _\|_extension_\|_\c
727 \& continue to work despite
730 \&\|'. You would not want to use them in an ANSI C program, of
731 course, but it is useful to put them in header files that might be included
732 in compilations done with `\|\c
734 \&\|'. Alternate predefined macros
739 \& are also available, with or
746 \&\|' option does not cause non-ANSI programs to be
747 rejected gratuitously. For that, `\|\c
754 The preprocessor predefines a macro \c
755 .B _\|_STRICT_ANSI_\|_\c
756 \& when you use the `\|\c
759 option. Some header files may notice this macro and refrain
760 from declaring certain functions or defining certain macros that the
761 ANSI standard doesn't call for; this is to avoid interfering with any
762 programs that might use these names for other things.
772 keyword. These words may then be used as identifiers. You can
787 Don't recognize built-in functions that do not begin with two leading
788 underscores. Currently, the functions affected include \c
822 \&\|' option prevents \c
827 being builtin functions.
830 Compile for a hosted environment; this implies the `\|\c
832 \&\|' option, and implies that suspicious declarations of
834 \& should be warned about.
837 Compile for a freestanding environment; this implies the `\|\c
839 \&\|' option, and implies that
841 \& has no special requirements.
843 .B \-fno\-strict\-prototype
844 Treat a function declaration with no arguments, such as `\|\c
847 \&\|', as C would treat it\(em\&as saying nothing about the number of
848 arguments or their types (C++ only). Normally, such a declaration in
849 C++ means that the function \c
851 \& takes no arguments.
854 Support ANSI C trigraphs. The `\|\c
856 \&\|' option implies `\|\c
861 Attempt to support some aspects of traditional C compilers.
862 For details, see the GNU C Manual; the duplicate list here
863 has been deleted so that we won't get complaints when it
866 But one note about C++ programs only (not C). `\|\c
868 \&\|' has one additional effect for C++: assignment to
870 is permitted. This is the same as the effect of `\|\c
871 .B \-fthis\-is\-variable\c
874 .B \-traditional\-cpp
875 Attempt to support some aspects of traditional C preprocessors.
876 This includes the items that specifically mention the preprocessor above,
877 but none of the other effects of `\|\c
881 .B \-fdollars\-in\-identifiers
882 Permit the use of `\|\c
884 \&\|' in identifiers (C++ only). You can also use
886 .B \-fno\-dollars\-in\-identifiers\c
887 \&\|' to explicitly prohibit use of
890 \&\|'. (GNU C++ allows `\|\c
892 \&\|' by default on some target systems
895 .B \-fenum\-int\-equiv
896 Permit implicit conversion of \c
898 \& to enumeration types (C++
899 only). Normally GNU C++ allows conversion of \c
904 but not the other way around.
906 .B \-fexternal\-templates
907 Produce smaller code for template declarations, by generating only a
908 single copy of each template function where it is defined (C++ only).
909 To use this option successfully, you must also mark all files that
910 use templates with either `\|\c
911 .B #pragma implementation\c
912 \&\|' (the definition) or
914 .B #pragma interface\c
915 \&\|' (declarations).
917 When your code is compiled with `\|\c
918 .B \-fexternal\-templates\c
920 template instantiations are external. You must arrange for all
921 necessary instantiations to appear in the implementation file; you can
924 \& that references each instantiation needed.
925 Conversely, when you compile using the default option
927 .B \-fno\-external\-templates\c
928 \&\|', all template instantiations are
932 Treat all possible member functions as virtual, implicitly. All
933 member functions (except for constructor functions and
937 member operators) are treated as virtual functions of the class where
940 This does not mean that all calls to these member functions will be
941 made through the internal table of virtual functions. Under some
942 circumstances, the compiler can determine that a call to a given
943 virtual function can be made directly; in these cases the calls are
947 Allow conditional expressions with mismatched types in the second and
948 third arguments. The value of such an expression is void.
950 .B \-fthis\-is\-variable
951 Permit assignment to \c
953 \& (C++ only). The incorporation of
954 user-defined free store management into C++ has made assignment to
957 \&\|' an anachronism. Therefore, by default it is invalid to
960 \& within a class member function. However, for
961 backwards compatibility, you can make it valid with
963 .B \-fthis-is-variable\c
969 \& be unsigned, like \c
973 Each kind of machine has a default for what \c
976 be. It is either like \c
978 \& by default or like
982 Ideally, a portable program should always use \c
986 \& when it depends on the signedness of an object.
987 But many programs have been written to use plain \c
990 expect it to be signed, or expect it to be unsigned, depending on the
991 machines they were written for. This option, and its inverse, let you
992 make such a program work with the opposite default.
996 \& is always a distinct type from each of
1000 \&, even though its behavior
1001 is always just like one of those two.
1006 \& be signed, like \c
1010 Note that this is equivalent to `\|\c
1011 .B \-fno\-unsigned\-char\c
1013 the negative form of `\|\c
1014 .B \-funsigned\-char\c
1017 .B \-fno\-signed\-char\c
1018 \&\|' is equivalent to `\|\c
1019 .B \-funsigned\-char\c
1022 .B \-fsigned\-bitfields
1024 .B \-funsigned\-bitfields
1026 .B \-fno\-signed\-bitfields
1028 .B \-fno\-unsigned\-bitfields
1029 These options control whether a bitfield is
1030 signed or unsigned, when declared with no explicit `\|\c
1034 \&\|' qualifier. By default, such a bitfield is
1035 signed, because this is consistent: the basic integer types such as
1037 \& are signed types.
1039 However, when you specify `\|\c
1041 \&\|', bitfields are all unsigned
1044 .B \-fwritable\-strings
1045 Store string constants in the writable data segment and don't uniquize
1046 them. This is for compatibility with old programs which assume they
1047 can write into string constants. `\|\c
1052 Writing into string constants is a very bad idea; \*(lqconstants\*(rq should
1054 .SH PREPROCESSOR OPTIONS
1055 These options control the C preprocessor, which is run on each C source
1056 file before actual compilation.
1058 If you use the `\|\c
1060 \&\|' option, GCC does nothing except preprocessing.
1061 Some of these options make sense only together with `\|\c
1064 they cause the preprocessor output to be unsuitable for actual
1067 .BI "\-include " "file"
1070 \& as input before processing the regular input file.
1071 In effect, the contents of \c
1073 \& are compiled first. Any `\|\c
1078 \&\|' options on the command line are always processed before
1083 \&\|', regardless of the order in which they are
1084 written. All the `\|\c
1089 processed in the order in which they are written.
1091 .BI "\-imacros " file
1094 \& as input, discarding the resulting output, before
1095 processing the regular input file. Because the output generated from
1097 \& is discarded, the only effect of `\|\c
1102 make the macros defined in \c
1104 \& available for use in the main
1105 input. The preprocessor evaluates any `\|\c
1110 on the command line before processing `\|\c
1113 \&\|', regardless of the order in
1114 which they are written. All the `\|\c
1119 options are processed in the order in which they are written.
1121 .BI "\-idirafter " "dir"
1122 Add the directory \c
1124 \& to the second include path. The directories
1125 on the second include path are searched when a header file is not found
1126 in any of the directories in the main include path (the one that
1131 .BI "\-iprefix " "prefix"
1134 \& as the prefix for subsequent `\|\c
1139 .BI "\-iwithprefix " "dir"
1140 Add a directory to the second include path. The directory's name is
1141 made by concatenating \c
1147 was specified previously with `\|\c
1152 Do not search the standard system directories for header files. Only
1153 the directories you have specified with `\|\c
1155 \&\|' options (and the
1156 current directory, if appropriate) are searched.
1162 \&\|', you can limit the include-file search file to only those
1163 directories you specify explicitly.
1166 Do not search for header files in the C++\-specific standard directories,
1167 but do still search the other standard directories.
1168 (This option is used when building `\|\c
1173 Do not predefine any nonstandard macros. (Including architecture flags).
1176 Run only the C preprocessor. Preprocess all the C source files
1177 specified and output the results to standard output or to the
1178 specified output file.
1181 Tell the preprocessor not to discard comments. Used with the
1187 Tell the preprocessor not to generate `\|\c
1195 Tell the preprocessor to output a rule suitable for \c
1197 describing the dependencies of each object file. For each source file,
1198 the preprocessor outputs one \c
1200 \&-rule whose target is the object
1201 file name for that source file and whose dependencies are all the files
1204 \&\|'d in it. This rule may be a single line or may be
1205 continued with `\|\c
1207 \&\|'-newline if it is long. The list of rules is
1208 printed on standard output instead of the preprocessed C program.
1218 \&\|' says to treat missing header files as generated files and assume \c
1219 they live in the same directory as the source file. It must be specified \c
1220 in addition to `\|\c
1227 \&\|' but the output mentions only the user header files
1234 \&\|'. System header files
1246 \&\|' but the dependency information is written to files with
1247 names made by replacing `\|\c
1251 \&\|' at the end of the
1252 output file names. This is in addition to compiling the file as
1253 specified\(em\&`\|\c
1255 \&\|' does not inhibit ordinary compilation the way
1260 The Mach utility `\|\c
1262 \&\|' can be used to merge the `\|\c
1265 into a single dependency file suitable for using with the `\|\c
1273 \&\|' except mention only user header files, not system
1277 Print the name of each header file used, in addition to other normal
1280 .BI "\-A" "question" ( answer )
1285 \&, in case it is tested
1286 with a preprocessor conditional such as `\|\c
1287 .BI "#if #" question ( answer )\c
1290 \&\|' disables the standard
1291 assertions that normally describe the target machine.
1293 .BI "\-A" "question"\c
1297 Assert the answer \c
1301 \&, in case it is tested
1302 with a preprocessor conditional such as `\|\c
1311 \&\|' disables the standard
1312 assertions that normally describe the target machine.
1317 \& with the string `\|\c
1319 \&\|' as its definition.
1321 .BI \-D macro = defn
1326 \&. All instances of `\|\c
1329 the command line are processed before any `\|\c
1338 \&\|' options are evaluated after all `\|\c
1340 \&\|' options, but before any `\|\c
1347 Tell the preprocessor to output only a list of the macro definitions
1348 that are in effect at the end of preprocessing. Used with the `\|\c
1354 Tell the preprocessor to pass all macro definitions into the output, in
1355 their proper sequence in the rest of the output.
1360 \&\|' except that the macro arguments and contents are omitted.
1365 \&\|' is included in the output.
1366 .SH ASSEMBLER OPTION
1368 .BI "\-Wa," "option"
1371 \& as an option to the assembler. If \c
1373 contains commas, it is split into multiple options at the commas.
1375 These options come into play when the compiler links object files into
1376 an executable output file. They are meaningless if the compiler is
1377 not doing a link step.
1380 A file name that does not end in a special recognized suffix is
1381 considered to name an object file or library. (Object files are
1382 distinguished from libraries by the linker according to the file
1383 contents.) If GCC does a link step, these object files are used as input
1387 Use the library named \c
1391 The linker searches a standard list of directories for the library,
1392 which is actually a file named `\|\c
1397 then uses this file as if it had been specified precisely by name.
1399 The directories searched include several standard system directories
1400 plus any that you specify with `\|\c
1404 Normally the files found this way are library files\(em\&archive files
1405 whose members are object files. The linker handles an archive file by
1406 scanning through it for members which define symbols that have so far
1407 been referenced but not defined. However, if the linker finds an
1408 ordinary object file rather than a library, the object file is linked
1409 in the usual fashion. The only difference between using an `\|\c
1411 \&\|' option and specifying a file
1420 \&\|' and searches several directories.
1423 You need this special case of the
1425 option in order to link an Objective C program.
1428 Do not use the standard system startup files when linking.
1429 The standard libraries are used normally.
1432 Don't use the standard system libraries and startup files when linking.
1433 Only the files you specify will be passed to the linker.
1436 On systems that support dynamic linking, this prevents linking with the shared
1437 libraries. On other systems, this option has no effect.
1440 Produce a shared object which can then be linked with other objects to
1441 form an executable. Only a few systems support this option.
1444 Bind references to global symbols when building a shared object. Warn
1445 about any unresolved references (unless overridden by the link editor
1448 \-Xlinker \-z \-Xlinker defs\c
1449 \&\|'). Only a few systems support
1452 .BI "\-Xlinker " "option"
1455 as an option to the linker. You can use this to
1456 supply system-specific linker options which GNU CC does not know how to
1459 If you want to pass an option that takes an argument, you must use
1462 \&\|' twice, once for the option and once for the argument.
1463 For example, to pass `\|\c
1465 \-assert definitions\c
1466 \&\|', you must write
1469 \-Xlinker \-assert \-Xlinker definitions\c
1470 \&\|'. It does not work to write
1473 \-Xlinker "\-assert definitions"\c
1474 \&\|', because this passes the entire
1475 string as a single argument, which is not what the linker expects.
1477 .BI "\-Wl," "option"
1480 \& as an option to the linker. If \c
1483 commas, it is split into multiple options at the commas.
1488 is undefined, to force linking of
1489 library modules to define it. You can use `\|\c
1491 \&\|' multiple times with
1492 different symbols to force loading of additional library modules.
1493 .SH DIRECTORY OPTIONS
1494 These options specify directories to search for header files, for
1495 libraries and for parts of the compiler:
1500 \& to the list of directories searched for include files.
1503 Any directories you specify with `\|\c
1505 \&\|' options before the `\|\c
1508 option are searched only for the case of `\|\c
1515 they are not searched for `\|\c
1523 If additional directories are specified with `\|\c
1528 \&\|', these directories are searched for all `\|\c
1531 directives. (Ordinarily \c
1535 \&\|' directories are used
1538 In addition, the `\|\c
1540 \&\|' option inhibits the use of the current
1541 directory (where the current input file came from) as the first search
1548 \&\|'. There is no way to
1549 override this effect of `\|\c
1553 \&\|' you can specify
1554 searching the directory which was current when the compiler was
1555 invoked. That is not exactly the same as what the preprocessor does
1556 by default, but it is often satisfactory.
1560 \&\|' does not inhibit the use of the standard system directories
1561 for header files. Thus, `\|\c
1571 \& to the list of directories to be searched
1577 This option specifies where to find the executables, libraries and
1578 data files of the compiler itself.
1580 The compiler driver program runs one or more of the subprograms
1585 \&\|' (or, for C++, `\|\c
1593 \& as a prefix for each program it tries to run, both with and
1601 For each subprogram to be run, the compiler driver first tries the
1604 \&\|' prefix, if any. If that name is not found, or if `\|\c
1607 was not specified, the driver tries two standard prefixes, which are
1611 .B /usr/local/lib/gcc-lib/\c
1612 \&\|'. If neither of
1613 those results in a file name that is found, the compiler driver
1614 searches for the unmodified program
1615 name, using the directories specified in your
1618 \&\|' environment variable.
1620 The run-time support file `\|\c
1622 \&\|' is also searched for using the
1625 \&\|' prefix, if needed. If it is not found there, the two
1626 standard prefixes above are tried, and that is all. The file is left
1627 out of the link if it is not found by those means. Most of the time,
1628 on most machines, `\|\c
1630 \&\|' is not actually necessary.
1632 You can get a similar result from the environment variable
1633 .B GCC_EXEC_PREFIX\c
1634 \&; if it is defined, its value is used as a prefix
1635 in the same way. If both the `\|\c
1637 \&\|' option and the
1638 .B GCC_EXEC_PREFIX\c
1639 \& variable are present, the `\|\c
1642 used first and the environment variable value second.
1644 Warnings are diagnostic messages that report constructions which
1645 are not inherently erroneous but which are risky or suggest there
1646 may have been an error.
1648 These options control the amount and kinds of warnings produced by GNU
1652 Check the code for syntax errors, but don't emit any output.
1655 Inhibit all warning messages.
1658 Inhibit warning messages about the use of
1662 Issue all the warnings demanded by strict ANSI standard C; reject
1663 all programs that use forbidden extensions.
1665 Valid ANSI standard C programs should compile properly with or without
1666 this option (though a rare few will require `\|\c
1669 without this option, certain GNU extensions and traditional C features
1670 are supported as well. With this option, they are rejected. There is
1673 \& this option; it exists only to satisfy pedants.
1677 \&\|' does not cause warning messages for use of the
1678 alternate keywords whose names begin and end with `\|\c
1681 warnings are also disabled in the expression that follows
1682 .B _\|_extension_\|_\c
1683 \&. However, only system header files should use
1684 these escape routes; application programs should avoid them.
1686 .B \-pedantic\-errors
1689 \&\|', except that errors are produced rather than
1693 Print extra warning messages for these events:
1696 A nonvolatile automatic variable might be changed by a call to
1698 \&. These warnings are possible only in
1699 optimizing compilation.
1701 The compiler sees only the calls to \c
1706 \& will be called; in fact, a signal handler could
1707 call it at any point in the code. As a result, you may get a warning
1708 even when there is in fact no problem because \c
1711 in fact be called at the place which would cause a problem.
1714 A function can return either with or without a value. (Falling
1715 off the end of the function body is considered returning without
1716 a value.) For example, this function would evoke such a
1727 Spurious warnings can occur because GNU CC does not realize that
1728 certain functions (including \c
1736 An expression-statement or the left-hand side of a comma expression
1737 contains no side effects.
1738 To suppress the warning, cast the unused expression to void.
1739 For example, an expression such as `\|\c
1741 \&\|' will cause a warning,
1747 An unsigned value is compared against zero with `\|\c
1755 Warn whenever a declaration does not specify a type.
1757 .B \-Wimplicit-function-declaration
1758 Warn whenever a function is used before being declared.
1761 Same as -Wimplicit-int and -Wimplicit-function-declaration.
1766 function is declared or defined with a suspicious type.
1767 Typically, it is a function with external linkage, returning
1770 taking zero or two arguments.
1774 Warn whenever a function is defined with a return-type that defaults
1777 \&. Also warn about any \c
1779 \& statement with no
1780 return-value in a function whose return-type is not \c
1785 Warn whenever a local variable is unused aside from its declaration,
1786 whenever a function is declared static but never defined, and whenever
1787 a statement computes a result that is explicitly not used.
1792 \& statement has an index of enumeral type
1795 \& for one or more of the named codes of that
1796 enumeration. (The presence of a \c
1798 \& label prevents this
1801 \& labels outside the enumeration range also
1802 provoke warnings when this option is used.
1805 Warn whenever a comment-start sequence `\|\c
1807 \&\|' appears in a comment.
1810 Warn if any trigraphs are encountered (assuming they are enabled).
1817 \&, etc., to make sure that
1818 the arguments supplied have types appropriate to the format string
1821 .B \-Wchar\-subscripts
1822 Warn if an array subscript has type
1824 This is a common cause of error, as programmers often forget that this
1825 type is signed on some machines.
1828 An automatic variable is used without first being initialized.
1830 These warnings are possible only in optimizing compilation,
1831 because they require data flow information that is computed only
1832 when optimizing. If you don't specify `\|\c
1834 \&\|', you simply won't
1837 These warnings occur only for variables that are candidates for
1838 register allocation. Therefore, they do not occur for a variable that
1841 \&, or whose address is taken, or whose size
1842 is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
1843 structures, unions or arrays, even when they are in registers.
1845 Note that there may be no warning about a variable that is used only
1846 to compute a value that itself is never used, because such
1847 computations may be deleted by data flow analysis before the warnings
1850 These warnings are made optional because GNU CC is not smart
1851 enough to see all the reasons why the code might be correct
1852 despite appearing to have an error. Here is one example of how
1872 \& is always 1, 2 or 3, then \c
1875 always initialized, but GNU CC doesn't know this. Here is
1876 another common case:
1881 if (change_y) save_y = y, y = new_y;
1883 if (change_y) y = save_y;
1887 This has no bug because \c
1889 \& is used only if it is set.
1891 Some spurious warnings can be avoided if you declare as
1893 \& all the functions you use that never return.
1896 Warn if parentheses are omitted in certain contexts.
1898 .B \-Wtemplate\-debugging
1899 When using templates in a C++ program, warn if debugging is not yet
1900 fully available (C++ only).
1903 All of the above `\|\c
1905 \&\|' options combined. These are all the
1906 options which pertain to usage that we recommend avoiding and that we
1907 believe is easy to avoid, even in conjunction with macros.
1911 \&\|' options are not implied by `\|\c
1914 because they warn about constructions that we consider reasonable to
1915 use, on occasion, in clean programs.
1918 Warn about certain constructs that behave differently in traditional and
1922 Macro arguments occurring within string constants in the macro body.
1923 These would substitute the argument in traditional C, but are part of
1924 the constant in ANSI C.
1927 A function declared external in one block and then used after the end of
1933 \& statement has an operand of type \c
1939 Warn whenever a local variable shadows another local variable.
1941 .BI "\-Wid\-clash\-" "len"
1942 Warn whenever two distinct identifiers match in the first \c
1944 characters. This may help you prepare a program that will compile
1945 with certain obsolete, brain-damaged compilers.
1947 .B \-Wpointer\-arith
1948 Warn about anything that depends on the \*(lqsize of\*(rq a function type or
1951 \&. GNU C assigns these types a size of 1, for
1952 convenience in calculations with \c
1954 \& pointers and pointers
1958 Warn whenever a pointer is cast so as to remove a type qualifier from
1959 the target type. For example, warn if a \c
1960 .B const char \(**\c
1967 Warn whenever a pointer is cast such that the required alignment of the
1968 target is increased. For example, warn if a \c
1973 \& on machines where integers can only be accessed at
1974 two- or four-byte boundaries.
1976 .B \-Wwrite\-strings
1977 Give string constants the type \c
1982 copying the address of one into a non-\c
1986 pointer will get a warning. These warnings will help you find at
1987 compile time code that can try to write into a string constant, but
1988 only if you have been very careful about using \c
1991 declarations and prototypes. Otherwise, it will just be a nuisance;
1992 this is why we did not make `\|\c
1994 \&\|' request these warnings.
1997 Warn if a prototype causes a type conversion that is different from what
1998 would happen to the same argument in the absence of a prototype. This
1999 includes conversions of fixed point to floating and vice versa, and
2000 conversions changing the width or signedness of a fixed point argument
2001 except when the same as the default promotion.
2003 .B \-Waggregate\-return
2004 Warn if any functions that return structures or unions are defined or
2005 called. (In languages where you can return an array, this also elicits
2008 .B \-Wstrict\-prototypes
2009 Warn if a function is declared or defined without specifying the
2010 argument types. (An old-style function definition is permitted without
2011 a warning if preceded by a declaration which specifies the argument
2014 .B \-Wmissing\-prototypes
2015 Warn if a global function is defined without a previous prototype
2016 declaration. This warning is issued even if the definition itself
2017 provides a prototype. The aim is to detect global functions that fail
2018 to be declared in header files.
2020 .B \-Wmissing\-declarations
2021 Warn if a global function is defined without a previous declaration.
2022 Do so even if the definition itself provides a prototype.
2023 Use this option to detect global functions that are not declared in
2026 .B \-Wredundant-decls
2027 Warn if anything is declared more than once in the same scope, even in
2028 cases where multiple declaration is valid and changes nothing.
2030 .B \-Wnested-externs
2033 \& declaration is encountered within a function.
2036 Warn about conversion between different enumeration types (C++ only).
2041 type is used. This is default. To inhibit
2042 the warning messages, use flag `\|\c
2043 .B \-Wno\-long\-long\c
2045 .B \-W\-long\-long\c
2047 .B \-Wno\-long\-long\c
2048 \&\|' are taken into account only when flag `\|\c
2052 .B \-Woverloaded\-virtual
2054 In a derived class, the definitions of virtual functions must match
2055 the type signature of a virtual function declared in the base class.
2056 Use this option to request warnings when a derived class declares a
2057 function that may be an erroneous attempt to define a virtual
2058 function: that is, warn when a function with the same name as a
2059 virtual function in the base class, but with a type signature that
2060 doesn't match any virtual functions from the base class.
2063 Warn if a function can not be inlined, and either it was declared as inline,
2065 .B \-finline\-functions
2069 Treat warnings as errors; abort compilation after any warning.
2070 .SH DEBUGGING OPTIONS
2071 GNU CC has various special options that are used for debugging
2072 either your program or GCC:
2075 Produce debugging information in the operating system's native format
2076 (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
2079 On most systems that use stabs format, `\|\c
2081 \&\|' enables use of extra
2082 debugging information that only GDB can use; this extra information
2083 makes debugging work better in GDB but will probably make other debuggers
2085 refuse to read the program. If you want to control for certain whether
2086 to generate the extra information, use `\|\c
2102 Unlike most other C compilers, GNU CC allows you to use `\|\c
2107 \&\|'. The shortcuts taken by optimized code may occasionally
2108 produce surprising results: some variables you declared may not exist
2109 at all; flow of control may briefly move where you did not expect it;
2110 some statements may not be executed because they compute constant
2111 results or their values were already at hand; some statements may
2112 execute in different places because they were moved out of loops.
2114 Nevertheless it proves possible to debug optimized output. This makes
2115 it reasonable to use the optimizer for programs that might have bugs.
2117 The following options are useful when GNU CC is generated with the
2118 capability for more than one debugging format.
2121 Produce debugging information in the native format (if that is supported),
2122 including GDB extensions if at all possible.
2125 Produce debugging information in stabs format (if that is supported),
2126 without GDB extensions. This is the format used by DBX on most BSD
2130 Produce debugging information in stabs format (if that is supported),
2131 using GNU extensions understood only by the GNU debugger (GDB). The
2132 use of these extensions is likely to make other debuggers crash or
2133 refuse to read the program.
2136 Produce debugging information in COFF format (if that is supported).
2137 This is the format used by SDB on most System V systems prior to
2141 Produce debugging information in XCOFF format (if that is supported).
2142 This is the format used by the DBX debugger on IBM RS/6000 systems.
2145 Produce debugging information in XCOFF format (if that is supported),
2146 using GNU extensions understood only by the GNU debugger (GDB). The
2147 use of these extensions is likely to make other debuggers crash or
2148 refuse to read the program.
2151 Produce debugging information in DWARF format (if that is supported).
2152 This is the format used by SDB on most System V Release 4 systems.
2155 Produce debugging information in DWARF format (if that is supported),
2156 using GNU extensions understood only by the GNU debugger (GDB). The
2157 use of these extensions is likely to make other debuggers crash or
2158 refuse to read the program.
2162 .BI "\-ggdb" "level"
2164 .BI "\-gstabs" "level"
2166 .BI "\-gcoff" "level"
2167 .BI "\-gxcoff" "level"
2169 .BI "\-gdwarf" "level"
2170 Request debugging information and also use \c
2173 much information. The default level is 2.
2175 Level 1 produces minimal information, enough for making backtraces in
2176 parts of the program that you don't plan to debug. This includes
2177 descriptions of functions and external variables, but no information
2178 about local variables and no line numbers.
2180 Level 3 includes extra information, such as all the macro definitions
2181 present in the program. Some debuggers support macro expansion when
2187 Generate extra code to write profile information suitable for the
2193 Generate extra code to write profile information suitable for the
2199 Generate extra code to write profile information for basic blocks,
2200 which will record the number of times each basic block is executed.
2201 This data could be analyzed by a program like \c
2204 however, that the format of the data is not what \c
2209 \& should be extended to process this data.
2212 Generate extra code to read basic block profiling parameters from
2213 file `bb.in' and write profiling results to file `bb.out'.
2214 `bb.in' contains a list of functions. Whenever a function on the list
2215 is entered, profiling is turned on. When the outmost function is left,
2216 profiling is turned off. If a function name is prefixed with `-'
2217 the function is excluded from profiling. If a function name is not
2218 unique it can be disambiguated by writing
2219 `/path/filename.d:functionname'. `bb.out' will list some available
2221 Four function names have a special meaning:
2222 `__bb_jumps__' will cause jump frequencies to be written to `bb.out'.
2223 `__bb_trace__' will cause the sequence of basic blocks to be piped
2224 into `gzip' and written to file `bbtrace.gz'.
2225 `__bb_hidecall__' will cause call instructions to be excluded from
2227 `__bb_showret__' will cause return instructions to be included in
2231 Says to make debugging dumps during compilation at times specified by
2233 \&. This is used for debugging the compiler. The file names
2234 for most of the dumps are made by appending a word to the source file
2242 Dump all macro definitions, at the end of preprocessing, and write no
2246 Dump all macro names, at the end of preprocessing.
2249 Dump all macro definitions, at the end of preprocessing, in addition to
2253 Dump debugging information during parsing, to standard error.
2256 Dump after RTL generation, to `\|\c
2262 Just generate RTL for a function instead of compiling it. Usually used
2268 Dump after first jump optimization, to `\|\c
2274 Dump after CSE (including the jump optimization that sometimes
2275 follows CSE), to `\|\c
2281 Dump after loop optimization, to `\|\c
2287 Dump after the second CSE pass (including the jump optimization that
2288 sometimes follows CSE), to `\|\c
2294 Dump after flow analysis, to `\|\c
2300 Dump after instruction combination, to `\|\c
2306 Dump after the first instruction scheduling pass, to
2313 Dump after local register allocation, to `\|\c
2319 Dump after global register allocation, to `\|\c
2325 Dump after the second instruction scheduling pass, to
2332 Dump after last jump optimization, to `\|\c
2338 Dump after delayed branch scheduling, to `\|\c
2344 Dump after conversion from registers to stack, to `\|\c
2350 Produce all the dumps listed above.
2353 Print statistics on memory usage, at the end of the run, to
2357 Annotate the assembler output with a comment indicating which
2358 pattern and alternative was used.
2360 .B \-fpretend\-float
2361 When running a cross-compiler, pretend that the target machine uses the
2362 same floating point format as the host machine. This causes incorrect
2363 output of the actual floating constants, but the actual instruction
2364 sequence will probably be the same as GNU CC would make when running on
2368 Store the usual \*(lqtemporary\*(rq intermediate files permanently; place them
2369 in the current directory and name them based on the source file. Thus,
2373 .B \-c \-save\-temps\c
2374 \&\|' would produce files
2379 \&\|', as well as `\|\c
2383 .BI "\-print\-file\-name=" "library"
2384 Print the full absolute name of the library file \|\c
2389 would be used when linking\(em\&and do not do anything else. With this
2390 option, GNU CC does not compile or link anything; it just prints the
2393 .B \-print\-libgcc\-file\-name
2395 .B \-print\-file\-name=libgcc.a\c
2398 .BI "\-print\-prog\-name=" "program"
2400 .B \-print\-file\-name\c
2401 \&\|', but searches for a program such as `\|\c
2404 .SH OPTIMIZATION OPTIONS
2405 These options control various sorts of optimizations:
2410 Optimize. Optimizing compilation takes somewhat more time, and a lot
2411 more memory for a large function.
2415 \&\|', the compiler's goal is to reduce the cost of
2416 compilation and to make debugging produce the expected results.
2417 Statements are independent: if you stop the program with a breakpoint
2418 between statements, you can then assign a new value to any variable or
2419 change the program counter to any other statement in the function and
2420 get exactly the results you would expect from the source code.
2424 \&\|', only variables declared \c
2427 allocated in registers. The resulting compiled code is a little worse
2428 than produced by PCC without `\|\c
2434 \&\|', the compiler tries to reduce code size and execution
2437 When you specify `\|\c
2439 \&\|', the two options `\|\c
2440 .B \-fthread\-jumps\c
2443 \&\|' are turned on. On machines that have delay slots, the `\|\c
2444 .B \-fdelayed\-branch\c
2445 \&\|' option is turned on. For those machines that can support debugging even
2446 without a frame pointer, the `\|\c
2447 .B \-fomit\-frame\-pointer\c
2448 \&\|' option is turned on. On some machines other flags may also be turned on.
2451 Optimize even more. Nearly all supported optimizations that do not
2452 involve a space-speed tradeoff are performed. Loop unrolling and function
2453 inlining are not done, for example. As compared to
2456 this option increases both compilation time and the performance of the
2460 Optimize yet more. This turns on everything
2462 does, along with also turning on
2463 .B \-finline\-functions.
2466 Optimize for size. This enables all
2468 optimizations that do not typically increase code size. It also performs
2469 further optimizations designed to reduce code size.
2476 options, with or without level numbers, the last such option is the
2477 one that is effective.
2479 Options of the form `\|\c
2483 \&\|' specify machine-independent
2484 flags. Most flags have both positive and negative forms; the negative
2487 \&\|' would be `\|\c
2489 \&\|'. The following list shows
2490 only one form\(em\&the one which is not the default.
2491 You can figure out the other form by either removing `\|\c
2497 Do not store floating point variables in registers. This
2498 prevents undesirable excess precision on machines such as the
2499 68000 where the floating registers (of the 68881) keep more
2502 \& is supposed to have.
2504 For most programs, the excess precision does only good, but a few
2505 programs rely on the precise definition of IEEE floating point.
2507 .B \-ffloat\-store\c
2508 \&\|' for such programs.
2510 .B \-fmemoize\-lookups
2512 .B \-fsave\-memoized
2513 Use heuristics to compile faster (C++ only). These heuristics are not
2514 enabled by default, since they are only effective for certain input
2515 files. Other input files compile more slowly.
2517 The first time the compiler must build a call to a member function (or
2518 reference to a data member), it must (1) determine whether the class
2519 implements member functions of that name; (2) resolve which member
2520 function to call (which involves figuring out what sorts of type
2521 conversions need to be made); and (3) check the visibility of the member
2522 function to the caller. All of this adds up to slower compilation.
2523 Normally, the second time a call is made to that member function (or
2524 reference to that data member), it must go through the same lengthy
2525 process again. This means that code like this
2527 \& cout << "This " << p << " has " << n << " legs.\en";
2529 makes six passes through all three steps. By using a software cache,
2530 a \*(lqhit\*(rq significantly reduces this cost. Unfortunately, using the
2531 cache introduces another layer of mechanisms which must be implemented,
2532 and so incurs its own overhead. `\|\c
2533 .B \-fmemoize\-lookups\c
2537 Because access privileges (visibility) to members and member functions
2538 may differ from one function context to the next,
2540 may need to flush the cache. With the `\|\c
2541 .B \-fmemoize\-lookups\c
2542 \&\|' flag, the cache is flushed after every
2543 function that is compiled. The `\|\c
2545 \&\|' flag enables the same software cache, but when the compiler
2546 determines that the context of the last function compiled would yield
2547 the same access privileges of the next function to compile, it
2548 preserves the cache.
2549 This is most helpful when defining many member functions for the same
2550 class: with the exception of member functions which are friends of
2551 other classes, each member function has exactly the same access
2552 privileges as every other, and the cache need not be flushed.
2554 .B \-fno\-default\-inline
2555 Don't make member functions inline by default merely because they are
2556 defined inside the class scope (C++ only).
2558 .B \-fno\-defer\-pop
2559 Always pop the arguments to each function call as soon as that
2560 function returns. For machines which must pop arguments after a
2561 function call, the compiler normally lets arguments accumulate on the
2562 stack for several function calls and pops them all at once.
2565 Force memory operands to be copied into registers before doing
2566 arithmetic on them. This may produce better code by making all
2567 memory references potential common subexpressions. When they are
2568 not common subexpressions, instruction combination should
2569 eliminate the separate register-load. I am interested in hearing
2570 about the difference this makes.
2573 Force memory address constants to be copied into registers before
2574 doing arithmetic on them. This may produce better code just as
2577 \&\|' may. I am interested in hearing about the
2578 difference this makes.
2580 .B \-fomit\-frame\-pointer
2581 Don't keep the frame pointer in a register for functions that
2582 don't need one. This avoids the instructions to save, set up and
2583 restore frame pointers; it also makes an extra register available
2584 in many functions. \c
2585 .I It also makes debugging impossible on most machines\c
2588 On some machines, such as the Vax, this flag has no effect, because
2589 the standard calling sequence automatically handles the frame pointer
2590 and nothing is saved by pretending it doesn't exist. The
2591 machine-description macro \c
2592 .B FRAME_POINTER_REQUIRED\c
2594 whether a target machine supports this flag.
2596 .B \-finline\-functions
2597 Integrate all simple functions into their callers. The compiler
2598 heuristically decides which functions are simple enough to be worth
2599 integrating in this way.
2601 If all calls to a given function are integrated, and the function is
2604 \&, then GCC normally does not output the function as
2605 assembler code in its own right.
2608 Enable values to be allocated in registers that will be clobbered by
2609 function calls, by emitting extra instructions to save and restore the
2610 registers around such calls. Such allocation is done only when it
2611 seems to result in better code than would otherwise be produced.
2613 This option is enabled by default on certain machines, usually those
2614 which have no call-preserved registers to use instead.
2616 .B \-fkeep\-inline\-functions
2617 Even if all calls to a given function are integrated, and the function
2620 \&, nevertheless output a separate run-time
2621 callable version of the function.
2623 .B \-fno\-function\-cse
2624 Do not put function addresses in registers; make each instruction that
2625 calls a constant function contain the function's address explicitly.
2627 This option results in less efficient code, but some strange hacks
2628 that alter the assembler output may be confused by the optimizations
2629 performed when this option is not used.
2632 Disable any machine-specific peephole optimizations.
2635 This option allows GCC to violate some ANSI or IEEE rules/specifications
2636 in the interest of optimizing code for speed. For example, it allows
2637 the compiler to assume arguments to the \c
2640 non-negative numbers.
2642 This option should never be turned on by any `\|\c
2645 it can result in incorrect output for programs which depend on
2646 an exact implementation of IEEE or ANSI rules/specifications for
2649 The following options control specific optimizations. The `\|\c
2652 option turns on all of these optimizations except `\|\c
2653 .B \-funroll\-loops\c
2656 .B \-funroll\-all\-loops\c
2661 \&\|' option usually turns on
2663 .B \-fthread\-jumps\c
2665 .B \-fdelayed\-branch\c
2667 specific machines may change the default optimizations.
2669 You can use the following flags in the rare cases when \*(lqfine-tuning\*(rq
2670 of optimizations to be performed is desired.
2672 .B \-fstrength\-reduce
2673 Perform the optimizations of loop strength reduction and
2674 elimination of iteration variables.
2677 Perform optimizations where we check to see if a jump branches to a
2678 location where another comparison subsumed by the first is found. If
2679 so, the first branch is redirected to either the destination of the
2680 second branch or a point immediately following it, depending on whether
2681 the condition is known to be true or false.
2684 Perform the optimization of loop unrolling. This is only done for loops
2685 whose number of iterations can be determined at compile time or run time.
2687 .B \-funroll\-all\-loops
2688 Perform the optimization of loop unrolling. This is done for all loops.
2689 This usually makes programs run more slowly.
2691 .B \-fcse\-follow\-jumps
2692 In common subexpression elimination, scan through jump instructions
2693 when the target of the jump is not reached by any other path. For
2694 example, when CSE encounters an \c
2696 \& statement with an
2698 \& clause, CSE will follow the jump when the condition
2701 .B \-fcse\-skip\-blocks
2702 This is similar to `\|\c
2703 .B \-fcse\-follow\-jumps\c
2704 \&\|', but causes CSE to
2705 follow jumps which conditionally skip over blocks. When CSE
2706 encounters a simple \c
2708 \& statement with no else clause,
2710 .B \-fcse\-skip\-blocks\c
2711 \&\|' causes CSE to follow the jump around the
2716 .B \-frerun\-cse\-after\-loop
2717 Re-run common subexpression elimination after loop optimizations has been
2720 .B \-felide\-constructors
2721 Elide constructors when this seems plausible (C++ only). With this
2722 flag, GNU C++ initializes \c
2724 \& directly from the call to \c
2726 without going through a temporary in the following code:
2731 Without this option, GNU C++ first initializes \c
2734 appropriate constructor for type \c
2736 \&; then assigns the result of
2738 \& to a temporary; and, finally, replaces the initial value of
2741 \&\|' with the temporary.
2743 The default behavior (`\|\c
2744 .B \-fno\-elide\-constructors\c
2745 \&\|') is specified by
2746 the draft ANSI C++ standard. If your program's constructors have side
2747 effects, using `\|\c
2748 .B \-felide-constructors\c
2749 \&\|' can make your program act
2750 differently, since some constructor calls may be omitted.
2752 .B \-fexpensive\-optimizations
2753 Perform a number of minor optimizations that are relatively expensive.
2755 .B \-fdelayed\-branch
2756 If supported for the target machine, attempt to reorder instructions
2757 to exploit instruction slots available after delayed branch
2760 .B \-fschedule\-insns
2761 If supported for the target machine, attempt to reorder instructions to
2762 eliminate execution stalls due to required data being unavailable. This
2763 helps machines that have slow floating point or memory load instructions
2764 by allowing other instructions to be issued until the result of the load
2765 or floating point instruction is required.
2767 .B \-fschedule\-insns2
2769 .B \-fschedule\-insns\c
2770 \&\|', but requests an additional pass of
2771 instruction scheduling after register allocation has been done. This is
2772 especially useful on machines with a relatively small number of
2773 registers and where memory load instructions take more than one cycle.
2775 By default, GNU CC compiles code for the same type of machine that you
2776 are using. However, it can also be installed as a cross-compiler, to
2777 compile for some other type of machine. In fact, several different
2778 configurations of GNU CC, for different target machines, can be
2779 installed side by side. Then you specify which one to use with the
2784 In addition, older and newer versions of GNU CC can be installed side
2785 by side. One of them (probably the newest) will be the default, but
2786 you may sometimes wish to use another.
2788 .BI "\-b " "machine"
2791 \& specifies the target machine for compilation.
2792 This is useful when you have installed GNU CC as a cross-compiler.
2794 The value to use for \c
2796 \& is the same as was specified as the
2797 machine type when configuring GNU CC as a cross-compiler. For
2798 example, if a cross-compiler was configured with `\|\c
2801 \&\|', meaning to compile for an 80386 running System V, then you
2804 \&\|' to run that cross compiler.
2806 When you do not specify `\|\c
2808 \&\|', it normally means to compile for
2809 the same type of machine that you are using.
2811 .BI "\-V " "version"
2814 \& specifies which version of GNU CC to run.
2815 This is useful when multiple versions are installed. For example,
2819 \&\|', meaning to run GNU CC version 2.0.
2821 The default version, when you do not specify `\|\c
2823 \&\|', is controlled
2824 by the way GNU CC is installed. Normally, it will be a version that
2825 is recommended for general use.
2826 .SH MACHINE DEPENDENT OPTIONS
2827 Each of the target machine types can have its own special options,
2830 \&\|', to choose among various hardware models or
2831 configurations\(em\&for example, 68010 vs 68020, floating coprocessor or
2832 none. A single installed version of the compiler can compile for any
2833 model or configuration, according to the options specified.
2835 Some configurations of the compiler also support additional special
2836 options, usually for command-line compatibility with other compilers on
2841 \&\|' options defined for the 68000 series:
2846 Generate output for a 68000. This is the default when the compiler is
2847 configured for 68000-based systems.
2852 Generate output for a 68020 (rather than a 68000). This is the
2853 default when the compiler is configured for 68020-based systems.
2856 Generate output containing 68881 instructions for floating point.
2857 This is the default for most 68020-based systems unless
2859 was specified when the compiler was configured.
2862 Generate output for a 68030. This is the default when the compiler is
2863 configured for 68030-based systems.
2866 Generate output for a 68040. This is the default when the compiler is
2867 configured for 68040-based systems.
2870 Generate output for a 68040, without using any of the new instructions.
2871 This results in code which can run relatively efficiently on either a
2872 68020/68881 or a 68030 or a 68040.
2875 Generate output containing Sun FPA instructions for floating point.
2878 Generate output containing library calls for floating point.
2881 the requisite libraries are not part of GNU CC. Normally the
2882 facilities of the machine's usual C compiler are used, but this can't
2883 be done directly in cross-compilation. You must make your own
2884 arrangements to provide suitable library functions for cross-compilation.
2889 \& to be 16 bits wide, like \c
2894 Do not use the bit-field instructions. `\|\c
2902 Do use the bit-field instructions. `\|\c
2907 \&\|'. This is the default if you use the unmodified
2911 Use a different function-calling convention, in which functions
2912 that take a fixed number of arguments return with the \c
2914 instruction, which pops their arguments while returning. This
2915 saves one instruction in the caller since there is no need to pop
2916 the arguments there.
2918 This calling convention is incompatible with the one normally
2919 used on Unix, so you cannot use it if you need to call libraries
2920 compiled with the Unix compiler.
2922 Also, you must provide function prototypes for all functions that
2923 take variable numbers of arguments (including \c
2926 otherwise incorrect code will be generated for calls to those
2929 In addition, seriously incorrect code will result if you call a
2930 function with too many arguments. (Normally, extra arguments are
2931 harmlessly ignored.)
2935 \& instruction is supported by the 68010 and 68020
2936 processors, but not by the 68000.
2940 \&\|' options are defined for the Vax:
2943 Do not output certain jump instructions (\c
2946 that the Unix assembler for the Vax cannot handle across long
2950 Do output those jump instructions, on the assumption that you
2951 will assemble with the GNU assembler.
2954 Output code for g-format floating point numbers instead of d-format.
2958 \&\|' switches are supported on the SPARC:
2963 Generate output containing floating point instructions. This is the
2969 Generate output containing library calls for floating point.
2971 there is no GNU floating-point library for SPARC.
2972 Normally the facilities of the machine's usual C compiler are used, but
2973 this cannot be done directly in cross-compilation. You must make your
2974 own arrangements to provide suitable library functions for
2978 changes the calling convention in the output file;
2979 therefore, it is only useful if you compile
2981 of a program with this option.
2988 (the default), the compiler always emits code for
2989 function exit at the end of each function. Any function exit in
2990 the middle of the function (such as a return statement in C) will
2991 generate a jump to the exit code at the end of the function.
2994 .BR \-mno\-epilogue ,
2995 the compiler tries to emit exit code inline at every function exit.
3002 These three options select variations on the SPARC architecture.
3004 By default (unless specifically configured for the Fujitsu SPARClite),
3005 GCC generates code for the v7 variant of the SPARC architecture.
3008 will give you SPARC v8 code. The only difference from v7
3009 code is that the compiler emits the integer multiply and integer
3010 divide instructions which exist in SPARC v8 but not in SPARC v7.
3013 will give you SPARClite code. This adds the integer
3014 multiply, integer divide step and scan (ffs) instructions which
3015 exist in SPARClite but not in SPARC v7.
3020 These two options select the processor for which the code is optimized.
3024 (the default), the compiler optimizes code for the Cypress CY7C602 chip, as
3025 used in the SparcStation/SparcServer 3xx series. This is also appropriate for
3026 the older SparcStation 1, 2, IPX etc.
3030 the compiler optimizes code for the SuperSparc cpu, as used in the SparcStation
3031 10, 1000 and 2000 series. This flag also enables use of the full SPARC v8
3036 \&\|' options are defined for the Convex:
3039 Generate output for a C1. This is the default when the compiler is
3040 configured for a C1.
3043 Generate output for a C2. This is the default when the compiler is
3044 configured for a C2.
3047 Generate code which puts an argument count in the word preceding each
3048 argument list. Some nonportable Convex and Vax programs need this word.
3049 (Debuggers don't, except for functions with variable-length argument
3050 lists; this info is in the symbol table.)
3053 Omit the argument count word. This is the default if you use the
3058 \&\|' options are defined for the AMD Am29000:
3061 Generate code that assumes the DW bit is set, i.e., that byte and
3062 halfword operations are directly supported by the hardware. This is the
3066 Generate code that assumes the DW bit is not set.
3069 Generate code that assumes the system supports byte and halfword write
3070 operations. This is the default.
3073 Generate code that assumes the systems does not support byte and
3074 halfword write operations. This implies `\|\c
3079 Use a small memory model that assumes that all function addresses are
3080 either within a single 256 KB segment or at an absolute address of less
3081 than 256K. This allows the \c
3083 \& instruction to be used instead
3093 Do not assume that the \c
3095 \& instruction can be used; this is the
3099 Generate code for the Am29050.
3102 Generate code for the Am29000. This is the default.
3104 .B \-mkernel\-registers
3105 Generate references to registers \c
3109 \&. This option can be used when compiling kernel code
3110 that wants a set of global registers disjoint from that used by
3113 Note that when this option is used, register names in `\|\c
3116 must use the normal, user-mode, names.
3118 .B \-muser\-registers
3119 Use the normal set of global registers, \c
3127 \& after each stack adjustment. This
3128 is often used for kernel code.
3132 \&\|' options are defined for Motorola 88K architectures:
3135 Generate code that works well on both the m88100 and the
3139 Generate code that works best for the m88100, but that also
3143 Generate code that works best for the m88110, and may not run
3146 .B \-midentify\-revision
3149 \& directive in the assembler output recording the
3150 source file name, compiler name and version, timestamp, and compilation
3153 .B \-mno\-underscores
3154 In assembler output, emit symbol names without adding an underscore
3155 character at the beginning of each name. The default is to use an
3156 underscore as prefix on each name.
3158 .B \-mno\-check\-zero\-division
3160 .B \-mcheck\-zero\-division
3161 Early models of the 88K architecture had problems with division by zero;
3162 in particular, many of them didn't trap. Use these options to avoid
3163 including (or to include explicitly) additional code to detect division
3164 by zero and signal an exception. All GCC configurations for the 88K use
3166 .B \-mcheck\-zero\-division\c
3169 .B \-mocs\-debug\-info
3171 .B \-mno\-ocs\-debug\-info
3172 Include (or omit) additional debugging information (about
3173 registers used in each stack frame) as specified in the 88Open Object
3174 Compatibility Standard, \*(lqOCS\*(rq. This extra information is not needed
3175 by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to
3176 include this information; other 88k configurations omit this information
3179 .B \-mocs\-frame\-position
3181 .B \-mno\-ocs\-frame\-position
3182 Force (or do not require) register values to be stored in a particular
3183 place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2,
3184 and BCS configurations use `\|\c
3185 .B \-mocs\-frame\-position\c
3187 configurations have the default `\|\c
3188 .B \-mno\-ocs\-frame\-position\c
3191 .B \-moptimize\-arg\-area
3193 .B \-mno\-optimize\-arg\-area
3194 Control how to store function arguments in stack frames.
3196 .B \-moptimize\-arg\-area\c
3197 \&\|' saves space, but may break some
3198 debuggers (not GDB). `\|\c
3199 .B \-mno\-optimize\-arg\-area\c
3200 \&\|' conforms better to
3201 standards. By default GCC does not optimize the argument area.
3203 .BI "\-mshort\-data\-" "num"
3205 Generate smaller data references by making them relative to \c
3208 which allows loading a value using a single instruction (rather than the
3209 usual two). You control which data references are affected by
3212 \& with this option. For example, if you specify
3214 .B \-mshort\-data\-512\c
3215 \&\|', then the data references affected are those
3216 involving displacements of less than 512 bytes.
3218 .B \-mshort\-data\-\c
3221 \&\|' is not effective for \c
3226 .B \-mserialize-volatile
3228 .B \-mno-serialize-volatile
3229 Do, or do not, generate code to guarantee sequential consistency of
3230 volatile memory references.
3232 GNU CC always guarantees consistency by default, for the preferred
3233 processor submodel. How this is done depends on the submodel.
3235 The m88100 processor does not reorder memory references and so always
3236 provides sequential consistency. If you use `\|\c
3239 not generate any special instructions for sequential consistency.
3241 The order of memory references made by the m88110 processor does not
3242 always match the order of the instructions requesting those references.
3243 In particular, a load instruction may execute before a preceding store
3244 instruction. Such reordering violates sequential consistency of
3245 volatile memory references, when there are multiple processors. When
3250 \&\|', GNU CC generates special
3251 instructions when appropriate, to force execution in the proper order.
3253 The extra code generated to guarantee consistency may affect the
3254 performance of your application. If you know that you can safely forgo
3255 this guarantee, you may use the option `\|\c
3256 .B \-mno-serialize-volatile\c
3259 If you use the `\|\c
3261 \&\|' option but require sequential consistency
3262 when running on the m88110 processor, you should use
3264 .B \-mserialize-volatile\c
3272 \&\|') or off (`\|\c
3274 \&\|') compiler extensions
3275 related to System V release 4 (SVr4). This controls the following:
3278 Which variant of the assembler syntax to emit (which you can select
3279 independently using `\|\c
3280 .B \-mversion\-03.00\c
3286 \&\|' makes the C preprocessor recognize `\|\c
3293 \&\|' makes GCC issue additional declaration directives used in
3298 \&\|' is the default for all m88K configurations except
3299 the SVr4 configuration.
3301 .B \-mtrap\-large\-shift
3303 .B \-mhandle\-large\-shift
3304 Include code to detect bit-shifts of more than 31 bits; respectively,
3305 trap such shifts or emit code to handle them properly. By default GCC
3306 makes no special provision for large bit shifts.
3308 .B \-muse\-div\-instruction
3309 Very early models of the 88K architecture didn't have a divide
3310 instruction, so GCC avoids that instruction by default. Use this option
3311 to specify that it's safe to use the divide instruction.
3313 .B \-mversion\-03.00
3314 In the DG/UX configuration, there are two flavors of SVr4. This option
3317 to select whether the hybrid-COFF or real-ELF
3318 flavor is used. All other configurations ignore this option.
3320 .B \-mwarn\-passed\-structs
3321 Warn when a function passes a struct as an argument or result.
3322 Structure-passing conventions have changed during the evolution of the C
3323 language, and are often the source of portability problems. By default,
3324 GCC issues no such warning.
3326 These options are defined for the IBM RS6000:
3330 .B \-mno\-fp\-in\-toc
3331 Control whether or not floating-point constants go in the Table of
3332 Contents (TOC), a table of all global variable and function addresses. By
3333 default GCC puts floating-point constants there; if the TOC overflows,
3335 .B \-mno\-fp\-in\-toc\c
3336 \&\|' will reduce the size of the TOC, which may avoid
3341 \&\|' options are defined for the IBM RT PC:
3344 Use an in-line code sequence for integer multiplies. This is the
3347 .B \-mcall\-lib\-mul
3350 \& for integer multiples.
3352 .B \-mfull\-fp\-blocks
3353 Generate full-size floating point data blocks, including the minimum
3354 amount of scratch space recommended by IBM. This is the default.
3356 .B \-mminimum\-fp\-blocks
3357 Do not include extra scratch space in floating point data blocks. This
3358 results in smaller code, but slower execution, since scratch space must
3359 be allocated dynamically.
3361 .B \-mfp\-arg\-in\-fpregs
3362 Use a calling sequence incompatible with the IBM calling convention in
3363 which floating point arguments are passed in floating point registers.
3368 \& will not work with
3369 floating point operands if this option is specified.
3371 .B \-mfp\-arg\-in\-gregs
3372 Use the normal calling convention for floating point arguments. This is
3375 .B \-mhc\-struct\-return
3376 Return structures of more than one word in memory, rather than in a
3377 register. This provides compatibility with the MetaWare HighC (hc)
3379 .B \-fpcc\-struct\-return\c
3380 \&\|' for compatibility with the
3381 Portable C Compiler (pcc).
3383 .B \-mnohc\-struct\-return
3384 Return some structures of more than one word in registers, when
3385 convenient. This is the default. For compatibility with the
3386 IBM-supplied compilers, use either `\|\c
3387 .B \-fpcc\-struct\-return\c
3390 .B \-mhc\-struct\-return\c
3395 \&\|' options are defined for the MIPS family of computers:
3397 .BI "\-mcpu=" "cpu-type"
3398 Assume the defaults for the machine type
3401 scheduling instructions. The default
3405 which picks the longest cycles times for any of the machines, in order
3406 that the code run at reasonable rates on all MIPS cpu's. Other
3415 While picking a specific
3417 will schedule things appropriately for that particular chip, the
3418 compiler will not generate any code that does not meet level 1 of the
3419 MIPS ISA (instruction set architecture) without the
3423 switches being used.
3426 Issue instructions from level 2 of the MIPS ISA (branch likely, square
3427 root instructions). The
3431 switch must be used in conjunction with
3435 Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
3438 switch must be used in conjunction with
3446 These options don't work at present.
3449 Generate code for the MIPS assembler, and invoke
3451 to add normal debug information. This is the default for all
3452 platforms except for the OSF/1 reference platform, using the OSF/rose
3453 object format. If any of the
3458 switches are used, the
3460 program will encapsulate the stabs within MIPS ECOFF.
3463 Generate code for the GNU assembler. This is the default on the OSF/1
3464 reference platform, using the OSF/rose object format.
3471 switch says to output code using the MIPS software names for the
3472 registers, instead of the hardware names (ie,
3476 The GNU assembler does not support the
3478 switch, and the MIPS assembler will be instructed to run the MIPS C
3479 preprocessor over the source file. The
3488 switch says to write all of the data declarations before the
3489 instructions in the text section, to all the MIPS assembler to
3490 generate one word memory references instead of using two words for
3491 short global or static data items. This is on by default if
3492 optimization is selected.
3497 For each non-inline function processed, the
3499 switch causes the compiler to emit one line to the standard error file
3500 to print statistics about the program (number of registers saved,
3508 switch makes all block moves call the appropriate string function
3512 instead of possibly generating inline code.
3516 .B \-mno\-mips\-tfile
3518 .B \-mno\-mips\-tfile
3519 switch causes the compiler not postprocess the object file with the
3521 program, after the MIPS assembler has generated it to add debug
3524 is not run, then no local variables will be available to the debugger.
3529 objects will have the temporary file names passed to the assembler
3530 embedded in the object file, which means the objects will not compare
3534 Generate output containing library calls for floating point.
3537 the requisite libraries are not part of GNU CC. Normally the
3538 facilities of the machine's usual C compiler are used, but this can't
3539 be done directly in cross-compilation. You must make your own
3540 arrangements to provide suitable library functions for cross-compilation.
3543 Generate output containing floating point instructions. This is the
3544 default if you use the unmodified sources.
3549 bit in the status word is on, and that there are 32 64-bit floating
3550 point registers, instead of 32 32-bit floating point registers. You
3551 must also specify the
3558 Assume that there are 32 32-bit floating point registers. This is the
3564 Emit (or do not emit) the
3569 pseudo operations that some System V.4 ports use for position
3577 switch says to put pointers to extern references into the data section
3578 and load them up, rather than put the references in the text section.
3579 This option does not work at present.
3582 Put global and static items less than or equal to
3584 bytes into the small data or bss sections instead of the normal data
3585 or bss section. This allows the assembler to emit one word memory
3586 reference instructions based on the global pointer
3590 instead of the normal two words used. By default,
3592 is 8 when the MIPS assembler is used, and 0 when the GNU
3593 assembler is used. The
3595 switch is also passed to the assembler and linker. All modules should
3596 be compiled with the same
3601 Tell the MIPS assembler to not run its preprocessor over user
3602 assembler files (with a `\|\c
3604 \&\|' suffix) when assembling them.
3608 \&\|' options are defined for the Intel 80386 family of computers:
3613 Control whether or not code is optimized for a 486 instead of an
3614 386. Code generated for a 486 will run on a 386 and vice versa.
3622 .B \-mcpu=pentiumpro
3624 .B \-mcpu=\fIcpu type\fP
3625 Assume the defaults for the machine type CPU TYPE when scheduling instructions.
3626 The choices for CPU TYPE are:
3635 While picking a specific CPU TYPE will schedule things appropriately for that
3636 particular chip, the compiler will not generate any code that does not run on
3637 the i386 without the
3638 .B \-march=\fIcpu type\fP
3641 .B \-march=\fIcpu type\fP
3642 Generate instructions for the machine type CPU TYPE. The choices for CPU TYPE
3650 .B \-march=\fIcpu type\fP
3652 .B \-mcpu=\fIcpu type\fP.
3655 Generate output containing library calls for floating point.
3657 the requisite libraries are not part of GNU CC.
3658 Normally the facilities of the machine's usual C compiler are used, but
3659 this can't be done directly in cross-compilation. You must make your
3660 own arrangements to provide suitable library functions for
3663 On machines where a function returns floating point results in the 80387
3664 register stack, some floating point opcodes may be emitted even if
3669 .B \-mno-fp-ret-in-387
3670 Do not use the FPU registers for return values of functions.
3672 The usual calling convention has functions return values of types
3676 \& in an FPU register, even if there
3677 is no FPU. The idea is that the operating system should emulate
3681 .B \-mno-fp-ret-in-387\c
3682 \&\|' causes such values to be returned
3683 in ordinary CPU registers instead.
3685 .B \-mprofiler-epilogue
3687 .B \-mno-profiler-epilogue
3688 Generate extra code to write profile information for function exits.
3692 \&\|' options are defined for the HPPA family of computers:
3695 Generate code for a PA 1.0 processor.
3698 Generate code for a PA 1.1 processor.
3701 Generate code which is suitable for use in kernels. Specifically, avoid
3703 \& instructions in which one of the arguments is the DP register;
3706 \& instructions instead. This avoids a rather serious
3707 bug in the HP-UX linker.
3710 Generate code that can be linked against HP-UX shared libraries. This option
3711 is not fully function yet, and is not on by default for any PA target. Using
3712 this option can cause incorrect code to be generated by the compiler.
3714 .B \-mno-shared-libs
3715 Don't generate code that will be linked against shared libraries. This is
3716 the default for all PA targets.
3719 Generate code which allows calls to functions greater than 256K away from
3720 the caller when the caller and callee are in the same source file. Do
3721 not turn this option on unless code refuses to link with \*(lqbranch out of
3722 range errors\*('' from the linker.
3724 .B \-mdisable-fpregs
3725 Prevent floating point registers from being used in any manner. This is
3726 necessary for compiling kernels which perform lazy context switching of
3727 floating point registers. If you use this option and attempt to perform
3728 floating point operations, the compiler will abort.
3730 .B \-mdisable-indexing
3731 Prevent the compiler from using indexing address modes. This avoids some
3732 rather obscure problems when compiling MIG generated code under MACH.
3734 .B \-mtrailing-colon
3735 Add a colon to the end of label definitions (for ELF assemblers).
3739 \&\|' options are defined for the Intel 80960 family of computers:
3741 .BI "\-m" "cpu-type"
3742 Assume the defaults for the machine type
3744 for instruction and addressing-mode availability and alignment.
3763 option indicates that the processor does support
3764 floating-point instructions. The
3767 that floating-point support should not be assumed.
3769 .B \-mleaf\-procedures
3771 .B \-mno\-leaf\-procedures
3772 Do (or do not) attempt to alter leaf procedures to be callable with the
3774 instruction as well as
3776 This will result in more
3777 efficient code for explicit calls when the
3780 substituted by the assembler or linker, but less efficient code in other
3781 cases, such as calls via function pointers, or using a linker that doesn't
3782 support this optimization.
3786 .B \-mno\-tail\-call
3787 Do (or do not) make additional attempts (beyond those of the
3788 machine-independent portions of the compiler) to optimize tail-recursive
3789 calls into branches. You may not want to do this because the detection of
3790 cases where this is not valid is not totally complete. The default is
3791 .BR \-mno\-tail\-call .
3795 .B \-mno\-complex\-addr
3796 Assume (or do not assume) that the use of a complex addressing mode is a
3797 win on this implementation of the i960. Complex addressing modes may not
3798 be worthwhile on the K-series, but they definitely are on the C-series.
3799 The default is currently
3801 for all processors except
3806 .B \-mno\-code\-align
3807 Align code to 8-byte boundaries for faster fetching (or don't bother).
3808 Currently turned on by default for C-series implementations only.
3815 Enable compatibility with iC960 v2.0 or v3.0.
3820 Enable compatibility with the iC960 assembler.
3824 .B \-mno\-strict\-align
3825 Do not permit (do permit) unaligned accesses.
3828 Enable structure-alignment compatibility with Intel's gcc release version
3829 1.3 (based on gcc 1.37). Currently this is buggy in that
3831 is always assumed as well, and cannot be turned off.
3835 \&\|' options are defined for the DEC Alpha implementations:
3840 Use (do not use) the hardware floating-point instructions for
3841 floating-point operations. When \c
3846 \&\|' will be used to perform floating-point
3847 operations. Unless they are replaced by routines that emulate the
3848 floating-point operations, or compiled in such a way as to call such
3849 emulations routines, these routines will issue floating-point
3850 operations. If you are compiling for an Alpha without floating-point
3851 operations, you must ensure that the library is built so as not to call
3854 Note that Alpha implementations without floating-point operations are
3855 required to have floating-point registers.
3860 Generate code that uses (does not use) the floating-point register set.
3864 \&. If the floating-point
3865 register set is not used, floating point operands are passed in integer
3866 registers as if they were integers and floating-point results are passed
3867 in $0 instead of $f0. This is a non-standard calling sequence, so any
3868 function with a floating-point argument or return value called by code
3871 \& must also be compiled with that
3874 A typical use of this option is building a kernel that does not use,
3875 and hence need not save and restore, any floating-point registers.
3877 These additional options are available on System V Release 4 for
3878 compatibility with other compilers on those systems:
3883 \& accepts the option `\|\c
3886 it to the system linker), for compatibility with other compilers.
3887 However, we suggest you use `\|\c
3892 appropriate, instead of supplying linker options on the \c
3897 Identify the versions of each tool used by the compiler, in a
3899 \& assembler directive in the output.
3902 Refrain from adding \c
3904 \& directives to the output file (this is
3908 Search the directories \c
3910 \&, and no others, for libraries
3911 specified with `\|\c
3913 \&\|'. You can separate directory entries in
3915 \& from one another with colons.
3918 Look in the directory \c
3920 \& to find the M4 preprocessor.
3921 The assembler uses this option.
3922 .SH CODE GENERATION OPTIONS
3923 These machine-independent options control the interface conventions
3924 used in code generation.
3926 Most of them begin with `\|\c
3928 \&\|'. These options have both positive and negative forms; the negative form
3931 \&\|' would be `\|\c
3933 \&\|'. In the table below, only
3934 one of the forms is listed\(em\&the one which is not the default. You
3935 can figure out the other form by either removing `\|\c
3940 .B \-fnonnull\-objects
3941 Assume that objects reached through references are not null
3944 Normally, GNU C++ makes conservative assumptions about objects reached
3945 through references. For example, the compiler must check that \c
3947 is not null in code like the following:
3952 Checking that references of this sort have non-null values requires
3953 extra code, however, and it is unnecessary for many programs. You can
3955 .B \-fnonnull-objects\c
3956 \&\|' to omit the checks for null, if your
3957 program doesn't require checking.
3959 .B \-fpcc\-struct\-return
3960 Use the same convention for returning \c
3964 values that is used by the usual C compiler on your system. This
3965 convention is less efficient for small structures, and on many
3966 machines it fails to be reentrant; but it has the advantage of
3967 allowing intercallability between GCC-compiled code and PCC-compiled
3970 .B \-freg\-struct\-return
3971 Use the convention that
3975 values are returned in registers when possible. This is more
3976 efficient for small structures than
3977 .BR \-fpcc\-struct\-return .
3979 If you specify neither
3980 .B \-fpcc\-struct\-return
3982 .BR \-freg\-struct\-return ,
3983 GNU CC defaults to whichever convention is standard for the target.
3984 If there is no standard convention, GNU CC defaults to
3985 .BR \-fpcc\-struct\-return .
3990 \& type only as many bytes as it needs for the
3991 declared range of possible values. Specifically, the \c
3994 will be equivalent to the smallest integer type which has enough room.
3997 Use the same size for
4004 Requests that the data and non-\c
4006 \& variables of this
4007 compilation be shared data rather than private data. The distinction
4008 makes sense only on certain operating systems, where shared data is
4009 shared between processes running the same program, while private data
4010 exists in one copy per process.
4013 Allocate even uninitialized global variables in the bss section of the
4014 object file, rather than generating them as common blocks. This has the
4015 effect that if the same variable is declared (without \c
4018 two different compilations, you will get an error when you link them.
4019 The only reason this might be useful is if you wish to verify that the
4020 program will work on other systems which always work this way.
4027 .B \-fno\-gnu\-linker
4028 Do not output global initializations (such as C++ constructors and
4029 destructors) in the form used by the GNU linker (on systems where the GNU
4030 linker is the standard method of handling them). Use this option when
4031 you want to use a non-GNU linker, which also requires using the
4033 \& program to make sure the system linker includes
4034 constructors and destructors. (\c
4036 \& is included in the GNU CC
4037 distribution.) For systems which \c
4044 \& is configured to do this automatically.
4046 .B \-finhibit-size-directive
4049 \& assembler directive, or anything else that
4050 would cause trouble if the function is split in the middle, and the
4051 two halves are placed at locations far apart in memory. This option is
4052 used when compiling `\|\c
4054 \&\|'; you should not need to use it
4058 Put extra commentary information in the generated assembly code to
4059 make it more readable. This option is generally only of use to those
4060 who actually need to read the generated assembly code (perhaps while
4061 debugging the compiler itself).
4064 Consider all memory references through pointers to be volatile.
4066 .B \-fvolatile\-global
4067 Consider all memory references to extern and global data items to
4071 If supported for the target machines, generate position-independent code,
4072 suitable for use in a shared library.
4075 If supported for the target machine, emit position-independent code,
4076 suitable for dynamic linking, even if branches need large displacements.
4078 .BI "\-ffixed\-" "reg"
4079 Treat the register named \c
4081 \& as a fixed register; generated code
4082 should never refer to it (except perhaps as a stack pointer, frame
4083 pointer or in some other fixed role).
4086 \& must be the name of a register. The register names accepted
4087 are machine-specific and are defined in the \c
4089 macro in the machine description macro file.
4091 This flag does not have a negative form, because it specifies a
4094 .BI "\-fcall\-used\-" "reg"
4095 Treat the register named \c
4097 \& as an allocable register that is
4098 clobbered by function calls. It may be allocated for temporaries or
4099 variables that do not live across a call. Functions compiled this way
4100 will not save and restore the register \c
4104 Use of this flag for a register that has a fixed pervasive role in the
4105 machine's execution model, such as the stack pointer or frame pointer,
4106 will produce disastrous results.
4108 This flag does not have a negative form, because it specifies a
4111 .BI "\-fcall\-saved\-" "reg"
4112 Treat the register named \c
4114 \& as an allocable register saved by
4115 functions. It may be allocated even for temporaries or variables that
4116 live across a call. Functions compiled this way will save and restore
4121 Use of this flag for a register that has a fixed pervasive role in the
4122 machine's execution model, such as the stack pointer or frame pointer,
4123 will produce disastrous results.
4125 A different sort of disaster will result from the use of this flag for
4126 a register in which function values may be returned.
4128 This flag does not have a negative form, because it specifies a
4133 \&\|' directives are supported for GNU C++, to permit using the same
4134 header file for two purposes: as a definition of interfaces to a given
4135 object class, and as the full definition of the contents of that object class.
4137 .B #pragma interface
4139 Use this directive in header files that define object classes, to save
4140 space in most of the object files that use those classes. Normally,
4141 local copies of certain information (backup copies of inline member
4142 functions, debugging information, and the internal tables that
4143 implement virtual functions) must be kept in each object file that
4144 includes class definitions. You can use this pragma to avoid such
4145 duplication. When a header file containing `\|\c
4146 .B #pragma interface\c
4147 \&\|' is included in a compilation, this auxiliary information
4148 will not be generated (unless the main input source file itself uses
4150 .B #pragma implementation\c
4151 \&\|'). Instead, the object files will contain references to be
4152 resolved at link time.
4154 .B #pragma implementation
4156 \fB#pragma implementation "\fP\fIobjects\fP\fB.h"\fP
4158 Use this pragma in a main input file, when you want full output from
4159 included header files to be generated (and made globally visible).
4160 The included header file, in turn, should use `\|\c
4161 .B #pragma interface\c
4163 Backup copies of inline member functions, debugging information, and
4164 the internal tables used to implement virtual functions are all
4165 generated in implementation files.
4168 .B #pragma implementation\c
4169 \&\|' with no argument, it applies to an include file with the same
4170 basename as your source file; for example, in `\|\c
4173 .B #pragma implementation\c
4174 \&\|' by itself is equivalent to `\|\c
4176 #pragma implementation "allclass.h"\c
4177 \&\|'. Use the string argument if you want a single implementation
4178 file to include code from multiple header files.
4180 There is no way to split up the contents of a single header file into
4181 multiple implementation files.
4184 .ta \w'LIBDIR/g++\-include 'u
4185 file.c C source file
4186 file.h C header (preprocessor) file
4187 file.i preprocessed C source file
4188 file.C C++ source file
4189 file.cc C++ source file
4190 file.cxx C++ source file
4191 file.m Objective-C source file
4192 file.s assembly language file
4194 a.out link edited output
4195 \fITMPDIR\fR/cc\(** temporary files
4196 \fILIBDIR\fR/cpp preprocessor
4197 \fILIBDIR\fR/cc1 compiler for C
4198 \fILIBDIR\fR/cc1plus compiler for C++
4199 \fILIBDIR\fR/collect linker front end needed on some machines
4200 \fILIBDIR\fR/libgcc.a GCC subroutine library
4201 /lib/crt[01n].o start-up routine
4202 \fILIBDIR\fR/ccrt0 additional start-up routine for C++
4203 /lib/libc.a standard C library, see
4205 /usr/include standard directory for \fB#include\fP files
4206 \fILIBDIR\fR/include standard gcc directory for \fB#include\fP files
4207 \fILIBDIR\fR/g++\-include additional g++ directory for \fB#include\fP
4212 .B /usr/local/lib/\c
4213 .IR machine / version .
4216 comes from the environment variable
4224 as(1), cpp(1), gdb(1), ld(1)
4226 .RB "`\|" gcc "\|', `\|" cpp \|',
4227 .RB "`\|" as "\|', `\|" ld \|',
4235 Using and Porting GNU CC (for version 2.0)\c
4236 , Richard M. Stallman;
4238 The C Preprocessor\c
4239 , Richard M. Stallman;
4241 Debugging with GDB: the GNU Source-Level Debugger\c
4242 , Richard M. Stallman and Roland H. Pesch;
4244 Using as: the GNU Assembler\c
4245 , Dean Elsner, Jay Fenlason & friends;
4247 ld: the GNU linker\c
4248 , Steve Chamberlain and Roland Pesch.
4250 For instructions on reporting bugs, see the GCC manual.
4254 1991, 1992, 1993 Free Software Foundation, Inc.
4256 Permission is granted to make and distribute verbatim copies of
4257 this manual provided the copyright notice and this permission notice
4258 are preserved on all copies.
4260 Permission is granted to copy and distribute modified versions of this
4261 manual under the conditions for verbatim copying, provided that the
4262 entire resulting derived work is distributed under the terms of a
4263 permission notice identical to this one.
4265 Permission is granted to copy and distribute translations of this
4266 manual into another language, under the above conditions for modified
4267 versions, except that this permission notice may be included in
4268 translations approved by the Free Software Foundation instead of in
4269 the original English.
4271 See the GNU CC Manual for the contributors to GNU CC.