2 .\" Copyright (c) 1991, 1992, 1993, 1994 Free Software Foundation -*-Text-*-
3 .\" See section COPYING for conditions for redistribution
5 .\" Set up \*(lq, \*(rq if -man hasn't already set it up.
9 . if !@@\(lq@ .ds lq "\(lq
14 . if !@@\(rq@ .ds rq "\(rq
24 .Id $Id: gcc.1,v 1.9 1998/12/16 20:55:57 law Exp $
25 .TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
27 gcc, g++ \- GNU project C and C++ Compiler
30 .RI "[ " option " | " filename " ].\|.\|."
33 .RI "[ " option " | " filename " ].\|.\|."
35 The information in this man page is an extract from the full
36 documentation of the GNU C compiler, and is limited to the meaning of
39 This man page is not kept up to date except when volunteers want to
40 maintain it. If you find a discrepancy between the man page and the
41 software, please check the Info file, which is the authoritative
44 If we find that the things in this man page that are out of date cause
45 significant confusion or complaints, we will stop distributing the man
46 page. The alternative, updating the man page when we update the Info
47 file, is impossible because the rest of the work of maintaining GNU CC
48 leaves us no time for that. The GNU project regards man pages as
49 obsolete and should not let them take time away from other things.
51 For complete and current documentation, refer to the Info file `\|\c
55 Using and Porting GNU CC (for version 2.0)\c
56 \&. Both are made from the Texinfo source file
59 The C and C++ compilers are integrated. Both process input files
60 through one or more of four stages: preprocessing, compilation,
61 assembly, and linking. Source filename suffixes identify the source
62 language, but which name you use for the compiler governs default
66 assumes preprocessed (\c
68 \&) files are C and assumes C style linking.
71 assumes preprocessed (\c
73 \&) files are C++ and assumes C++ style linking.
75 Suffixes of source file names indicate the language and kind of
76 processing to be done:
80 \&\fB.c\fP C source; preprocess, compile, assemble
81 \&\fB.C\fP C++ source; preprocess, compile, assemble
82 \&\fB.cc\fP C++ source; preprocess, compile, assemble
83 \&\fB.cxx\fP C++ source; preprocess, compile, assemble
84 \&\fB.m\fP Objective-C source; preprocess, compile, assemble
85 \&\fB.i\fP preprocessed C; compile, assemble
86 \&\fB.ii\fP preprocessed C++; compile, assemble
87 \&\fB.s\fP Assembler source; assemble
88 \&\fB.S\fP Assembler source; preprocess, assemble
89 \&\fB.h\fP Preprocessor file; not usually named on command line
92 Files with other suffixes are passed to the linker. Common cases include:
95 \&\fB.o\fP Object file
96 \&\fB.a\fP Archive file
100 Linking is always the last stage unless you use one of the
105 options to avoid it (or unless compilation errors stop the whole
106 process). For the link stage, all
108 files corresponding to source files,
110 libraries, unrecognized filenames (including named
115 are passed to the linker in command-line order.
117 Options must be separate: `\|\c
119 \&\|' is quite different from `\|\c
127 \&\|' options have two contrary forms:
135 \&). Only the non-default forms are shown here.
137 Here is a summary of all the options, grouped by type. Explanations are
138 in the following sections.
156 \-fdollars\-in\-identifiers
158 \-fexternal\-templates
165 \-fno\-strict\-prototype
168 \-fthis\-is\-variable
169 \-funsigned\-bitfields
192 .RI \-Wid\-clash\- len
195 \-Wimplicit\-function\-declaration
199 \-Wmissing\-prototypes
200 \-Wmissing\-declarations
208 \-Wstrict\-prototypes
210 \-Wtemplate\-debugging
234 .RI \-print\-file\-name= library
235 \-print\-libgcc\-file\-name
236 .RI \-print\-prog\-name= program
238 .B Optimization Options
240 \-fcse\-follow\-jumps
243 \-felide\-constructors
244 \-fexpensive\-optimizations
250 \-fkeep\-inline\-functions
252 \-fno\-default\-inline
257 \-fomit\-frame\-pointer
258 \-frerun\-cse\-after\-loop
263 \-funroll\-all\-loops
271 .B Preprocessor Options
277 .RI \-D macro [\|= defn \|]
280 .RI "\-idirafter " dir
281 .RI "\-include " file
282 .RI "\-imacros " file
283 .RI "\-iprefix " file
284 .RI "\-iwithprefix " dir
304 .RI "\-Xlinker\ " option
318 .B Configuration Dependent Options
382 \-mcheck\-zero\-division
383 \-mhandle\-large\-shift
384 \-midentify\-revision
385 \-mno\-check\-zero\-division
386 \-mno\-ocs\-debug\-info
387 \-mno\-ocs\-frame\-position
388 \-mno\-optimize\-arg\-area
389 \-mno\-serialize\-volatile
392 \-mocs\-frame\-position
393 \-moptimize\-arg\-area
394 \-mserialize\-volatile
395 .RI \-mshort\-data\- num
398 \-mtrap\-large\-shift
399 \-muse\-div\-instruction
401 \-mwarn\-passed\-structs
411 \-mfp\-arg\-in\-fpregs
412 \-mfp\-arg\-in\-gregs
414 \-mhc\-struct\-return
416 \-mminimum\-fp\-blocks
417 \-mnohc\-struct\-return
421 \-mcpu=\fIcpu type\fP
455 \-mcpu=\fIcpu type\fP
456 \-march=\fIcpu type\fP
462 \-mno\-fp\-ret\-in\-387
464 \-mno\-wide\-multiply
467 \-mprofiler\-epilogue
488 \-mno\-leaf\-procedures
520 .B Code Generation Options
521 .RI \-fcall\-saved\- reg
522 .RI \-fcall\-used\- reg
524 \-finhibit\-size\-directive
529 \-fpcc\-struct\-return
532 \-freg\-struct\-return
541 .SH FreeBSD SPECIFIC OPTIONS
544 Link a user-threaded process against libc_r instead of libc.
547 .BI "\-x " "language"
548 Specify explicitly the
550 \& for the following input files (rather than choosing a default based
551 on the file name suffix) . This option applies to all following input
552 files until the next `\|\c
554 \&\|' option. Possible values of \c
571 .B assembler\-with\-cpp\c
575 Turn off any specification of a language, so that subsequent files are
576 handled according to their file name suffixes (as they are if `\|\c
579 has not been used at all).
581 If you want only some of the four stages (preprocess, compile,
582 assemble, link), you can use
585 \&\|' (or filename suffixes) to tell \c
587 \& where to start, and
588 one of the options `\|\c
596 \& is to stop. Note that some combinations (for example,
598 .B \-x cpp\-output \-E\c
601 \& to do nothing at all.
604 Compile or assemble the source files, but do not link. The compiler
605 output is an object file corresponding to each source file.
607 By default, GCC makes the object file name for a source file by replacing
614 \&\|', etc., with `\|\c
618 \& to select another name.
620 GCC ignores any unrecognized input files (those that do not require
621 compilation or assembly) with the
626 Stop after the stage of compilation proper; do not assemble. The output
627 is an assembler code file for each non-assembler input
630 By default, GCC makes the assembler file name for a source file by
631 replacing the suffix `\|\c
635 \&\|', etc., with `\|\c
639 \& to select another name.
641 GCC ignores any input files that don't require compilation.
644 Stop after the preprocessing stage; do not run the compiler proper. The
645 output is preprocessed source code, which is sent to the
648 GCC ignores input files which don't require preprocessing.
651 Place output in file \c
653 \&. This applies regardless to whatever
654 sort of output GCC is producing, whether it be an executable file,
655 an object file, an assembler file or preprocessed C code.
657 Since only one output file can be specified, it does not make sense to
660 \&\|' when compiling more than one input file, unless you are
661 producing an executable file as output.
663 If you do not specify `\|\c
665 \&\|', the default is to put an executable file
668 \&\|', the object file for `\|\c
677 \&\|', its assembler file in `\|\c
681 all preprocessed C source on standard output.
684 Print (on standard error output) the commands executed to run the stages
685 of compilation. Also print the version number of the compiler driver
686 program and of the preprocessor and the compiler proper.
689 Use pipes rather than temporary files for communication between the
690 various stages of compilation. This fails to work on some systems where
691 the assembler cannot read from a pipe; but the GNU assembler has
695 The following options control the dialect of C that the compiler
699 Support all ANSI standard C programs.
701 This turns off certain features of GNU C that are incompatible with
702 ANSI C, such as the \c
708 keywords, and predefined macros such as \c
712 that identify the type of system you are using. It also enables the
713 undesirable and rarely used ANSI trigraph feature, and disallows `\|\c
715 \&\|' as part of identifiers.
717 The alternate keywords \c
720 .B _\|_extension_\|_\c
725 \& continue to work despite
728 \&\|'. You would not want to use them in an ANSI C program, of
729 course, but it is useful to put them in header files that might be included
730 in compilations done with `\|\c
732 \&\|'. Alternate predefined macros
737 \& are also available, with or
744 \&\|' option does not cause non-ANSI programs to be
745 rejected gratuitously. For that, `\|\c
752 The preprocessor predefines a macro \c
753 .B _\|_STRICT_ANSI_\|_\c
754 \& when you use the `\|\c
757 option. Some header files may notice this macro and refrain
758 from declaring certain functions or defining certain macros that the
759 ANSI standard doesn't call for; this is to avoid interfering with any
760 programs that might use these names for other things.
770 keyword. These words may then be used as identifiers. You can
785 Don't recognize built-in functions that do not begin with two leading
786 underscores. Currently, the functions affected include \c
820 \&\|' option prevents \c
825 being builtin functions.
828 Compile for a hosted environment; this implies the `\|\c
830 \&\|' option, and implies that suspicious declarations of
832 \& should be warned about.
835 Compile for a freestanding environment; this implies the `\|\c
837 \&\|' option, and implies that
839 \& has no special requirements.
841 .B \-fno\-strict\-prototype
842 Treat a function declaration with no arguments, such as `\|\c
845 \&\|', as C would treat it\(em\&as saying nothing about the number of
846 arguments or their types (C++ only). Normally, such a declaration in
847 C++ means that the function \c
849 \& takes no arguments.
852 Support ANSI C trigraphs. The `\|\c
854 \&\|' option implies `\|\c
859 Attempt to support some aspects of traditional C compilers.
860 For details, see the GNU C Manual; the duplicate list here
861 has been deleted so that we won't get complaints when it
864 But one note about C++ programs only (not C). `\|\c
866 \&\|' has one additional effect for C++: assignment to
868 is permitted. This is the same as the effect of `\|\c
869 .B \-fthis\-is\-variable\c
872 .B \-traditional\-cpp
873 Attempt to support some aspects of traditional C preprocessors.
874 This includes the items that specifically mention the preprocessor above,
875 but none of the other effects of `\|\c
879 .B \-fdollars\-in\-identifiers
880 Permit the use of `\|\c
882 \&\|' in identifiers (C++ only). You can also use
884 .B \-fno\-dollars\-in\-identifiers\c
885 \&\|' to explicitly prohibit use of
888 \&\|'. (GNU C++ allows `\|\c
890 \&\|' by default on some target systems
893 .B \-fenum\-int\-equiv
894 Permit implicit conversion of \c
896 \& to enumeration types (C++
897 only). Normally GNU C++ allows conversion of \c
902 but not the other way around.
904 .B \-fexternal\-templates
905 Produce smaller code for template declarations, by generating only a
906 single copy of each template function where it is defined (C++ only).
907 To use this option successfully, you must also mark all files that
908 use templates with either `\|\c
909 .B #pragma implementation\c
910 \&\|' (the definition) or
912 .B #pragma interface\c
913 \&\|' (declarations).
915 When your code is compiled with `\|\c
916 .B \-fexternal\-templates\c
918 template instantiations are external. You must arrange for all
919 necessary instantiations to appear in the implementation file; you can
922 \& that references each instantiation needed.
923 Conversely, when you compile using the default option
925 .B \-fno\-external\-templates\c
926 \&\|', all template instantiations are
930 Treat all possible member functions as virtual, implicitly. All
931 member functions (except for constructor functions and
935 member operators) are treated as virtual functions of the class where
938 This does not mean that all calls to these member functions will be
939 made through the internal table of virtual functions. Under some
940 circumstances, the compiler can determine that a call to a given
941 virtual function can be made directly; in these cases the calls are
945 Allow conditional expressions with mismatched types in the second and
946 third arguments. The value of such an expression is void.
948 .B \-fthis\-is\-variable
949 Permit assignment to \c
951 \& (C++ only). The incorporation of
952 user-defined free store management into C++ has made assignment to
955 \&\|' an anachronism. Therefore, by default it is invalid to
958 \& within a class member function. However, for
959 backwards compatibility, you can make it valid with
961 .B \-fthis-is-variable\c
967 \& be unsigned, like \c
971 Each kind of machine has a default for what \c
974 be. It is either like \c
976 \& by default or like
980 Ideally, a portable program should always use \c
984 \& when it depends on the signedness of an object.
985 But many programs have been written to use plain \c
988 expect it to be signed, or expect it to be unsigned, depending on the
989 machines they were written for. This option, and its inverse, let you
990 make such a program work with the opposite default.
994 \& is always a distinct type from each of
998 \&, even though its behavior
999 is always just like one of those two.
1004 \& be signed, like \c
1008 Note that this is equivalent to `\|\c
1009 .B \-fno\-unsigned\-char\c
1011 the negative form of `\|\c
1012 .B \-funsigned\-char\c
1015 .B \-fno\-signed\-char\c
1016 \&\|' is equivalent to `\|\c
1017 .B \-funsigned\-char\c
1020 .B \-fsigned\-bitfields
1022 .B \-funsigned\-bitfields
1024 .B \-fno\-signed\-bitfields
1026 .B \-fno\-unsigned\-bitfields
1027 These options control whether a bitfield is
1028 signed or unsigned, when declared with no explicit `\|\c
1032 \&\|' qualifier. By default, such a bitfield is
1033 signed, because this is consistent: the basic integer types such as
1035 \& are signed types.
1037 However, when you specify `\|\c
1039 \&\|', bitfields are all unsigned
1042 .B \-fwritable\-strings
1043 Store string constants in the writable data segment and don't uniquize
1044 them. This is for compatibility with old programs which assume they
1045 can write into string constants. `\|\c
1050 Writing into string constants is a very bad idea; \*(lqconstants\*(rq should
1052 .SH PREPROCESSOR OPTIONS
1053 These options control the C preprocessor, which is run on each C source
1054 file before actual compilation.
1056 If you use the `\|\c
1058 \&\|' option, GCC does nothing except preprocessing.
1059 Some of these options make sense only together with `\|\c
1062 they cause the preprocessor output to be unsuitable for actual
1065 .BI "\-include " "file"
1068 \& as input before processing the regular input file.
1069 In effect, the contents of \c
1071 \& are compiled first. Any `\|\c
1076 \&\|' options on the command line are always processed before
1081 \&\|', regardless of the order in which they are
1082 written. All the `\|\c
1087 processed in the order in which they are written.
1089 .BI "\-imacros " file
1092 \& as input, discarding the resulting output, before
1093 processing the regular input file. Because the output generated from
1095 \& is discarded, the only effect of `\|\c
1100 make the macros defined in \c
1102 \& available for use in the main
1103 input. The preprocessor evaluates any `\|\c
1108 on the command line before processing `\|\c
1111 \&\|', regardless of the order in
1112 which they are written. All the `\|\c
1117 options are processed in the order in which they are written.
1119 .BI "\-idirafter " "dir"
1120 Add the directory \c
1122 \& to the second include path. The directories
1123 on the second include path are searched when a header file is not found
1124 in any of the directories in the main include path (the one that
1129 .BI "\-iprefix " "prefix"
1132 \& as the prefix for subsequent `\|\c
1137 .BI "\-iwithprefix " "dir"
1138 Add a directory to the second include path. The directory's name is
1139 made by concatenating \c
1145 was specified previously with `\|\c
1150 Do not search the standard system directories for header files. Only
1151 the directories you have specified with `\|\c
1153 \&\|' options (and the
1154 current directory, if appropriate) are searched.
1160 \&\|', you can limit the include-file search file to only those
1161 directories you specify explicitly.
1164 Do not search for header files in the C++\-specific standard directories,
1165 but do still search the other standard directories.
1166 (This option is used when building `\|\c
1171 Do not predefine any nonstandard macros. (Including architecture flags).
1174 Run only the C preprocessor. Preprocess all the C source files
1175 specified and output the results to standard output or to the
1176 specified output file.
1179 Tell the preprocessor not to discard comments. Used with the
1185 Tell the preprocessor not to generate `\|\c
1193 Tell the preprocessor to output a rule suitable for \c
1195 describing the dependencies of each object file. For each source file,
1196 the preprocessor outputs one \c
1198 \&-rule whose target is the object
1199 file name for that source file and whose dependencies are all the files
1202 \&\|'d in it. This rule may be a single line or may be
1203 continued with `\|\c
1205 \&\|'-newline if it is long. The list of rules is
1206 printed on standard output instead of the preprocessed C program.
1216 \&\|' says to treat missing header files as generated files and assume \c
1217 they live in the same directory as the source file. It must be specified \c
1218 in addition to `\|\c
1225 \&\|' but the output mentions only the user header files
1232 \&\|'. System header files
1244 \&\|' but the dependency information is written to files with
1245 names made by replacing `\|\c
1249 \&\|' at the end of the
1250 output file names. This is in addition to compiling the file as
1251 specified\(em\&`\|\c
1253 \&\|' does not inhibit ordinary compilation the way
1258 The Mach utility `\|\c
1260 \&\|' can be used to merge the `\|\c
1263 into a single dependency file suitable for using with the `\|\c
1271 \&\|' except mention only user header files, not system
1275 Print the name of each header file used, in addition to other normal
1278 .BI "\-A" "question" ( answer )
1283 \&, in case it is tested
1284 with a preprocessor conditional such as `\|\c
1285 .BI "#if #" question ( answer )\c
1288 \&\|' disables the standard
1289 assertions that normally describe the target machine.
1291 .BI "\-A" "question"\c
1295 Assert the answer \c
1299 \&, in case it is tested
1300 with a preprocessor conditional such as `\|\c
1309 \&\|' disables the standard
1310 assertions that normally describe the target machine.
1315 \& with the string `\|\c
1317 \&\|' as its definition.
1319 .BI \-D macro = defn
1324 \&. All instances of `\|\c
1327 the command line are processed before any `\|\c
1336 \&\|' options are evaluated after all `\|\c
1338 \&\|' options, but before any `\|\c
1345 Tell the preprocessor to output only a list of the macro definitions
1346 that are in effect at the end of preprocessing. Used with the `\|\c
1352 Tell the preprocessor to pass all macro definitions into the output, in
1353 their proper sequence in the rest of the output.
1358 \&\|' except that the macro arguments and contents are omitted.
1363 \&\|' is included in the output.
1364 .SH ASSEMBLER OPTION
1366 .BI "\-Wa," "option"
1369 \& as an option to the assembler. If \c
1371 contains commas, it is split into multiple options at the commas.
1373 These options come into play when the compiler links object files into
1374 an executable output file. They are meaningless if the compiler is
1375 not doing a link step.
1378 A file name that does not end in a special recognized suffix is
1379 considered to name an object file or library. (Object files are
1380 distinguished from libraries by the linker according to the file
1381 contents.) If GCC does a link step, these object files are used as input
1385 Use the library named \c
1389 The linker searches a standard list of directories for the library,
1390 which is actually a file named `\|\c
1395 then uses this file as if it had been specified precisely by name.
1397 The directories searched include several standard system directories
1398 plus any that you specify with `\|\c
1402 Normally the files found this way are library files\(em\&archive files
1403 whose members are object files. The linker handles an archive file by
1404 scanning through it for members which define symbols that have so far
1405 been referenced but not defined. However, if the linker finds an
1406 ordinary object file rather than a library, the object file is linked
1407 in the usual fashion. The only difference between using an `\|\c
1409 \&\|' option and specifying a file
1418 \&\|' and searches several directories.
1421 You need this special case of the
1423 option in order to link an Objective C program.
1426 Do not use the standard system startup files when linking.
1427 The standard libraries are used normally.
1430 Don't use the standard system libraries and startup files when linking.
1431 Only the files you specify will be passed to the linker.
1434 On systems that support dynamic linking, this prevents linking with the shared
1435 libraries. On other systems, this option has no effect.
1438 Produce a shared object which can then be linked with other objects to
1439 form an executable. Only a few systems support this option.
1442 Bind references to global symbols when building a shared object. Warn
1443 about any unresolved references (unless overridden by the link editor
1446 \-Xlinker \-z \-Xlinker defs\c
1447 \&\|'). Only a few systems support
1450 .BI "\-Xlinker " "option"
1453 as an option to the linker. You can use this to
1454 supply system-specific linker options which GNU CC does not know how to
1457 If you want to pass an option that takes an argument, you must use
1460 \&\|' twice, once for the option and once for the argument.
1461 For example, to pass `\|\c
1463 \-assert definitions\c
1464 \&\|', you must write
1467 \-Xlinker \-assert \-Xlinker definitions\c
1468 \&\|'. It does not work to write
1471 \-Xlinker "\-assert definitions"\c
1472 \&\|', because this passes the entire
1473 string as a single argument, which is not what the linker expects.
1475 .BI "\-Wl," "option"
1478 \& as an option to the linker. If \c
1481 commas, it is split into multiple options at the commas.
1486 is undefined, to force linking of
1487 library modules to define it. You can use `\|\c
1489 \&\|' multiple times with
1490 different symbols to force loading of additional library modules.
1491 .SH DIRECTORY OPTIONS
1492 These options specify directories to search for header files, for
1493 libraries and for parts of the compiler:
1498 \& to the list of directories searched for include files.
1501 Any directories you specify with `\|\c
1503 \&\|' options before the `\|\c
1506 option are searched only for the case of `\|\c
1513 they are not searched for `\|\c
1521 If additional directories are specified with `\|\c
1526 \&\|', these directories are searched for all `\|\c
1529 directives. (Ordinarily \c
1533 \&\|' directories are used
1536 In addition, the `\|\c
1538 \&\|' option inhibits the use of the current
1539 directory (where the current input file came from) as the first search
1546 \&\|'. There is no way to
1547 override this effect of `\|\c
1551 \&\|' you can specify
1552 searching the directory which was current when the compiler was
1553 invoked. That is not exactly the same as what the preprocessor does
1554 by default, but it is often satisfactory.
1558 \&\|' does not inhibit the use of the standard system directories
1559 for header files. Thus, `\|\c
1569 \& to the list of directories to be searched
1575 This option specifies where to find the executables, libraries and
1576 data files of the compiler itself.
1578 The compiler driver program runs one or more of the subprograms
1583 \&\|' (or, for C++, `\|\c
1591 \& as a prefix for each program it tries to run, both with and
1599 For each subprogram to be run, the compiler driver first tries the
1602 \&\|' prefix, if any. If that name is not found, or if `\|\c
1605 was not specified, the driver tries two standard prefixes, which are
1609 .B /usr/local/lib/gcc-lib/\c
1610 \&\|'. If neither of
1611 those results in a file name that is found, the compiler driver
1612 searches for the unmodified program
1613 name, using the directories specified in your
1616 \&\|' environment variable.
1618 The run-time support file `\|\c
1620 \&\|' is also searched for using the
1623 \&\|' prefix, if needed. If it is not found there, the two
1624 standard prefixes above are tried, and that is all. The file is left
1625 out of the link if it is not found by those means. Most of the time,
1626 on most machines, `\|\c
1628 \&\|' is not actually necessary.
1630 You can get a similar result from the environment variable
1631 .B GCC_EXEC_PREFIX\c
1632 \&; if it is defined, its value is used as a prefix
1633 in the same way. If both the `\|\c
1635 \&\|' option and the
1636 .B GCC_EXEC_PREFIX\c
1637 \& variable are present, the `\|\c
1640 used first and the environment variable value second.
1642 Warnings are diagnostic messages that report constructions which
1643 are not inherently erroneous but which are risky or suggest there
1644 may have been an error.
1646 These options control the amount and kinds of warnings produced by GNU
1650 Check the code for syntax errors, but don't emit any output.
1653 Inhibit all warning messages.
1656 Inhibit warning messages about the use of
1660 Issue all the warnings demanded by strict ANSI standard C; reject
1661 all programs that use forbidden extensions.
1663 Valid ANSI standard C programs should compile properly with or without
1664 this option (though a rare few will require `\|\c
1667 without this option, certain GNU extensions and traditional C features
1668 are supported as well. With this option, they are rejected. There is
1671 \& this option; it exists only to satisfy pedants.
1675 \&\|' does not cause warning messages for use of the
1676 alternate keywords whose names begin and end with `\|\c
1679 warnings are also disabled in the expression that follows
1680 .B _\|_extension_\|_\c
1681 \&. However, only system header files should use
1682 these escape routes; application programs should avoid them.
1684 .B \-pedantic\-errors
1687 \&\|', except that errors are produced rather than
1691 Print extra warning messages for these events:
1694 A nonvolatile automatic variable might be changed by a call to
1696 \&. These warnings are possible only in
1697 optimizing compilation.
1699 The compiler sees only the calls to \c
1704 \& will be called; in fact, a signal handler could
1705 call it at any point in the code. As a result, you may get a warning
1706 even when there is in fact no problem because \c
1709 in fact be called at the place which would cause a problem.
1712 A function can return either with or without a value. (Falling
1713 off the end of the function body is considered returning without
1714 a value.) For example, this function would evoke such a
1725 Spurious warnings can occur because GNU CC does not realize that
1726 certain functions (including \c
1734 An expression-statement or the left-hand side of a comma expression
1735 contains no side effects.
1736 To suppress the warning, cast the unused expression to void.
1737 For example, an expression such as `\|\c
1739 \&\|' will cause a warning,
1745 An unsigned value is compared against zero with `\|\c
1753 Warn whenever a declaration does not specify a type.
1755 .B \-Wimplicit-function-declaration
1756 Warn whenever a function is used before being declared.
1759 Same as -Wimplicit-int and -Wimplicit-function-declaration.
1764 function is declared or defined with a suspicious type.
1765 Typically, it is a function with external linkage, returning
1768 taking zero or two arguments.
1772 Warn whenever a function is defined with a return-type that defaults
1775 \&. Also warn about any \c
1777 \& statement with no
1778 return-value in a function whose return-type is not \c
1783 Warn whenever a local variable is unused aside from its declaration,
1784 whenever a function is declared static but never defined, and whenever
1785 a statement computes a result that is explicitly not used.
1790 \& statement has an index of enumeral type
1793 \& for one or more of the named codes of that
1794 enumeration. (The presence of a \c
1796 \& label prevents this
1799 \& labels outside the enumeration range also
1800 provoke warnings when this option is used.
1803 Warn whenever a comment-start sequence `\|\c
1805 \&\|' appears in a comment.
1808 Warn if any trigraphs are encountered (assuming they are enabled).
1815 \&, etc., to make sure that
1816 the arguments supplied have types appropriate to the format string
1819 .B \-Wchar\-subscripts
1820 Warn if an array subscript has type
1822 This is a common cause of error, as programmers often forget that this
1823 type is signed on some machines.
1826 An automatic variable is used without first being initialized.
1828 These warnings are possible only in optimizing compilation,
1829 because they require data flow information that is computed only
1830 when optimizing. If you don't specify `\|\c
1832 \&\|', you simply won't
1835 These warnings occur only for variables that are candidates for
1836 register allocation. Therefore, they do not occur for a variable that
1839 \&, or whose address is taken, or whose size
1840 is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
1841 structures, unions or arrays, even when they are in registers.
1843 Note that there may be no warning about a variable that is used only
1844 to compute a value that itself is never used, because such
1845 computations may be deleted by data flow analysis before the warnings
1848 These warnings are made optional because GNU CC is not smart
1849 enough to see all the reasons why the code might be correct
1850 despite appearing to have an error. Here is one example of how
1870 \& is always 1, 2 or 3, then \c
1873 always initialized, but GNU CC doesn't know this. Here is
1874 another common case:
1879 if (change_y) save_y = y, y = new_y;
1881 if (change_y) y = save_y;
1885 This has no bug because \c
1887 \& is used only if it is set.
1889 Some spurious warnings can be avoided if you declare as
1891 \& all the functions you use that never return.
1894 Warn if parentheses are omitted in certain contexts.
1896 .B \-Wtemplate\-debugging
1897 When using templates in a C++ program, warn if debugging is not yet
1898 fully available (C++ only).
1901 All of the above `\|\c
1903 \&\|' options combined. These are all the
1904 options which pertain to usage that we recommend avoiding and that we
1905 believe is easy to avoid, even in conjunction with macros.
1909 \&\|' options are not implied by `\|\c
1912 because they warn about constructions that we consider reasonable to
1913 use, on occasion, in clean programs.
1916 Warn about certain constructs that behave differently in traditional and
1920 Macro arguments occurring within string constants in the macro body.
1921 These would substitute the argument in traditional C, but are part of
1922 the constant in ANSI C.
1925 A function declared external in one block and then used after the end of
1931 \& statement has an operand of type \c
1937 Warn whenever a local variable shadows another local variable.
1939 .BI "\-Wid\-clash\-" "len"
1940 Warn whenever two distinct identifiers match in the first \c
1942 characters. This may help you prepare a program that will compile
1943 with certain obsolete, brain-damaged compilers.
1945 .B \-Wpointer\-arith
1946 Warn about anything that depends on the \*(lqsize of\*(rq a function type or
1949 \&. GNU C assigns these types a size of 1, for
1950 convenience in calculations with \c
1952 \& pointers and pointers
1956 Warn whenever a pointer is cast so as to remove a type qualifier from
1957 the target type. For example, warn if a \c
1958 .B const char \(**\c
1965 Warn whenever a pointer is cast such that the required alignment of the
1966 target is increased. For example, warn if a \c
1971 \& on machines where integers can only be accessed at
1972 two- or four-byte boundaries.
1974 .B \-Wwrite\-strings
1975 Give string constants the type \c
1980 copying the address of one into a non-\c
1984 pointer will get a warning. These warnings will help you find at
1985 compile time code that can try to write into a string constant, but
1986 only if you have been very careful about using \c
1989 declarations and prototypes. Otherwise, it will just be a nuisance;
1990 this is why we did not make `\|\c
1992 \&\|' request these warnings.
1995 Warn if a prototype causes a type conversion that is different from what
1996 would happen to the same argument in the absence of a prototype. This
1997 includes conversions of fixed point to floating and vice versa, and
1998 conversions changing the width or signedness of a fixed point argument
1999 except when the same as the default promotion.
2001 .B \-Waggregate\-return
2002 Warn if any functions that return structures or unions are defined or
2003 called. (In languages where you can return an array, this also elicits
2006 .B \-Wstrict\-prototypes
2007 Warn if a function is declared or defined without specifying the
2008 argument types. (An old-style function definition is permitted without
2009 a warning if preceded by a declaration which specifies the argument
2012 .B \-Wmissing\-prototypes
2013 Warn if a global function is defined without a previous prototype
2014 declaration. This warning is issued even if the definition itself
2015 provides a prototype. The aim is to detect global functions that fail
2016 to be declared in header files.
2018 .B \-Wmissing\-declarations
2019 Warn if a global function is defined without a previous declaration.
2020 Do so even if the definition itself provides a prototype.
2021 Use this option to detect global functions that are not declared in
2024 .B \-Wredundant-decls
2025 Warn if anything is declared more than once in the same scope, even in
2026 cases where multiple declaration is valid and changes nothing.
2028 .B \-Wnested-externs
2031 \& declaration is encountered within a function.
2034 Warn about conversion between different enumeration types (C++ only).
2039 type is used. This is default. To inhibit
2040 the warning messages, use flag `\|\c
2041 .B \-Wno\-long\-long\c
2043 .B \-W\-long\-long\c
2045 .B \-Wno\-long\-long\c
2046 \&\|' are taken into account only when flag `\|\c
2050 .B \-Woverloaded\-virtual
2052 In a derived class, the definitions of virtual functions must match
2053 the type signature of a virtual function declared in the base class.
2054 Use this option to request warnings when a derived class declares a
2055 function that may be an erroneous attempt to define a virtual
2056 function: that is, warn when a function with the same name as a
2057 virtual function in the base class, but with a type signature that
2058 doesn't match any virtual functions from the base class.
2061 Warn if a function can not be inlined, and either it was declared as inline,
2063 .B \-finline\-functions
2067 Treat warnings as errors; abort compilation after any warning.
2068 .SH DEBUGGING OPTIONS
2069 GNU CC has various special options that are used for debugging
2070 either your program or GCC:
2073 Produce debugging information in the operating system's native format
2074 (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
2077 On most systems that use stabs format, `\|\c
2079 \&\|' enables use of extra
2080 debugging information that only GDB can use; this extra information
2081 makes debugging work better in GDB but will probably make other debuggers
2083 refuse to read the program. If you want to control for certain whether
2084 to generate the extra information, use `\|\c
2100 Unlike most other C compilers, GNU CC allows you to use `\|\c
2105 \&\|'. The shortcuts taken by optimized code may occasionally
2106 produce surprising results: some variables you declared may not exist
2107 at all; flow of control may briefly move where you did not expect it;
2108 some statements may not be executed because they compute constant
2109 results or their values were already at hand; some statements may
2110 execute in different places because they were moved out of loops.
2112 Nevertheless it proves possible to debug optimized output. This makes
2113 it reasonable to use the optimizer for programs that might have bugs.
2115 The following options are useful when GNU CC is generated with the
2116 capability for more than one debugging format.
2119 Produce debugging information in the native format (if that is supported),
2120 including GDB extensions if at all possible.
2123 Produce debugging information in stabs format (if that is supported),
2124 without GDB extensions. This is the format used by DBX on most BSD
2128 Produce debugging information in stabs format (if that is supported),
2129 using GNU extensions understood only by the GNU debugger (GDB). The
2130 use of these extensions is likely to make other debuggers crash or
2131 refuse to read the program.
2134 Produce debugging information in COFF format (if that is supported).
2135 This is the format used by SDB on most System V systems prior to
2139 Produce debugging information in XCOFF format (if that is supported).
2140 This is the format used by the DBX debugger on IBM RS/6000 systems.
2143 Produce debugging information in XCOFF format (if that is supported),
2144 using GNU extensions understood only by the GNU debugger (GDB). The
2145 use of these extensions is likely to make other debuggers crash or
2146 refuse to read the program.
2149 Produce debugging information in DWARF format (if that is supported).
2150 This is the format used by SDB on most System V Release 4 systems.
2153 Produce debugging information in DWARF format (if that is supported),
2154 using GNU extensions understood only by the GNU debugger (GDB). The
2155 use of these extensions is likely to make other debuggers crash or
2156 refuse to read the program.
2160 .BI "\-ggdb" "level"
2162 .BI "\-gstabs" "level"
2164 .BI "\-gcoff" "level"
2165 .BI "\-gxcoff" "level"
2167 .BI "\-gdwarf" "level"
2168 Request debugging information and also use \c
2171 much information. The default level is 2.
2173 Level 1 produces minimal information, enough for making backtraces in
2174 parts of the program that you don't plan to debug. This includes
2175 descriptions of functions and external variables, but no information
2176 about local variables and no line numbers.
2178 Level 3 includes extra information, such as all the macro definitions
2179 present in the program. Some debuggers support macro expansion when
2185 Generate extra code to write profile information suitable for the
2191 Generate extra code to write profile information suitable for the
2197 Generate extra code to write profile information for basic blocks,
2198 which will record the number of times each basic block is executed.
2199 This data could be analyzed by a program like \c
2202 however, that the format of the data is not what \c
2207 \& should be extended to process this data.
2210 Generate extra code to read basic block profiling parameters from
2211 file `bb.in' and write profiling results to file `bb.out'.
2212 `bb.in' contains a list of functions. Whenever a function on the list
2213 is entered, profiling is turned on. When the outmost function is left,
2214 profiling is turned off. If a function name is prefixed with `-'
2215 the function is excluded from profiling. If a function name is not
2216 unique it can be disambiguated by writing
2217 `/path/filename.d:functionname'. `bb.out' will list some available
2219 Four function names have a special meaning:
2220 `__bb_jumps__' will cause jump frequencies to be written to `bb.out'.
2221 `__bb_trace__' will cause the sequence of basic blocks to be piped
2222 into `gzip' and written to file `bbtrace.gz'.
2223 `__bb_hidecall__' will cause call instructions to be excluded from
2225 `__bb_showret__' will cause return instructions to be included in
2229 Says to make debugging dumps during compilation at times specified by
2231 \&. This is used for debugging the compiler. The file names
2232 for most of the dumps are made by appending a word to the source file
2240 Dump all macro definitions, at the end of preprocessing, and write no
2244 Dump all macro names, at the end of preprocessing.
2247 Dump all macro definitions, at the end of preprocessing, in addition to
2251 Dump debugging information during parsing, to standard error.
2254 Dump after RTL generation, to `\|\c
2260 Just generate RTL for a function instead of compiling it. Usually used
2266 Dump after first jump optimization, to `\|\c
2272 Dump after CSE (including the jump optimization that sometimes
2273 follows CSE), to `\|\c
2279 Dump after loop optimization, to `\|\c
2285 Dump after the second CSE pass (including the jump optimization that
2286 sometimes follows CSE), to `\|\c
2292 Dump after flow analysis, to `\|\c
2298 Dump after instruction combination, to `\|\c
2304 Dump after the first instruction scheduling pass, to
2311 Dump after local register allocation, to `\|\c
2317 Dump after global register allocation, to `\|\c
2323 Dump after the second instruction scheduling pass, to
2330 Dump after last jump optimization, to `\|\c
2336 Dump after delayed branch scheduling, to `\|\c
2342 Dump after conversion from registers to stack, to `\|\c
2348 Produce all the dumps listed above.
2351 Print statistics on memory usage, at the end of the run, to
2355 Annotate the assembler output with a comment indicating which
2356 pattern and alternative was used.
2358 .B \-fpretend\-float
2359 When running a cross-compiler, pretend that the target machine uses the
2360 same floating point format as the host machine. This causes incorrect
2361 output of the actual floating constants, but the actual instruction
2362 sequence will probably be the same as GNU CC would make when running on
2366 Store the usual \*(lqtemporary\*(rq intermediate files permanently; place them
2367 in the current directory and name them based on the source file. Thus,
2371 .B \-c \-save\-temps\c
2372 \&\|' would produce files
2377 \&\|', as well as `\|\c
2381 .BI "\-print\-file\-name=" "library"
2382 Print the full absolute name of the library file \|\c
2387 would be used when linking\(em\&and do not do anything else. With this
2388 option, GNU CC does not compile or link anything; it just prints the
2391 .B \-print\-libgcc\-file\-name
2393 .B \-print\-file\-name=libgcc.a\c
2396 .BI "\-print\-prog\-name=" "program"
2398 .B \-print\-file\-name\c
2399 \&\|', but searches for a program such as `\|\c
2402 .SH OPTIMIZATION OPTIONS
2403 These options control various sorts of optimizations:
2408 Optimize. Optimizing compilation takes somewhat more time, and a lot
2409 more memory for a large function.
2413 \&\|', the compiler's goal is to reduce the cost of
2414 compilation and to make debugging produce the expected results.
2415 Statements are independent: if you stop the program with a breakpoint
2416 between statements, you can then assign a new value to any variable or
2417 change the program counter to any other statement in the function and
2418 get exactly the results you would expect from the source code.
2422 \&\|', only variables declared \c
2425 allocated in registers. The resulting compiled code is a little worse
2426 than produced by PCC without `\|\c
2432 \&\|', the compiler tries to reduce code size and execution
2435 When you specify `\|\c
2437 \&\|', the two options `\|\c
2438 .B \-fthread\-jumps\c
2441 \&\|' are turned on. On machines that have delay slots, the `\|\c
2442 .B \-fdelayed\-branch\c
2443 \&\|' option is turned on. For those machines that can support debugging even
2444 without a frame pointer, the `\|\c
2445 .B \-fomit\-frame\-pointer\c
2446 \&\|' option is turned on. On some machines other flags may also be turned on.
2449 Optimize even more. Nearly all supported optimizations that do not
2450 involve a space-speed tradeoff are performed. Loop unrolling and function
2451 inlining are not done, for example. As compared to
2454 this option increases both compilation time and the performance of the
2458 Optimize yet more. This turns on everything
2460 does, along with also turning on
2461 .B \-finline\-functions.
2467 optimizations that do not typically increase code size.
2468 It also performs further optimizations designed to reduce code size.
2475 options, with or without level numbers, the last such option is the
2476 one that is effective.
2478 Options of the form `\|\c
2482 \&\|' specify machine-independent
2483 flags. Most flags have both positive and negative forms; the negative
2486 \&\|' would be `\|\c
2488 \&\|'. The following list shows
2489 only one form\(em\&the one which is not the default.
2490 You can figure out the other form by either removing `\|\c
2496 Do not store floating point variables in registers. This
2497 prevents undesirable excess precision on machines such as the
2498 68000 where the floating registers (of the 68881) keep more
2501 \& is supposed to have.
2503 For most programs, the excess precision does only good, but a few
2504 programs rely on the precise definition of IEEE floating point.
2506 .B \-ffloat\-store\c
2507 \&\|' for such programs.
2509 .B \-fmemoize\-lookups
2511 .B \-fsave\-memoized
2512 Use heuristics to compile faster (C++ only). These heuristics are not
2513 enabled by default, since they are only effective for certain input
2514 files. Other input files compile more slowly.
2516 The first time the compiler must build a call to a member function (or
2517 reference to a data member), it must (1) determine whether the class
2518 implements member functions of that name; (2) resolve which member
2519 function to call (which involves figuring out what sorts of type
2520 conversions need to be made); and (3) check the visibility of the member
2521 function to the caller. All of this adds up to slower compilation.
2522 Normally, the second time a call is made to that member function (or
2523 reference to that data member), it must go through the same lengthy
2524 process again. This means that code like this
2526 \& cout << "This " << p << " has " << n << " legs.\en";
2528 makes six passes through all three steps. By using a software cache,
2529 a \*(lqhit\*(rq significantly reduces this cost. Unfortunately, using the
2530 cache introduces another layer of mechanisms which must be implemented,
2531 and so incurs its own overhead. `\|\c
2532 .B \-fmemoize\-lookups\c
2536 Because access privileges (visibility) to members and member functions
2537 may differ from one function context to the next,
2539 may need to flush the cache. With the `\|\c
2540 .B \-fmemoize\-lookups\c
2541 \&\|' flag, the cache is flushed after every
2542 function that is compiled. The `\|\c
2544 \&\|' flag enables the same software cache, but when the compiler
2545 determines that the context of the last function compiled would yield
2546 the same access privileges of the next function to compile, it
2547 preserves the cache.
2548 This is most helpful when defining many member functions for the same
2549 class: with the exception of member functions which are friends of
2550 other classes, each member function has exactly the same access
2551 privileges as every other, and the cache need not be flushed.
2553 .B \-fno\-default\-inline
2554 Don't make member functions inline by default merely because they are
2555 defined inside the class scope (C++ only).
2557 .B \-fno\-defer\-pop
2558 Always pop the arguments to each function call as soon as that
2559 function returns. For machines which must pop arguments after a
2560 function call, the compiler normally lets arguments accumulate on the
2561 stack for several function calls and pops them all at once.
2564 Force memory operands to be copied into registers before doing
2565 arithmetic on them. This may produce better code by making all
2566 memory references potential common subexpressions. When they are
2567 not common subexpressions, instruction combination should
2568 eliminate the separate register-load. I am interested in hearing
2569 about the difference this makes.
2572 Force memory address constants to be copied into registers before
2573 doing arithmetic on them. This may produce better code just as
2576 \&\|' may. I am interested in hearing about the
2577 difference this makes.
2579 .B \-fomit\-frame\-pointer
2580 Don't keep the frame pointer in a register for functions that
2581 don't need one. This avoids the instructions to save, set up and
2582 restore frame pointers; it also makes an extra register available
2583 in many functions. \c
2584 .I It also makes debugging impossible on most machines\c
2587 On some machines, such as the Vax, this flag has no effect, because
2588 the standard calling sequence automatically handles the frame pointer
2589 and nothing is saved by pretending it doesn't exist. The
2590 machine-description macro \c
2591 .B FRAME_POINTER_REQUIRED\c
2593 whether a target machine supports this flag.
2595 .B \-finline\-functions
2596 Integrate all simple functions into their callers. The compiler
2597 heuristically decides which functions are simple enough to be worth
2598 integrating in this way.
2600 If all calls to a given function are integrated, and the function is
2603 \&, then GCC normally does not output the function as
2604 assembler code in its own right.
2607 Enable values to be allocated in registers that will be clobbered by
2608 function calls, by emitting extra instructions to save and restore the
2609 registers around such calls. Such allocation is done only when it
2610 seems to result in better code than would otherwise be produced.
2612 This option is enabled by default on certain machines, usually those
2613 which have no call-preserved registers to use instead.
2615 .B \-fkeep\-inline\-functions
2616 Even if all calls to a given function are integrated, and the function
2619 \&, nevertheless output a separate run-time
2620 callable version of the function.
2622 .B \-fno\-function\-cse
2623 Do not put function addresses in registers; make each instruction that
2624 calls a constant function contain the function's address explicitly.
2626 This option results in less efficient code, but some strange hacks
2627 that alter the assembler output may be confused by the optimizations
2628 performed when this option is not used.
2631 Disable any machine-specific peephole optimizations.
2634 This option allows GCC to violate some ANSI or IEEE rules/specifications
2635 in the interest of optimizing code for speed. For example, it allows
2636 the compiler to assume arguments to the \c
2639 non-negative numbers.
2641 This option should never be turned on by any `\|\c
2644 it can result in incorrect output for programs which depend on
2645 an exact implementation of IEEE or ANSI rules/specifications for
2648 The following options control specific optimizations. The `\|\c
2651 option turns on all of these optimizations except `\|\c
2652 .B \-funroll\-loops\c
2655 .B \-funroll\-all\-loops\c
2660 \&\|' option usually turns on
2662 .B \-fthread\-jumps\c
2664 .B \-fdelayed\-branch\c
2666 specific machines may change the default optimizations.
2668 You can use the following flags in the rare cases when \*(lqfine-tuning\*(rq
2669 of optimizations to be performed is desired.
2671 .B \-fstrength\-reduce
2672 Perform the optimizations of loop strength reduction and
2673 elimination of iteration variables.
2676 Perform optimizations where we check to see if a jump branches to a
2677 location where another comparison subsumed by the first is found. If
2678 so, the first branch is redirected to either the destination of the
2679 second branch or a point immediately following it, depending on whether
2680 the condition is known to be true or false.
2683 Perform the optimization of loop unrolling. This is only done for loops
2684 whose number of iterations can be determined at compile time or run time.
2686 .B \-funroll\-all\-loops
2687 Perform the optimization of loop unrolling. This is done for all loops.
2688 This usually makes programs run more slowly.
2690 .B \-fcse\-follow\-jumps
2691 In common subexpression elimination, scan through jump instructions
2692 when the target of the jump is not reached by any other path. For
2693 example, when CSE encounters an \c
2695 \& statement with an
2697 \& clause, CSE will follow the jump when the condition
2700 .B \-fcse\-skip\-blocks
2701 This is similar to `\|\c
2702 .B \-fcse\-follow\-jumps\c
2703 \&\|', but causes CSE to
2704 follow jumps which conditionally skip over blocks. When CSE
2705 encounters a simple \c
2707 \& statement with no else clause,
2709 .B \-fcse\-skip\-blocks\c
2710 \&\|' causes CSE to follow the jump around the
2715 .B \-frerun\-cse\-after\-loop
2716 Re-run common subexpression elimination after loop optimizations has been
2719 .B \-felide\-constructors
2720 Elide constructors when this seems plausible (C++ only). With this
2721 flag, GNU C++ initializes \c
2723 \& directly from the call to \c
2725 without going through a temporary in the following code:
2730 Without this option, GNU C++ first initializes \c
2733 appropriate constructor for type \c
2735 \&; then assigns the result of
2737 \& to a temporary; and, finally, replaces the initial value of
2740 \&\|' with the temporary.
2742 The default behavior (`\|\c
2743 .B \-fno\-elide\-constructors\c
2744 \&\|') is specified by
2745 the draft ANSI C++ standard. If your program's constructors have side
2746 effects, using `\|\c
2747 .B \-felide-constructors\c
2748 \&\|' can make your program act
2749 differently, since some constructor calls may be omitted.
2751 .B \-fexpensive\-optimizations
2752 Perform a number of minor optimizations that are relatively expensive.
2754 .B \-fdelayed\-branch
2755 If supported for the target machine, attempt to reorder instructions
2756 to exploit instruction slots available after delayed branch
2759 .B \-fschedule\-insns
2760 If supported for the target machine, attempt to reorder instructions to
2761 eliminate execution stalls due to required data being unavailable. This
2762 helps machines that have slow floating point or memory load instructions
2763 by allowing other instructions to be issued until the result of the load
2764 or floating point instruction is required.
2766 .B \-fschedule\-insns2
2768 .B \-fschedule\-insns\c
2769 \&\|', but requests an additional pass of
2770 instruction scheduling after register allocation has been done. This is
2771 especially useful on machines with a relatively small number of
2772 registers and where memory load instructions take more than one cycle.
2774 By default, GNU CC compiles code for the same type of machine that you
2775 are using. However, it can also be installed as a cross-compiler, to
2776 compile for some other type of machine. In fact, several different
2777 configurations of GNU CC, for different target machines, can be
2778 installed side by side. Then you specify which one to use with the
2783 In addition, older and newer versions of GNU CC can be installed side
2784 by side. One of them (probably the newest) will be the default, but
2785 you may sometimes wish to use another.
2787 .BI "\-b " "machine"
2790 \& specifies the target machine for compilation.
2791 This is useful when you have installed GNU CC as a cross-compiler.
2793 The value to use for \c
2795 \& is the same as was specified as the
2796 machine type when configuring GNU CC as a cross-compiler. For
2797 example, if a cross-compiler was configured with `\|\c
2800 \&\|', meaning to compile for an 80386 running System V, then you
2803 \&\|' to run that cross compiler.
2805 When you do not specify `\|\c
2807 \&\|', it normally means to compile for
2808 the same type of machine that you are using.
2810 .BI "\-V " "version"
2813 \& specifies which version of GNU CC to run.
2814 This is useful when multiple versions are installed. For example,
2818 \&\|', meaning to run GNU CC version 2.0.
2820 The default version, when you do not specify `\|\c
2822 \&\|', is controlled
2823 by the way GNU CC is installed. Normally, it will be a version that
2824 is recommended for general use.
2825 .SH MACHINE DEPENDENT OPTIONS
2826 Each of the target machine types can have its own special options,
2829 \&\|', to choose among various hardware models or
2830 configurations\(em\&for example, 68010 vs 68020, floating coprocessor or
2831 none. A single installed version of the compiler can compile for any
2832 model or configuration, according to the options specified.
2834 Some configurations of the compiler also support additional special
2835 options, usually for command-line compatibility with other compilers on
2840 \&\|' options defined for the 68000 series:
2845 Generate output for a 68000. This is the default when the compiler is
2846 configured for 68000-based systems.
2851 Generate output for a 68020 (rather than a 68000). This is the
2852 default when the compiler is configured for 68020-based systems.
2855 Generate output containing 68881 instructions for floating point.
2856 This is the default for most 68020-based systems unless
2858 was specified when the compiler was configured.
2861 Generate output for a 68030. This is the default when the compiler is
2862 configured for 68030-based systems.
2865 Generate output for a 68040. This is the default when the compiler is
2866 configured for 68040-based systems.
2869 Generate output for a 68040, without using any of the new instructions.
2870 This results in code which can run relatively efficiently on either a
2871 68020/68881 or a 68030 or a 68040.
2874 Generate output containing Sun FPA instructions for floating point.
2877 Generate output containing library calls for floating point.
2880 the requisite libraries are not part of GNU CC. Normally the
2881 facilities of the machine's usual C compiler are used, but this can't
2882 be done directly in cross-compilation. You must make your own
2883 arrangements to provide suitable library functions for cross-compilation.
2888 \& to be 16 bits wide, like \c
2893 Do not use the bit-field instructions. `\|\c
2901 Do use the bit-field instructions. `\|\c
2906 \&\|'. This is the default if you use the unmodified
2910 Use a different function-calling convention, in which functions
2911 that take a fixed number of arguments return with the \c
2913 instruction, which pops their arguments while returning. This
2914 saves one instruction in the caller since there is no need to pop
2915 the arguments there.
2917 This calling convention is incompatible with the one normally
2918 used on Unix, so you cannot use it if you need to call libraries
2919 compiled with the Unix compiler.
2921 Also, you must provide function prototypes for all functions that
2922 take variable numbers of arguments (including \c
2925 otherwise incorrect code will be generated for calls to those
2928 In addition, seriously incorrect code will result if you call a
2929 function with too many arguments. (Normally, extra arguments are
2930 harmlessly ignored.)
2934 \& instruction is supported by the 68010 and 68020
2935 processors, but not by the 68000.
2939 \&\|' options are defined for the Vax:
2942 Do not output certain jump instructions (\c
2945 that the Unix assembler for the Vax cannot handle across long
2949 Do output those jump instructions, on the assumption that you
2950 will assemble with the GNU assembler.
2953 Output code for g-format floating point numbers instead of d-format.
2957 \&\|' switches are supported on the SPARC:
2962 Generate output containing floating point instructions. This is the
2968 Generate output containing library calls for floating point.
2970 there is no GNU floating-point library for SPARC.
2971 Normally the facilities of the machine's usual C compiler are used, but
2972 this cannot be done directly in cross-compilation. You must make your
2973 own arrangements to provide suitable library functions for
2977 changes the calling convention in the output file;
2978 therefore, it is only useful if you compile
2980 of a program with this option.
2987 (the default), the compiler always emits code for
2988 function exit at the end of each function. Any function exit in
2989 the middle of the function (such as a return statement in C) will
2990 generate a jump to the exit code at the end of the function.
2993 .BR \-mno\-epilogue ,
2994 the compiler tries to emit exit code inline at every function exit.
3001 These three options select variations on the SPARC architecture.
3003 By default (unless specifically configured for the Fujitsu SPARClite),
3004 GCC generates code for the v7 variant of the SPARC architecture.
3007 will give you SPARC v8 code. The only difference from v7
3008 code is that the compiler emits the integer multiply and integer
3009 divide instructions which exist in SPARC v8 but not in SPARC v7.
3012 will give you SPARClite code. This adds the integer
3013 multiply, integer divide step and scan (ffs) instructions which
3014 exist in SPARClite but not in SPARC v7.
3019 These two options select the processor for which the code is optimized.
3023 (the default), the compiler optimizes code for the Cypress CY7C602 chip, as
3024 used in the SparcStation/SparcServer 3xx series. This is also appropriate for
3025 the older SparcStation 1, 2, IPX etc.
3029 the compiler optimizes code for the SuperSparc cpu, as used in the SparcStation
3030 10, 1000 and 2000 series. This flag also enables use of the full SPARC v8
3035 \&\|' options are defined for the Convex:
3038 Generate output for a C1. This is the default when the compiler is
3039 configured for a C1.
3042 Generate output for a C2. This is the default when the compiler is
3043 configured for a C2.
3046 Generate code which puts an argument count in the word preceding each
3047 argument list. Some nonportable Convex and Vax programs need this word.
3048 (Debuggers don't, except for functions with variable-length argument
3049 lists; this info is in the symbol table.)
3052 Omit the argument count word. This is the default if you use the
3057 \&\|' options are defined for the AMD Am29000:
3060 Generate code that assumes the DW bit is set, i.e., that byte and
3061 halfword operations are directly supported by the hardware. This is the
3065 Generate code that assumes the DW bit is not set.
3068 Generate code that assumes the system supports byte and halfword write
3069 operations. This is the default.
3072 Generate code that assumes the systems does not support byte and
3073 halfword write operations. This implies `\|\c
3078 Use a small memory model that assumes that all function addresses are
3079 either within a single 256 KB segment or at an absolute address of less
3080 than 256K. This allows the \c
3082 \& instruction to be used instead
3092 Do not assume that the \c
3094 \& instruction can be used; this is the
3098 Generate code for the Am29050.
3101 Generate code for the Am29000. This is the default.
3103 .B \-mkernel\-registers
3104 Generate references to registers \c
3108 \&. This option can be used when compiling kernel code
3109 that wants a set of global registers disjoint from that used by
3112 Note that when this option is used, register names in `\|\c
3115 must use the normal, user-mode, names.
3117 .B \-muser\-registers
3118 Use the normal set of global registers, \c
3126 \& after each stack adjustment. This
3127 is often used for kernel code.
3131 \&\|' options are defined for Motorola 88K architectures:
3134 Generate code that works well on both the m88100 and the
3138 Generate code that works best for the m88100, but that also
3142 Generate code that works best for the m88110, and may not run
3145 .B \-midentify\-revision
3148 \& directive in the assembler output recording the
3149 source file name, compiler name and version, timestamp, and compilation
3152 .B \-mno\-underscores
3153 In assembler output, emit symbol names without adding an underscore
3154 character at the beginning of each name. The default is to use an
3155 underscore as prefix on each name.
3157 .B \-mno\-check\-zero\-division
3159 .B \-mcheck\-zero\-division
3160 Early models of the 88K architecture had problems with division by zero;
3161 in particular, many of them didn't trap. Use these options to avoid
3162 including (or to include explicitly) additional code to detect division
3163 by zero and signal an exception. All GCC configurations for the 88K use
3165 .B \-mcheck\-zero\-division\c
3168 .B \-mocs\-debug\-info
3170 .B \-mno\-ocs\-debug\-info
3171 Include (or omit) additional debugging information (about
3172 registers used in each stack frame) as specified in the 88Open Object
3173 Compatibility Standard, \*(lqOCS\*(rq. This extra information is not needed
3174 by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to
3175 include this information; other 88k configurations omit this information
3178 .B \-mocs\-frame\-position
3180 .B \-mno\-ocs\-frame\-position
3181 Force (or do not require) register values to be stored in a particular
3182 place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2,
3183 and BCS configurations use `\|\c
3184 .B \-mocs\-frame\-position\c
3186 configurations have the default `\|\c
3187 .B \-mno\-ocs\-frame\-position\c
3190 .B \-moptimize\-arg\-area
3192 .B \-mno\-optimize\-arg\-area
3193 Control how to store function arguments in stack frames.
3195 .B \-moptimize\-arg\-area\c
3196 \&\|' saves space, but may break some
3197 debuggers (not GDB). `\|\c
3198 .B \-mno\-optimize\-arg\-area\c
3199 \&\|' conforms better to
3200 standards. By default GCC does not optimize the argument area.
3202 .BI "\-mshort\-data\-" "num"
3204 Generate smaller data references by making them relative to \c
3207 which allows loading a value using a single instruction (rather than the
3208 usual two). You control which data references are affected by
3211 \& with this option. For example, if you specify
3213 .B \-mshort\-data\-512\c
3214 \&\|', then the data references affected are those
3215 involving displacements of less than 512 bytes.
3217 .B \-mshort\-data\-\c
3220 \&\|' is not effective for \c
3225 .B \-mserialize-volatile
3227 .B \-mno-serialize-volatile
3228 Do, or do not, generate code to guarantee sequential consistency of
3229 volatile memory references.
3231 GNU CC always guarantees consistency by default, for the preferred
3232 processor submodel. How this is done depends on the submodel.
3234 The m88100 processor does not reorder memory references and so always
3235 provides sequential consistency. If you use `\|\c
3238 not generate any special instructions for sequential consistency.
3240 The order of memory references made by the m88110 processor does not
3241 always match the order of the instructions requesting those references.
3242 In particular, a load instruction may execute before a preceding store
3243 instruction. Such reordering violates sequential consistency of
3244 volatile memory references, when there are multiple processors. When
3249 \&\|', GNU CC generates special
3250 instructions when appropriate, to force execution in the proper order.
3252 The extra code generated to guarantee consistency may affect the
3253 performance of your application. If you know that you can safely forgo
3254 this guarantee, you may use the option `\|\c
3255 .B \-mno-serialize-volatile\c
3258 If you use the `\|\c
3260 \&\|' option but require sequential consistency
3261 when running on the m88110 processor, you should use
3263 .B \-mserialize-volatile\c
3271 \&\|') or off (`\|\c
3273 \&\|') compiler extensions
3274 related to System V release 4 (SVr4). This controls the following:
3277 Which variant of the assembler syntax to emit (which you can select
3278 independently using `\|\c
3279 .B \-mversion\-03.00\c
3285 \&\|' makes the C preprocessor recognize `\|\c
3292 \&\|' makes GCC issue additional declaration directives used in
3297 \&\|' is the default for all m88K configurations except
3298 the SVr4 configuration.
3300 .B \-mtrap\-large\-shift
3302 .B \-mhandle\-large\-shift
3303 Include code to detect bit-shifts of more than 31 bits; respectively,
3304 trap such shifts or emit code to handle them properly. By default GCC
3305 makes no special provision for large bit shifts.
3307 .B \-muse\-div\-instruction
3308 Very early models of the 88K architecture didn't have a divide
3309 instruction, so GCC avoids that instruction by default. Use this option
3310 to specify that it's safe to use the divide instruction.
3312 .B \-mversion\-03.00
3313 In the DG/UX configuration, there are two flavors of SVr4. This option
3316 to select whether the hybrid-COFF or real-ELF
3317 flavor is used. All other configurations ignore this option.
3319 .B \-mwarn\-passed\-structs
3320 Warn when a function passes a struct as an argument or result.
3321 Structure-passing conventions have changed during the evolution of the C
3322 language, and are often the source of portability problems. By default,
3323 GCC issues no such warning.
3325 These options are defined for the IBM RS6000:
3329 .B \-mno\-fp\-in\-toc
3330 Control whether or not floating-point constants go in the Table of
3331 Contents (TOC), a table of all global variable and function addresses. By
3332 default GCC puts floating-point constants there; if the TOC overflows,
3334 .B \-mno\-fp\-in\-toc\c
3335 \&\|' will reduce the size of the TOC, which may avoid
3340 \&\|' options are defined for the IBM RT PC:
3343 Use an in-line code sequence for integer multiplies. This is the
3346 .B \-mcall\-lib\-mul
3349 \& for integer multiples.
3351 .B \-mfull\-fp\-blocks
3352 Generate full-size floating point data blocks, including the minimum
3353 amount of scratch space recommended by IBM. This is the default.
3355 .B \-mminimum\-fp\-blocks
3356 Do not include extra scratch space in floating point data blocks. This
3357 results in smaller code, but slower execution, since scratch space must
3358 be allocated dynamically.
3360 .B \-mfp\-arg\-in\-fpregs
3361 Use a calling sequence incompatible with the IBM calling convention in
3362 which floating point arguments are passed in floating point registers.
3367 \& will not work with
3368 floating point operands if this option is specified.
3370 .B \-mfp\-arg\-in\-gregs
3371 Use the normal calling convention for floating point arguments. This is
3374 .B \-mhc\-struct\-return
3375 Return structures of more than one word in memory, rather than in a
3376 register. This provides compatibility with the MetaWare HighC (hc)
3378 .B \-fpcc\-struct\-return\c
3379 \&\|' for compatibility with the
3380 Portable C Compiler (pcc).
3382 .B \-mnohc\-struct\-return
3383 Return some structures of more than one word in registers, when
3384 convenient. This is the default. For compatibility with the
3385 IBM-supplied compilers, use either `\|\c
3386 .B \-fpcc\-struct\-return\c
3389 .B \-mhc\-struct\-return\c
3394 \&\|' options are defined for the MIPS family of computers:
3396 .BI "\-mcpu=" "cpu-type"
3397 Assume the defaults for the machine type
3400 scheduling instructions. The default
3404 which picks the longest cycles times for any of the machines, in order
3405 that the code run at reasonable rates on all MIPS cpu's. Other
3414 While picking a specific
3416 will schedule things appropriately for that particular chip, the
3417 compiler will not generate any code that does not meet level 1 of the
3418 MIPS ISA (instruction set architecture) without the
3422 switches being used.
3425 Issue instructions from level 2 of the MIPS ISA (branch likely, square
3426 root instructions). The
3430 switch must be used in conjunction with
3434 Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
3437 switch must be used in conjunction with
3445 These options don't work at present.
3448 Generate code for the MIPS assembler, and invoke
3450 to add normal debug information. This is the default for all
3451 platforms except for the OSF/1 reference platform, using the OSF/rose
3452 object format. If any of the
3457 switches are used, the
3459 program will encapsulate the stabs within MIPS ECOFF.
3462 Generate code for the GNU assembler. This is the default on the OSF/1
3463 reference platform, using the OSF/rose object format.
3470 switch says to output code using the MIPS software names for the
3471 registers, instead of the hardware names (ie,
3475 The GNU assembler does not support the
3477 switch, and the MIPS assembler will be instructed to run the MIPS C
3478 preprocessor over the source file. The
3487 switch says to write all of the data declarations before the
3488 instructions in the text section, to all the MIPS assembler to
3489 generate one word memory references instead of using two words for
3490 short global or static data items. This is on by default if
3491 optimization is selected.
3496 For each non-inline function processed, the
3498 switch causes the compiler to emit one line to the standard error file
3499 to print statistics about the program (number of registers saved,
3507 switch makes all block moves call the appropriate string function
3511 instead of possibly generating inline code.
3515 .B \-mno\-mips\-tfile
3517 .B \-mno\-mips\-tfile
3518 switch causes the compiler not postprocess the object file with the
3520 program, after the MIPS assembler has generated it to add debug
3523 is not run, then no local variables will be available to the debugger.
3528 objects will have the temporary file names passed to the assembler
3529 embedded in the object file, which means the objects will not compare
3533 Generate output containing library calls for floating point.
3536 the requisite libraries are not part of GNU CC. Normally the
3537 facilities of the machine's usual C compiler are used, but this can't
3538 be done directly in cross-compilation. You must make your own
3539 arrangements to provide suitable library functions for cross-compilation.
3542 Generate output containing floating point instructions. This is the
3543 default if you use the unmodified sources.
3548 bit in the status word is on, and that there are 32 64-bit floating
3549 point registers, instead of 32 32-bit floating point registers. You
3550 must also specify the
3557 Assume that there are 32 32-bit floating point registers. This is the
3563 Emit (or do not emit) the
3568 pseudo operations that some System V.4 ports use for position
3576 switch says to put pointers to extern references into the data section
3577 and load them up, rather than put the references in the text section.
3578 This option does not work at present.
3581 Put global and static items less than or equal to
3583 bytes into the small data or bss sections instead of the normal data
3584 or bss section. This allows the assembler to emit one word memory
3585 reference instructions based on the global pointer
3589 instead of the normal two words used. By default,
3591 is 8 when the MIPS assembler is used, and 0 when the GNU
3592 assembler is used. The
3594 switch is also passed to the assembler and linker. All modules should
3595 be compiled with the same
3600 Tell the MIPS assembler to not run its preprocessor over user
3601 assembler files (with a `\|\c
3603 \&\|' suffix) when assembling them.
3607 \&\|' options are defined for the Intel 80386 family of computers:
3612 Control whether or not code is optimized for a 486 instead of an
3613 386. Code generated for a 486 will run on a 386 and vice versa.
3621 .B \-mcpu=pentiumpro
3623 .B \-mcpu=\fIcpu type\fP
3624 Assume the defaults for the machine type CPU TYPE when scheduling instructions.
3625 The choices for CPU TYPE are:
3635 While picking a specific CPU TYPE will schedule things appropriately for that
3637 the compiler will not generate any code that does not run on the i386 without
3639 .B \-march=\fIcpu type\fP
3642 .B \-march=\fIcpu type\fP
3643 Generate instructions for the machine type CPU TYPE.
3644 The choices for CPU TYPE are:
3651 .B \-march=\fIcpu type\fP
3653 .B \-mcpu=\fIcpu type\fP.
3656 Generate output containing library calls for floating point.
3658 the requisite libraries are not part of GNU CC.
3659 Normally the facilities of the machine's usual C compiler are used, but
3660 this can't be done directly in cross-compilation. You must make your
3661 own arrangements to provide suitable library functions for
3664 On machines where a function returns floating point results in the 80387
3665 register stack, some floating point opcodes may be emitted even if
3670 .B \-mno-fp-ret-in-387
3671 Do not use the FPU registers for return values of functions.
3673 The usual calling convention has functions return values of types
3677 \& in an FPU register, even if there
3678 is no FPU. The idea is that the operating system should emulate
3682 .B \-mno-fp-ret-in-387\c
3683 \&\|' causes such values to be returned
3684 in ordinary CPU registers instead.
3686 .B \-mprofiler-epilogue
3688 .B \-mno-profiler-epilogue
3689 Generate extra code to write profile information for function exits.
3693 \&\|' options are defined for the HPPA family of computers:
3696 Generate code for a PA 1.0 processor.
3699 Generate code for a PA 1.1 processor.
3702 Generate code which is suitable for use in kernels. Specifically, avoid
3704 \& instructions in which one of the arguments is the DP register;
3707 \& instructions instead. This avoids a rather serious
3708 bug in the HP-UX linker.
3711 Generate code that can be linked against HP-UX shared libraries. This option
3712 is not fully function yet, and is not on by default for any PA target. Using
3713 this option can cause incorrect code to be generated by the compiler.
3715 .B \-mno-shared-libs
3716 Don't generate code that will be linked against shared libraries. This is
3717 the default for all PA targets.
3720 Generate code which allows calls to functions greater than 256K away from
3721 the caller when the caller and callee are in the same source file. Do
3722 not turn this option on unless code refuses to link with \*(lqbranch out of
3723 range errors\*('' from the linker.
3725 .B \-mdisable-fpregs
3726 Prevent floating point registers from being used in any manner. This is
3727 necessary for compiling kernels which perform lazy context switching of
3728 floating point registers. If you use this option and attempt to perform
3729 floating point operations, the compiler will abort.
3731 .B \-mdisable-indexing
3732 Prevent the compiler from using indexing address modes. This avoids some
3733 rather obscure problems when compiling MIG generated code under MACH.
3735 .B \-mtrailing-colon
3736 Add a colon to the end of label definitions (for ELF assemblers).
3740 \&\|' options are defined for the Intel 80960 family of computers:
3742 .BI "\-m" "cpu-type"
3743 Assume the defaults for the machine type
3745 for instruction and addressing-mode availability and alignment.
3764 option indicates that the processor does support
3765 floating-point instructions. The
3768 that floating-point support should not be assumed.
3770 .B \-mleaf\-procedures
3772 .B \-mno\-leaf\-procedures
3773 Do (or do not) attempt to alter leaf procedures to be callable with the
3775 instruction as well as
3777 This will result in more
3778 efficient code for explicit calls when the
3781 substituted by the assembler or linker, but less efficient code in other
3782 cases, such as calls via function pointers, or using a linker that doesn't
3783 support this optimization.
3787 .B \-mno\-tail\-call
3788 Do (or do not) make additional attempts (beyond those of the
3789 machine-independent portions of the compiler) to optimize tail-recursive
3790 calls into branches. You may not want to do this because the detection of
3791 cases where this is not valid is not totally complete. The default is
3792 .BR \-mno\-tail\-call .
3796 .B \-mno\-complex\-addr
3797 Assume (or do not assume) that the use of a complex addressing mode is a
3798 win on this implementation of the i960. Complex addressing modes may not
3799 be worthwhile on the K-series, but they definitely are on the C-series.
3800 The default is currently
3802 for all processors except
3807 .B \-mno\-code\-align
3808 Align code to 8-byte boundaries for faster fetching (or don't bother).
3809 Currently turned on by default for C-series implementations only.
3816 Enable compatibility with iC960 v2.0 or v3.0.
3821 Enable compatibility with the iC960 assembler.
3825 .B \-mno\-strict\-align
3826 Do not permit (do permit) unaligned accesses.
3829 Enable structure-alignment compatibility with Intel's gcc release version
3830 1.3 (based on gcc 1.37). Currently this is buggy in that
3832 is always assumed as well, and cannot be turned off.
3836 \&\|' options are defined for the DEC Alpha implementations:
3841 Use (do not use) the hardware floating-point instructions for
3842 floating-point operations. When \c
3847 \&\|' will be used to perform floating-point
3848 operations. Unless they are replaced by routines that emulate the
3849 floating-point operations, or compiled in such a way as to call such
3850 emulations routines, these routines will issue floating-point
3851 operations. If you are compiling for an Alpha without floating-point
3852 operations, you must ensure that the library is built so as not to call
3855 Note that Alpha implementations without floating-point operations are
3856 required to have floating-point registers.
3861 Generate code that uses (does not use) the floating-point register set.
3865 \&. If the floating-point
3866 register set is not used, floating point operands are passed in integer
3867 registers as if they were integers and floating-point results are passed
3868 in $0 instead of $f0. This is a non-standard calling sequence, so any
3869 function with a floating-point argument or return value called by code
3872 \& must also be compiled with that
3875 A typical use of this option is building a kernel that does not use,
3876 and hence need not save and restore, any floating-point registers.
3878 These additional options are available on System V Release 4 for
3879 compatibility with other compilers on those systems:
3884 \& accepts the option `\|\c
3887 it to the system linker), for compatibility with other compilers.
3888 However, we suggest you use `\|\c
3893 appropriate, instead of supplying linker options on the \c
3898 Identify the versions of each tool used by the compiler, in a
3900 \& assembler directive in the output.
3903 Refrain from adding \c
3905 \& directives to the output file (this is
3909 Search the directories \c
3911 \&, and no others, for libraries
3912 specified with `\|\c
3914 \&\|'. You can separate directory entries in
3916 \& from one another with colons.
3919 Look in the directory \c
3921 \& to find the M4 preprocessor.
3922 The assembler uses this option.
3923 .SH CODE GENERATION OPTIONS
3924 These machine-independent options control the interface conventions
3925 used in code generation.
3927 Most of them begin with `\|\c
3929 \&\|'. These options have both positive and negative forms; the negative form
3932 \&\|' would be `\|\c
3934 \&\|'. In the table below, only
3935 one of the forms is listed\(em\&the one which is not the default. You
3936 can figure out the other form by either removing `\|\c
3941 .B \-fnonnull\-objects
3942 Assume that objects reached through references are not null
3945 Normally, GNU C++ makes conservative assumptions about objects reached
3946 through references. For example, the compiler must check that \c
3948 is not null in code like the following:
3953 Checking that references of this sort have non-null values requires
3954 extra code, however, and it is unnecessary for many programs. You can
3956 .B \-fnonnull-objects\c
3957 \&\|' to omit the checks for null, if your
3958 program doesn't require checking.
3960 .B \-fpcc\-struct\-return
3961 Use the same convention for returning \c
3965 values that is used by the usual C compiler on your system. This
3966 convention is less efficient for small structures, and on many
3967 machines it fails to be reentrant; but it has the advantage of
3968 allowing intercallability between GCC-compiled code and PCC-compiled
3971 .B \-freg\-struct\-return
3972 Use the convention that
3976 values are returned in registers when possible. This is more
3977 efficient for small structures than
3978 .BR \-fpcc\-struct\-return .
3980 If you specify neither
3981 .B \-fpcc\-struct\-return
3983 .BR \-freg\-struct\-return ,
3984 GNU CC defaults to whichever convention is standard for the target.
3985 If there is no standard convention, GNU CC defaults to
3986 .BR \-fpcc\-struct\-return .
3991 \& type only as many bytes as it needs for the
3992 declared range of possible values. Specifically, the \c
3995 will be equivalent to the smallest integer type which has enough room.
3998 Use the same size for
4005 Requests that the data and non-\c
4007 \& variables of this
4008 compilation be shared data rather than private data. The distinction
4009 makes sense only on certain operating systems, where shared data is
4010 shared between processes running the same program, while private data
4011 exists in one copy per process.
4014 Allocate even uninitialized global variables in the bss section of the
4015 object file, rather than generating them as common blocks. This has the
4016 effect that if the same variable is declared (without \c
4019 two different compilations, you will get an error when you link them.
4020 The only reason this might be useful is if you wish to verify that the
4021 program will work on other systems which always work this way.
4028 .B \-fno\-gnu\-linker
4029 Do not output global initializations (such as C++ constructors and
4030 destructors) in the form used by the GNU linker (on systems where the GNU
4031 linker is the standard method of handling them). Use this option when
4032 you want to use a non-GNU linker, which also requires using the
4034 \& program to make sure the system linker includes
4035 constructors and destructors. (\c
4037 \& is included in the GNU CC
4038 distribution.) For systems which \c
4045 \& is configured to do this automatically.
4047 .B \-finhibit-size-directive
4050 \& assembler directive, or anything else that
4051 would cause trouble if the function is split in the middle, and the
4052 two halves are placed at locations far apart in memory. This option is
4053 used when compiling `\|\c
4055 \&\|'; you should not need to use it
4059 Put extra commentary information in the generated assembly code to
4060 make it more readable. This option is generally only of use to those
4061 who actually need to read the generated assembly code (perhaps while
4062 debugging the compiler itself).
4065 Consider all memory references through pointers to be volatile.
4067 .B \-fvolatile\-global
4068 Consider all memory references to extern and global data items to
4072 If supported for the target machines, generate position-independent code,
4073 suitable for use in a shared library.
4076 If supported for the target machine, emit position-independent code,
4077 suitable for dynamic linking, even if branches need large displacements.
4079 .BI "\-ffixed\-" "reg"
4080 Treat the register named \c
4082 \& as a fixed register; generated code
4083 should never refer to it (except perhaps as a stack pointer, frame
4084 pointer or in some other fixed role).
4087 \& must be the name of a register. The register names accepted
4088 are machine-specific and are defined in the \c
4090 macro in the machine description macro file.
4092 This flag does not have a negative form, because it specifies a
4095 .BI "\-fcall\-used\-" "reg"
4096 Treat the register named \c
4098 \& as an allocable register that is
4099 clobbered by function calls. It may be allocated for temporaries or
4100 variables that do not live across a call. Functions compiled this way
4101 will not save and restore the register \c
4105 Use of this flag for a register that has a fixed pervasive role in the
4106 machine's execution model, such as the stack pointer or frame pointer,
4107 will produce disastrous results.
4109 This flag does not have a negative form, because it specifies a
4112 .BI "\-fcall\-saved\-" "reg"
4113 Treat the register named \c
4115 \& as an allocable register saved by
4116 functions. It may be allocated even for temporaries or variables that
4117 live across a call. Functions compiled this way will save and restore
4122 Use of this flag for a register that has a fixed pervasive role in the
4123 machine's execution model, such as the stack pointer or frame pointer,
4124 will produce disastrous results.
4126 A different sort of disaster will result from the use of this flag for
4127 a register in which function values may be returned.
4129 This flag does not have a negative form, because it specifies a
4134 \&\|' directives are supported for GNU C++, to permit using the same
4135 header file for two purposes: as a definition of interfaces to a given
4136 object class, and as the full definition of the contents of that object class.
4138 .B #pragma interface
4140 Use this directive in header files that define object classes, to save
4141 space in most of the object files that use those classes. Normally,
4142 local copies of certain information (backup copies of inline member
4143 functions, debugging information, and the internal tables that
4144 implement virtual functions) must be kept in each object file that
4145 includes class definitions. You can use this pragma to avoid such
4146 duplication. When a header file containing `\|\c
4147 .B #pragma interface\c
4148 \&\|' is included in a compilation, this auxiliary information
4149 will not be generated (unless the main input source file itself uses
4151 .B #pragma implementation\c
4152 \&\|'). Instead, the object files will contain references to be
4153 resolved at link time.
4155 .B #pragma implementation
4157 \fB#pragma implementation "\fP\fIobjects\fP\fB.h"\fP
4159 Use this pragma in a main input file, when you want full output from
4160 included header files to be generated (and made globally visible).
4161 The included header file, in turn, should use `\|\c
4162 .B #pragma interface\c
4164 Backup copies of inline member functions, debugging information, and
4165 the internal tables used to implement virtual functions are all
4166 generated in implementation files.
4169 .B #pragma implementation\c
4170 \&\|' with no argument, it applies to an include file with the same
4171 basename as your source file; for example, in `\|\c
4174 .B #pragma implementation\c
4175 \&\|' by itself is equivalent to `\|\c
4177 #pragma implementation "allclass.h"\c
4178 \&\|'. Use the string argument if you want a single implementation
4179 file to include code from multiple header files.
4181 There is no way to split up the contents of a single header file into
4182 multiple implementation files.
4185 .ta \w'LIBDIR/g++\-include 'u
4186 file.c C source file
4187 file.h C header (preprocessor) file
4188 file.i preprocessed C source file
4189 file.C C++ source file
4190 file.cc C++ source file
4191 file.cxx C++ source file
4192 file.m Objective-C source file
4193 file.s assembly language file
4195 a.out link edited output
4196 \fITMPDIR\fR/cc\(** temporary files
4197 \fILIBDIR\fR/cpp preprocessor
4198 \fILIBDIR\fR/cc1 compiler for C
4199 \fILIBDIR\fR/cc1plus compiler for C++
4200 \fILIBDIR\fR/collect linker front end needed on some machines
4201 \fILIBDIR\fR/libgcc.a GCC subroutine library
4202 /lib/crt[01n].o start-up routine
4203 \fILIBDIR\fR/ccrt0 additional start-up routine for C++
4204 /lib/libc.a standard C library, see
4206 /usr/include standard directory for \fB#include\fP files
4207 \fILIBDIR\fR/include standard gcc directory for \fB#include\fP files
4208 \fILIBDIR\fR/g++\-include additional g++ directory for \fB#include\fP
4213 .B /usr/local/lib/\c
4214 .IR machine / version .
4217 comes from the environment variable
4225 as(1), cpp(1), gdb(1), ld(1)
4227 .RB "`\|" gcc "\|', `\|" cpp \|',
4228 .RB "`\|" as "\|', `\|" ld \|',
4236 Using and Porting GNU CC (for version 2.0)\c
4237 , Richard M. Stallman;
4239 The C Preprocessor\c
4240 , Richard M. Stallman;
4242 Debugging with GDB: the GNU Source-Level Debugger\c
4243 , Richard M. Stallman and Roland H. Pesch;
4245 Using as: the GNU Assembler\c
4246 , Dean Elsner, Jay Fenlason & friends;
4248 ld: the GNU linker\c
4249 , Steve Chamberlain and Roland Pesch.
4251 For instructions on reporting bugs, see the GCC manual.
4255 1991, 1992, 1993 Free Software Foundation, Inc.
4257 Permission is granted to make and distribute verbatim copies of
4258 this manual provided the copyright notice and this permission notice
4259 are preserved on all copies.
4261 Permission is granted to copy and distribute modified versions of this
4262 manual under the conditions for verbatim copying, provided that the
4263 entire resulting derived work is distributed under the terms of a
4264 permission notice identical to this one.
4266 Permission is granted to copy and distribute translations of this
4267 manual into another language, under the above conditions for modified
4268 versions, except that this permission notice may be included in
4269 translations approved by the Free Software Foundation instead of in
4270 the original English.
4272 See the GNU CC Manual for the contributors to GNU CC.