1 This is Info file gcc.info, produced by Makeinfo version 1.68 from the
4 This file documents the use and the internals of the GNU compiler.
6 Published by the Free Software Foundation 59 Temple Place - Suite 330
7 Boston, MA 02111-1307 USA
9 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997 Free
10 Software Foundation, Inc.
12 Permission is granted to make and distribute verbatim copies of this
13 manual provided the copyright notice and this permission notice are
14 preserved on all copies.
16 Permission is granted to copy and distribute modified versions of
17 this manual under the conditions for verbatim copying, provided also
18 that the sections entitled "GNU General Public License," "Funding for
19 Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
20 included exactly as in the original, and provided that the entire
21 resulting derived work is distributed under the terms of a permission
22 notice identical to this one.
24 Permission is granted to copy and distribute translations of this
25 manual into another language, under the above conditions for modified
26 versions, except that the sections entitled "GNU General Public
27 License," "Funding for Free Software," and "Protect Your Freedom--Fight
28 `Look And Feel'", and this permission notice, may be included in
29 translations approved by the Free Software Foundation instead of in the
33 File: gcc.info, Node: Preprocessor Options, Next: Assembler Options, Prev: Optimize Options, Up: Invoking GCC
35 Options Controlling the Preprocessor
36 ====================================
38 These options control the C preprocessor, which is run on each C
39 source file before actual compilation.
41 If you use the `-E' option, nothing is done except preprocessing.
42 Some of these options make sense only together with `-E' because they
43 cause the preprocessor output to be unsuitable for actual compilation.
46 Process FILE as input before processing the regular input file.
47 In effect, the contents of FILE are compiled first. Any `-D' and
48 `-U' options on the command line are always processed before
49 `-include FILE', regardless of the order in which they are
50 written. All the `-include' and `-imacros' options are processed
51 in the order in which they are written.
54 Process FILE as input, discarding the resulting output, before
55 processing the regular input file. Because the output generated
56 from FILE is discarded, the only effect of `-imacros FILE' is to
57 make the macros defined in FILE available for use in the main
60 Any `-D' and `-U' options on the command line are always processed
61 before `-imacros FILE', regardless of the order in which they are
62 written. All the `-include' and `-imacros' options are processed
63 in the order in which they are written.
66 Add the directory DIR to the second include path. The directories
67 on the second include path are searched when a header file is not
68 found in any of the directories in the main include path (the one
72 Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
75 Add a directory to the second include path. The directory's name
76 is made by concatenating PREFIX and DIR, where PREFIX was
77 specified previously with `-iprefix'. If you have not specified a
78 prefix yet, the directory containing the installed passes of the
79 compiler is used as the default.
81 `-iwithprefixbefore DIR'
82 Add a directory to the main include path. The directory's name is
83 made by concatenating PREFIX and DIR, as in the case of
87 Add a directory to the beginning of the second include path,
88 marking it as a system directory, so that it gets the same special
89 treatment as is applied to the standard system directories.
92 Do not search the standard system directories for header files.
93 Only the directories you have specified with `-I' options (and the
94 current directory, if appropriate) are searched. *Note Directory
95 Options::, for information on `-I'.
97 By using both `-nostdinc' and `-I-', you can limit the include-file
98 search path to only those directories you specify explicitly.
101 Do not predefine any nonstandard macros. (Including architecture
105 Run only the C preprocessor. Preprocess all the C source files
106 specified and output the results to standard output or to the
107 specified output file.
110 Tell the preprocessor not to discard comments. Used with the `-E'
114 Tell the preprocessor not to generate `#line' directives. Used
115 with the `-E' option.
118 Tell the preprocessor to output a rule suitable for `make'
119 describing the dependencies of each object file. For each source
120 file, the preprocessor outputs one `make'-rule whose target is the
121 object file name for that source file and whose dependencies are
122 all the `#include' header files it uses. This rule may be a
123 single line or may be continued with `\'-newline if it is long.
124 The list of rules is printed on standard output instead of the
125 preprocessed C program.
129 Another way to specify output of a `make' rule is by setting the
130 environment variable `DEPENDENCIES_OUTPUT' (*note Environment
134 Like `-M' but the output mentions only the user header files
135 included with `#include "FILE"'. System header files included
136 with `#include <FILE>' are omitted.
139 Like `-M' but the dependency information is written to a file made
140 by replacing ".c" with ".d" at the end of the input file names.
141 This is in addition to compiling the file as specified--`-MD' does
142 not inhibit ordinary compilation the way `-M' does.
144 In Mach, you can use the utility `md' to merge multiple dependency
145 files into a single dependency file suitable for using with the
149 Like `-MD' except mention only user header files, not system
153 Treat missing header files as generated files and assume they live
154 in the same directory as the source file. If you specify `-MG',
155 you must also specify either `-M' or `-MM'. `-MG' is not
156 supported with `-MD' or `-MMD'.
159 Print the name of each header file used, in addition to other
163 Assert the answer ANSWER for QUESTION, in case it is tested with a
164 preprocessing conditional such as `#if #QUESTION(ANSWER)'. `-A-'
165 disables the standard assertions that normally describe the target
169 Define macro MACRO with the string `1' as its definition.
172 Define macro MACRO as DEFN. All instances of `-D' on the command
173 line are processed before any `-U' options.
176 Undefine macro MACRO. `-U' options are evaluated after all `-D'
177 options, but before any `-include' and `-imacros' options.
180 Tell the preprocessor to output only a list of the macro
181 definitions that are in effect at the end of preprocessing. Used
182 with the `-E' option.
185 Tell the preprocessing to pass all macro definitions into the
186 output, in their proper sequence in the rest of the output.
189 Like `-dD' except that the macro arguments and contents are
190 omitted. Only `#define NAME' is included in the output.
193 Support ANSI C trigraphs. The `-ansi' option also has this effect.
196 Pass OPTION as an option to the preprocessor. If OPTION contains
197 commas, it is split into multiple options at the commas.
200 File: gcc.info, Node: Assembler Options, Next: Link Options, Prev: Preprocessor Options, Up: Invoking GCC
202 Passing Options to the Assembler
203 ================================
205 You can pass options to the assembler.
208 Pass OPTION as an option to the assembler. If OPTION contains
209 commas, it is split into multiple options at the commas.
212 File: gcc.info, Node: Link Options, Next: Directory Options, Prev: Assembler Options, Up: Invoking GCC
217 These options come into play when the compiler links object files
218 into an executable output file. They are meaningless if the compiler is
219 not doing a link step.
222 A file name that does not end in a special recognized suffix is
223 considered to name an object file or library. (Object files are
224 distinguished from libraries by the linker according to the file
225 contents.) If linking is done, these object files are used as
231 If any of these options is used, then the linker is not run, and
232 object file names should not be used as arguments. *Note Overall
236 Search the library named LIBRARY when linking.
238 It makes a difference where in the command you write this option;
239 the linker searches processes libraries and object files in the
240 order they are specified. Thus, `foo.o -lz bar.o' searches
241 library `z' after file `foo.o' but before `bar.o'. If `bar.o'
242 refers to functions in `z', those functions may not be loaded.
244 The linker searches a standard list of directories for the library,
245 which is actually a file named `libLIBRARY.a'. The linker then
246 uses this file as if it had been specified precisely by name.
248 The directories searched include several standard system
249 directories plus any that you specify with `-L'.
251 Normally the files found this way are library files--archive files
252 whose members are object files. The linker handles an archive
253 file by scanning through it for members which define symbols that
254 have so far been referenced but not defined. But if the file that
255 is found is an ordinary object file, it is linked in the usual
256 fashion. The only difference between using an `-l' option and
257 specifying a file name is that `-l' surrounds LIBRARY with `lib'
258 and `.a' and searches several directories.
261 You need this special case of the `-l' option in order to link an
265 Do not use the standard system startup files when linking. The
266 standard system libraries are used normally, unless `-nostdlib' or
267 `-nodefaultlibs' is used.
270 Do not use the standard system libraries when linking. Only the
271 libraries you specify will be passed to the linker. The standard
272 startup files are used normally, unless `-nostartfiles' is used.
275 Do not use the standard system startup files or libraries when
276 linking. No startup files and only the libraries you specify will
277 be passed to the linker.
279 One of the standard libraries bypassed by `-nostdlib' and
280 `-nodefaultlibs' is `libgcc.a', a library of internal subroutines
281 that GNU CC uses to overcome shortcomings of particular machines,
282 or special needs for some languages. (*Note Interfacing to GNU CC
283 Output: Interface, for more discussion of `libgcc.a'.) In most
284 cases, you need `libgcc.a' even when you want to avoid other
285 standard libraries. In other words, when you specify `-nostdlib'
286 or `-nodefaultlibs' you should usually specify `-lgcc' as well.
287 This ensures that you have no unresolved references to internal
288 GNU CC library subroutines. (For example, `__main', used to
289 ensure C++ constructors will be called; *note `collect2':
293 Remove all symbol table and relocation information from the
297 On systems that support dynamic linking, this prevents linking
298 with the shared libraries. On other systems, this option has no
302 Produce a shared object which can then be linked with other
303 objects to form an executable. Not all systems support this
304 option. You must also specify `-fpic' or `-fPIC' on some systems
305 when you specify this option.
308 Bind references to global symbols when building a shared object.
309 Warn about any unresolved references (unless overridden by the
310 link editor option `-Xlinker -z -Xlinker defs'). Only a few
311 systems support this option.
314 Pass OPTION as an option to the linker. You can use this to
315 supply system-specific linker options which GNU CC does not know
318 If you want to pass an option that takes an argument, you must use
319 `-Xlinker' twice, once for the option and once for the argument.
320 For example, to pass `-assert definitions', you must write
321 `-Xlinker -assert -Xlinker definitions'. It does not work to write
322 `-Xlinker "-assert definitions"', because this passes the entire
323 string as a single argument, which is not what the linker expects.
326 Pass OPTION as an option to the linker. If OPTION contains
327 commas, it is split into multiple options at the commas.
330 Pretend the symbol SYMBOL is undefined, to force linking of
331 library modules to define it. You can use `-u' multiple times with
332 different symbols to force loading of additional library modules.
335 File: gcc.info, Node: Directory Options, Next: Target Options, Prev: Link Options, Up: Invoking GCC
337 Options for Directory Search
338 ============================
340 These options specify directories to search for header files, for
341 libraries and for parts of the compiler:
344 Add the directory DIR to the head of the list of directories to be
345 searched for header files. This can be used to override a system
346 header file, substituting your own version, since these
347 directories are searched before the system header file
348 directories. If you use more than one `-I' option, the
349 directories are scanned in left-to-right order; the standard
350 system directories come after.
353 Any directories you specify with `-I' options before the `-I-'
354 option are searched only for the case of `#include "FILE"'; they
355 are not searched for `#include <FILE>'.
357 If additional directories are specified with `-I' options after
358 the `-I-', these directories are searched for all `#include'
359 directives. (Ordinarily *all* `-I' directories are used this way.)
361 In addition, the `-I-' option inhibits the use of the current
362 directory (where the current input file came from) as the first
363 search directory for `#include "FILE"'. There is no way to
364 override this effect of `-I-'. With `-I.' you can specify
365 searching the directory which was current when the compiler was
366 invoked. That is not exactly the same as what the preprocessor
367 does by default, but it is often satisfactory.
369 `-I-' does not inhibit the use of the standard system directories
370 for header files. Thus, `-I-' and `-nostdinc' are independent.
373 Add directory DIR to the list of directories to be searched for
377 This option specifies where to find the executables, libraries,
378 include files, and data files of the compiler itself.
380 The compiler driver program runs one or more of the subprograms
381 `cpp', `cc1', `as' and `ld'. It tries PREFIX as a prefix for each
382 program it tries to run, both with and without `MACHINE/VERSION/'
383 (*note Target Options::.).
385 For each subprogram to be run, the compiler driver first tries the
386 `-B' prefix, if any. If that name is not found, or if `-B' was
387 not specified, the driver tries two standard prefixes, which are
388 `/usr/lib/gcc/' and `/usr/local/lib/gcc-lib/'. If neither of
389 those results in a file name that is found, the unmodified program
390 name is searched for using the directories specified in your
391 `PATH' environment variable.
393 `-B' prefixes that effectively specify directory names also apply
394 to libraries in the linker, because the compiler translates these
395 options into `-L' options for the linker. They also apply to
396 includes files in the preprocessor, because the compiler
397 translates these options into `-isystem' options for the
398 preprocessor. In this case, the compiler appends `include' to the
401 The run-time support file `libgcc.a' can also be searched for using
402 the `-B' prefix, if needed. If it is not found there, the two
403 standard prefixes above are tried, and that is all. The file is
404 left out of the link if it is not found by those means.
406 Another way to specify a prefix much like the `-B' prefix is to use
407 the environment variable `GCC_EXEC_PREFIX'. *Note Environment
411 Process FILE after the compiler reads in the standard `specs'
412 file, in order to override the defaults that the `gcc' driver
413 program uses when determining what switches to pass to `cc1',
414 `cc1plus', `as', `ld', etc. More than one `-specs='FILE can be
415 specified on the command line, and they are processed in order,
419 File: gcc.info, Node: Target Options, Next: Submodel Options, Prev: Directory Options, Up: Invoking GCC
421 Specifying Target Machine and Compiler Version
422 ==============================================
424 By default, GNU CC compiles code for the same type of machine that
425 you are using. However, it can also be installed as a cross-compiler,
426 to compile for some other type of machine. In fact, several different
427 configurations of GNU CC, for different target machines, can be
428 installed side by side. Then you specify which one to use with the
431 In addition, older and newer versions of GNU CC can be installed side
432 by side. One of them (probably the newest) will be the default, but
433 you may sometimes wish to use another.
436 The argument MACHINE specifies the target machine for compilation.
437 This is useful when you have installed GNU CC as a cross-compiler.
439 The value to use for MACHINE is the same as was specified as the
440 machine type when configuring GNU CC as a cross-compiler. For
441 example, if a cross-compiler was configured with `configure
442 i386v', meaning to compile for an 80386 running System V, then you
443 would specify `-b i386v' to run that cross compiler.
445 When you do not specify `-b', it normally means to compile for the
446 same type of machine that you are using.
449 The argument VERSION specifies which version of GNU CC to run.
450 This is useful when multiple versions are installed. For example,
451 VERSION might be `2.0', meaning to run GNU CC version 2.0.
453 The default version, when you do not specify `-V', is the last
454 version of GNU CC that you installed.
456 The `-b' and `-V' options actually work by controlling part of the
457 file name used for the executable files and libraries used for
458 compilation. A given version of GNU CC, for a given target machine, is
459 normally kept in the directory `/usr/local/lib/gcc-lib/MACHINE/VERSION'.
461 Thus, sites can customize the effect of `-b' or `-V' either by
462 changing the names of these directories or adding alternate names (or
463 symbolic links). If in directory `/usr/local/lib/gcc-lib/' the file
464 `80386' is a link to the file `i386v', then `-b 80386' becomes an alias
467 In one respect, the `-b' or `-V' do not completely change to a
468 different compiler: the top-level driver program `gcc' that you
469 originally invoked continues to run and invoke the other executables
470 (preprocessor, compiler per se, assembler and linker) that do the real
471 work. However, since no real work is done in the driver program, it
472 usually does not matter that the driver program in use is not the one
473 for the specified target and version.
475 The only way that the driver program depends on the target machine is
476 in the parsing and handling of special machine-specific options.
477 However, this is controlled by a file which is found, along with the
478 other executables, in the directory for the specified version and
479 target machine. As a result, a single installed driver program adapts
480 to any specified target machine and compiler version.
482 The driver program executable does control one significant thing,
483 however: the default version and target machine. Therefore, you can
484 install different instances of the driver program, compiled for
485 different targets or versions, under different names.
487 For example, if the driver for version 2.0 is installed as `ogcc'
488 and that for version 2.1 is installed as `gcc', then the command `gcc'
489 will use version 2.1 by default, while `ogcc' will use 2.0 by default.
490 However, you can choose either version with either command with the
494 File: gcc.info, Node: Submodel Options, Next: Code Gen Options, Prev: Target Options, Up: Invoking GCC
496 Hardware Models and Configurations
497 ==================================
499 Earlier we discussed the standard option `-b' which chooses among
500 different installed compilers for completely different target machines,
501 such as Vax vs. 68000 vs. 80386.
503 In addition, each of these target machine types can have its own
504 special options, starting with `-m', to choose among various hardware
505 models or configurations--for example, 68010 vs 68020, floating
506 coprocessor or none. A single installed version of the compiler can
507 compile for any model or configuration, according to the options
510 Some configurations of the compiler also support additional special
511 options, usually for compatibility with other compilers on the same
514 These options are defined by the macro `TARGET_SWITCHES' in the
515 machine description. The default for the options is also defined by
516 that macro, which enables you to change the defaults.
528 * RS/6000 and PowerPC Options::
533 * Intel 960 Options::
534 * DEC Alpha Options::
542 File: gcc.info, Node: M680x0 Options, Next: VAX Options, Up: Submodel Options
547 These are the `-m' options defined for the 68000 series. The default
548 values for these options depends on which style of 68000 was selected
549 when the compiler was configured; the defaults for the most common
550 choices are given below.
554 Generate output for a 68000. This is the default when the
555 compiler is configured for 68000-based systems.
559 Generate output for a 68020. This is the default when the
560 compiler is configured for 68020-based systems.
563 Generate output containing 68881 instructions for floating point.
564 This is the default for most 68020 systems unless `-nfp' was
565 specified when the compiler was configured.
568 Generate output for a 68030. This is the default when the
569 compiler is configured for 68030-based systems.
572 Generate output for a 68040. This is the default when the
573 compiler is configured for 68040-based systems.
575 This option inhibits the use of 68881/68882 instructions that have
576 to be emulated by software on the 68040. If your 68040 does not
577 have code to emulate those instructions, use `-m68040'.
580 Generate output for a 68060. This is the default when the
581 compiler is configured for 68060-based systems.
583 This option inhibits the use of 68020 and 68881/68882 instructions
584 that have to be emulated by software on the 68060. If your 68060
585 does not have code to emulate those instructions, use `-m68060'.
588 Generate output for a 520X "coldfire" family cpu. This is the
589 default when the compiler is configured for 520X-based systems.
592 Generate output for a 68040, without using any of the new
593 instructions. This results in code which can run relatively
594 efficiently on either a 68020/68881 or a 68030 or a 68040. The
595 generated code does use the 68881 instructions that are emulated
599 Generate output for a 68060, without using any of the new
600 instructions. This results in code which can run relatively
601 efficiently on either a 68020/68881 or a 68030 or a 68040. The
602 generated code does use the 68881 instructions that are emulated
606 Generate output containing Sun FPA instructions for floating point.
609 Generate output containing library calls for floating point.
610 *Warning:* the requisite libraries are not available for all m68k
611 targets. Normally the facilities of the machine's usual C
612 compiler are used, but this can't be done directly in
613 cross-compilation. You must make your own arrangements to provide
614 suitable library functions for cross-compilation. The embedded
615 targets `m68k-*-aout' and `m68k-*-coff' do provide software
616 floating point support.
619 Consider type `int' to be 16 bits wide, like `short int'.
622 Do not use the bit-field instructions. The `-m68000' option
623 implies `-mnobitfield'.
626 Do use the bit-field instructions. The `-m68020' option implies
627 `-mbitfield'. This is the default if you use a configuration
628 designed for a 68020.
631 Use a different function-calling convention, in which functions
632 that take a fixed number of arguments return with the `rtd'
633 instruction, which pops their arguments while returning. This
634 saves one instruction in the caller since there is no need to pop
637 This calling convention is incompatible with the one normally used
638 on Unix, so you cannot use it if you need to call libraries
639 compiled with the Unix compiler.
641 Also, you must provide function prototypes for all functions that
642 take variable numbers of arguments (including `printf'); otherwise
643 incorrect code will be generated for calls to those functions.
645 In addition, seriously incorrect code will result if you call a
646 function with too many arguments. (Normally, extra arguments are
649 The `rtd' instruction is supported by the 68010, 68020, 68030,
650 68040, and 68060 processors, but not by the 68000 or 5200.
654 Control whether GNU CC aligns `int', `long', `long long', `float',
655 `double', and `long double' variables on a 32-bit boundary
656 (`-malign-int') or a 16-bit boundary (`-mno-align-int'). Aligning
657 variables on 32-bit boundaries produces code that runs somewhat
658 faster on processors with 32-bit busses at the expense of more
661 *Warning:* if you use the `-malign-int' switch, GNU CC will align
662 structures containing the above types differently than most
663 published application binary interface specifications for the m68k.
666 File: gcc.info, Node: VAX Options, Next: SPARC Options, Prev: M680x0 Options, Up: Submodel Options
671 These `-m' options are defined for the Vax:
674 Do not output certain jump instructions (`aobleq' and so on) that
675 the Unix assembler for the Vax cannot handle across long ranges.
678 Do output those jump instructions, on the assumption that you will
679 assemble with the GNU assembler.
682 Output code for g-format floating point numbers instead of
686 File: gcc.info, Node: SPARC Options, Next: Convex Options, Prev: VAX Options, Up: Submodel Options
691 These `-m' switches are supported on the SPARC:
695 Specify `-mapp-regs' to generate output using the global registers
696 2 through 4, which the SPARC SVR4 ABI reserves for applications.
699 To be fully SVR4 ABI compliant at the cost of some performance
700 loss, specify `-mno-app-regs'. You should compile libraries and
701 system software with this option.
705 Generate output containing floating point instructions. This is
710 Generate output containing library calls for floating point.
711 *Warning:* the requisite libraries are not available for all SPARC
712 targets. Normally the facilities of the machine's usual C
713 compiler are used, but this cannot be done directly in
714 cross-compilation. You must make your own arrangements to provide
715 suitable library functions for cross-compilation. The embedded
716 targets `sparc-*-aout' and `sparclite-*-*' do provide software
717 floating point support.
719 `-msoft-float' changes the calling convention in the output file;
720 therefore, it is only useful if you compile *all* of a program with
721 this option. In particular, you need to compile `libgcc.a', the
722 library that comes with GNU CC, with `-msoft-float' in order for
726 Generate output containing quad-word (long double) floating point
730 Generate output containing library calls for quad-word (long
731 double) floating point instructions. The functions called are
732 those specified in the SPARC ABI. This is the default.
734 As of this writing, there are no sparc implementations that have
735 hardware support for the quad-word floating point instructions.
736 They all invoke a trap handler for one of these instructions, and
737 then the trap handler emulates the effect of the instruction.
738 Because of the trap handler overhead, this is much slower than
739 calling the ABI library routines. Thus the `-msoft-quad-float'
740 option is the default.
744 With `-mepilogue' (the default), the compiler always emits code for
745 function exit at the end of each function. Any function exit in
746 the middle of the function (such as a return statement in C) will
747 generate a jump to the exit code at the end of the function.
749 With `-mno-epilogue', the compiler tries to emit exit code inline
750 at every function exit.
754 With `-mflat', the compiler does not generate save/restore
755 instructions and will use a "flat" or single register window
756 calling convention. This model uses %i7 as the frame pointer and
757 is compatible with the normal register window model. Code from
758 either may be intermixed. The local registers and the input
759 registers (0-5) are still treated as "call saved" registers and
760 will be saved on the stack as necessary.
762 With `-mno-flat' (the default), the compiler emits save/restore
763 instructions (except for leaf functions) and is the normal mode of
766 `-mno-unaligned-doubles'
767 `-munaligned-doubles'
768 Assume that doubles have 8 byte alignment. This is the default.
770 With `-munaligned-doubles', GNU CC assumes that doubles have 8 byte
771 alignment only if they are contained in another type, or if they
772 have an absolute address. Otherwise, it assumes they have 4 byte
773 alignment. Specifying this option avoids some rare compatibility
774 problems with code generated by other compilers. It is not the
775 default because it results in a performance loss, especially for
780 These two options select variations on the SPARC architecture.
782 By default (unless specifically configured for the Fujitsu
783 SPARClite), GCC generates code for the v7 variant of the SPARC
786 `-mv8' will give you SPARC v8 code. The only difference from v7
787 code is that the compiler emits the integer multiply and integer
788 divide instructions which exist in SPARC v8 but not in SPARC v7.
790 `-msparclite' will give you SPARClite code. This adds the integer
791 multiply, integer divide step and scan (`ffs') instructions which
792 exist in SPARClite but not in SPARC v7.
794 These options are deprecated and will be deleted in GNU CC 2.9.
795 They have been replaced with `-mcpu=xxx'.
799 These two options select the processor for which the code is
802 With `-mcypress' (the default), the compiler optimizes code for the
803 Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx
804 series. This is also appropriate for the older SparcStation 1, 2,
807 With `-msupersparc' the compiler optimizes code for the SuperSparc
808 cpu, as used in the SparcStation 10, 1000 and 2000 series. This
809 flag also enables use of the full SPARC v8 instruction set.
811 These options are deprecated and will be deleted in GNU CC 2.9.
812 They have been replaced with `-mcpu=xxx'.
815 Set architecture type and instruction scheduling parameters for
816 machine type CPU_TYPE. Supported values for CPU_TYPE are `v7',
817 `cypress', `v8', `supersparc', `sparclite', `f930', `f934',
818 `sparclet', `tsc701', `v8plus', `v9', and `ultrasparc'.
821 Set the instruction scheduling parameters for machine type
822 CPU_TYPE, but do not set the architecture type as the option
823 `-mcpu='CPU_TYPE would. The same values for `-mcpu='CPU_TYPE are
824 used for `-mtune='CPU_TYPE.
827 Align loops to a 2 raised to a NUM byte boundary. If
828 `-malign-loops' is not specified, the default is 2.
831 Align instructions that are only jumped to to a 2 raised to a NUM
832 byte boundary. If `-malign-jumps' is not specified, the default
835 `-malign-functions=NUM'
836 Align the start of functions to a 2 raised to NUM byte boundary.
837 If `-malign-functions' is not specified, the default is 2 if
838 compiling for 32 bit sparc, and 5 if compiling for 64 bit sparc.
840 These `-m' switches are supported in addition to the above on the
844 Generate code for a processor running in little-endian mode.
847 Treat register `%g0' as a normal register. GCC will continue to
848 clobber it as necessary but will not assume it always reads as 0.
850 `-mbroken-saverestore'
851 Generate code that does not use non-trivial forms of the `save' and
852 `restore' instructions. Early versions of the SPARCLET processor
853 do not correctly handle `save' and `restore' instructions used with
854 arguments. They correctly handle them used without arguments. A
855 `save' instruction used without arguments increments the current
856 window pointer but does not allocate a new stack frame. It is
857 assumed that the window overflow trap handler will properly handle
858 this case as will interrupt handlers.
860 These `-m' switches are supported in addition to the above on SPARC
861 V9 processors in 64 bit environments.
864 Generate code for a processor running in little-endian mode.
868 Generate code for a 32 bit or 64 bit environment. The 32 bit
869 environment sets int, long and pointer to 32 bits. The 64 bit
870 environment sets int to 32 bits and long and pointer to 64 bits.
873 Generate code for the Medium/Low code model: the program must be
874 linked in the low 32 bits of the address space. Pointers are 64
875 bits. Programs can be statically or dynamically linked.
878 Generate code for the Medium/Middle code model: the program must
879 be linked in the low 44 bits of the address space, the text
880 segment must be less than 2G bytes, and data segment must be
881 within 2G of the text segment. Pointers are 64 bits.
884 Generate code for the Medium/Anywhere code model: the program may
885 be linked anywhere in the address space, the text segment must be
886 less than 2G bytes, and data segment must be within 2G of the text
887 segment. Pointers are 64 bits.
890 Generate code for the Medium/Anywhere code model for embedded
891 systems: assume a 32 bit text and a 32 bit data segment, both
892 starting anywhere (determined at link time). Register %g4 points
893 to the base of the data segment. Pointers still 64 bits.
894 Programs are statically linked, PIC is not supported.
898 With `-mstack-bias', GNU CC assumes that the stack pointer, and
899 frame pointer if present, are offset by -2047 which must be added
900 back when making stack frame references. Otherwise, assume no
901 such offset is present.
904 File: gcc.info, Node: Convex Options, Next: AMD29K Options, Prev: SPARC Options, Up: Submodel Options
909 These `-m' options are defined for Convex:
912 Generate output for C1. The code will run on any Convex machine.
913 The preprocessor symbol `__convex__c1__' is defined.
916 Generate output for C2. Uses instructions not available on C1.
917 Scheduling and other optimizations are chosen for max performance
918 on C2. The preprocessor symbol `__convex_c2__' is defined.
921 Generate output for C32xx. Uses instructions not available on C1.
922 Scheduling and other optimizations are chosen for max performance
923 on C32. The preprocessor symbol `__convex_c32__' is defined.
926 Generate output for C34xx. Uses instructions not available on C1.
927 Scheduling and other optimizations are chosen for max performance
928 on C34. The preprocessor symbol `__convex_c34__' is defined.
931 Generate output for C38xx. Uses instructions not available on C1.
932 Scheduling and other optimizations are chosen for max performance
933 on C38. The preprocessor symbol `__convex_c38__' is defined.
936 Generate code which puts an argument count in the word preceding
937 each argument list. This is compatible with regular CC, and a few
938 programs may need the argument count word. GDB and other
939 source-level debuggers do not need it; this info is in the symbol
943 Omit the argument count word. This is the default.
946 Allow volatile references to be cached. This is the default.
949 Volatile references bypass the data cache, going all the way to
950 memory. This is only needed for multi-processor code that does
951 not use standard synchronization instructions. Making
952 non-volatile references to volatile locations will not necessarily
956 Type long is 32 bits, the same as type int. This is the default.
959 Type long is 64 bits, the same as type long long. This option is
960 useless, because no library support exists for it.
963 File: gcc.info, Node: AMD29K Options, Next: ARM Options, Prev: Convex Options, Up: Submodel Options
968 These `-m' options are defined for the AMD Am29000:
971 Generate code that assumes the `DW' bit is set, i.e., that byte and
972 halfword operations are directly supported by the hardware. This
976 Generate code that assumes the `DW' bit is not set.
979 Generate code that assumes the system supports byte and halfword
980 write operations. This is the default.
983 Generate code that assumes the systems does not support byte and
984 halfword write operations. `-mnbw' implies `-mndw'.
987 Use a small memory model that assumes that all function addresses
988 are either within a single 256 KB segment or at an absolute
989 address of less than 256k. This allows the `call' instruction to
990 be used instead of a `const', `consth', `calli' sequence.
993 Use the normal memory model: Generate `call' instructions only when
994 calling functions in the same file and `calli' instructions
995 otherwise. This works if each file occupies less than 256 KB but
996 allows the entire executable to be larger than 256 KB. This is
1000 Always use `calli' instructions. Specify this option if you expect
1001 a single file to compile into more than 256 KB of code.
1004 Generate code for the Am29050.
1007 Generate code for the Am29000. This is the default.
1009 `-mkernel-registers'
1010 Generate references to registers `gr64-gr95' instead of to
1011 registers `gr96-gr127'. This option can be used when compiling
1012 kernel code that wants a set of global registers disjoint from
1013 that used by user-mode code.
1015 Note that when this option is used, register names in `-f' flags
1016 must use the normal, user-mode, names.
1019 Use the normal set of global registers, `gr96-gr127'. This is the
1024 Insert (or do not insert) a call to `__msp_check' after each stack
1025 adjustment. This is often used for kernel code.
1029 `-mstorem-bug' handles 29k processors which cannot handle the
1030 separation of a mtsrim insn and a storem instruction (most 29000
1031 chips to date, but not the 29050).
1033 `-mno-reuse-arg-regs'
1035 `-mno-reuse-arg-regs' tells the compiler to only use incoming
1036 argument registers for copying out arguments. This helps detect
1037 calling a function with fewer arguments than it was declared with.
1041 `-mimpure-text', used in addition to `-shared', tells the compiler
1042 to not pass `-assert pure-text' to the linker when linking a
1046 Generate output containing library calls for floating point.
1047 *Warning:* the requisite libraries are not part of GNU CC.
1048 Normally the facilities of the machine's usual C compiler are
1049 used, but this can't be done directly in cross-compilation. You
1050 must make your own arrangements to provide suitable library
1051 functions for cross-compilation.
1054 File: gcc.info, Node: ARM Options, Next: M32R/D Options, Prev: AMD29K Options, Up: Submodel Options
1059 These `-m' options are defined for Advanced RISC Machines (ARM)
1063 Generate a stack frame that is compliant with the ARM Procedure
1064 Call Standard for all functions, even if this is not strictly
1065 necessary for correct execution of the code.
1068 Generate code for a processor running with a 26-bit program
1069 counter, and conforming to the function calling standards for the
1070 APCS 26-bit option. This option replaces the `-m2' and `-m3'
1071 options of previous releases of the compiler.
1074 Generate code for a processor running with a 32-bit program
1075 counter, and conforming to the function calling standards for the
1076 APCS 32-bit option. This option replaces the `-m6' option of
1077 previous releases of the compiler.
1080 Generate output containing floating point instructions. This is
1084 Generate output containing library calls for floating point.
1085 *Warning:* the requisite libraries are not available for all ARM
1086 targets. Normally the facilities of the machine's usual C
1087 compiler are used, but this cannot be done directly in
1088 cross-compilation. You must make your own arrangements to provide
1089 suitable library functions for cross-compilation.
1091 `-msoft-float' changes the calling convention in the output file;
1092 therefore, it is only useful if you compile *all* of a program with
1093 this option. In particular, you need to compile `libgcc.a', the
1094 library that comes with GNU CC, with `-msoft-float' in order for
1098 Generate code for a processor running in little-endian mode. This
1099 is the default for all standard configurations.
1102 Generate code for a processor running in big-endian mode; the
1103 default is to compile code for a little-endian processor.
1105 `-mwords-little-endian'
1106 This option only applies when generating code for big-endian
1107 processors. Generate code for a little-endian word order but a
1108 big-endian byte order. That is, a byte order of the form
1109 `32107654'. Note: this option should only be used if you require
1110 compatibility with code for big-endian ARM processors generated by
1111 versions of the compiler prior to 2.8.
1113 `-mshort-load-bytes'
1114 Do not try to load half-words (eg `short's) by loading a word from
1115 an unaligned address. For some targets the MMU is configured to
1116 trap unaligned loads; use this option to generate code that is
1117 safe in these environments.
1119 `-mno-short-load-bytes'
1120 Use unaligned word loads to load half-words (eg `short's). This
1121 option produces more efficient code, but the MMU is sometimes
1122 configured to trap these instructions.
1125 This option only applies to RISC iX. Emulate the native BSD-mode
1126 compiler. This is the default if `-ansi' is not specified.
1129 This option only applies to RISC iX. Emulate the native
1130 X/Open-mode compiler.
1133 This option only applies to RISC iX. Do not run the assembler
1134 post-processor, `symrename', after code has been assembled.
1135 Normally it is necessary to modify some of the standard symbols in
1136 preparation for linking with the RISC iX C library; this option
1137 suppresses this pass. The post-processor is never run when the
1138 compiler is built for cross-compilation.
1141 File: gcc.info, Node: M32R/D Options, Next: M88K Options, Prev: ARM Options, Up: Submodel Options
1146 These `-m' options are defined for Mitsubishi M32R/D architectures:
1148 `-mcode-model=small'
1149 Assume all objects live in the lower 16MB of memory (so that their
1150 addresses can be loaded with the `ld24' instruction), and assume
1151 all subroutines are reachable with the `bl' instruction. This is
1154 The addressability of a particular object can be set with the
1157 `-mcode-model=medium'
1158 Assume objects may be anywhere in the 32 bit address space (the
1159 compiler will generate `seth/add3' instructions to load their
1160 addresses), and assume all subroutines are reachable with the `bl'
1163 `-mcode-model=large'
1164 Assume objects may be anywhere in the 32 bit address space (the
1165 compiler will generate `seth/add3' instructions to load their
1166 addresses), and assume subroutines may not be reachable with the
1167 `bl' instruction (the compiler will generate the much slower
1168 `seth/add3/jl' instruction sequence).
1171 Disable use of the small data area. Variables will be put into
1172 one of `.data', `bss', or `.rodata' (unless the `section'
1173 attribute has been specified). This is the default.
1175 The small data area consists of sections `.sdata' and `.sbss'.
1176 Objects may be explicitly put in the small data area with the
1177 `section' attribute using one of these sections.
1180 Put small global and static data in the small data area, but do not
1181 generate special code to reference them.
1184 Put small global and static data in the small data area, and
1185 generate special instructions to reference them.
1188 Put global and static objects less than or equal to NUM bytes into
1189 the small data or bss sections instead of the normal data or bss
1190 sections. The default value of NUM is 8. The `-msdata' option
1191 must be set to one of `sdata' or `use' for this option to have any
1194 All modules should be compiled with the same `-G NUM' value.
1195 Compiling with different values of NUM may or may not work; if it
1196 doesn't the linker will give an error message - incorrect code
1197 will not be generated.