source: trunk/third/gcc/gcc.info-3 @ 11288

Revision 11288, 48.3 KB checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r11287, which included commits to RCS files with non-trunk default branches.
Line 
1This is Info file gcc.info, produced by Makeinfo version 1.67 from the
2input file gcc.texi.
3
4   This file documents the use and the internals of the GNU compiler.
5
6   Published by the Free Software Foundation 59 Temple Place - Suite 330
7Boston, MA 02111-1307 USA
8
9   Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998
10Free Software Foundation, Inc.
11
12   Permission is granted to make and distribute verbatim copies of this
13manual provided the copyright notice and this permission notice are
14preserved on all copies.
15
16   Permission is granted to copy and distribute modified versions of
17this manual under the conditions for verbatim copying, provided also
18that the sections entitled "GNU General Public License," "Funding for
19Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
20included exactly as in the original, and provided that the entire
21resulting derived work is distributed under the terms of a permission
22notice identical to this one.
23
24   Permission is granted to copy and distribute translations of this
25manual into another language, under the above conditions for modified
26versions, except that the sections entitled "GNU General Public
27License," "Funding for Free Software," and "Protect Your Freedom--Fight
28`Look And Feel'", and this permission notice, may be included in
29translations approved by the Free Software Foundation instead of in the
30original English.
31
32
33File: gcc.info,  Node: Preprocessor Options,  Next: Assembler Options,  Prev: Optimize Options,  Up: Invoking GCC
34
35Options Controlling the Preprocessor
36====================================
37
38   These options control the C preprocessor, which is run on each C
39source file before actual compilation.
40
41   If you use the `-E' option, nothing is done except preprocessing.
42Some of these options make sense only together with `-E' because they
43cause the preprocessor output to be unsuitable for actual compilation.
44
45`-include FILE'
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.
52
53`-imacros FILE'
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
58     input.
59
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.
64
65`-idirafter DIR'
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
69     that `-I' adds to).
70
71`-iprefix PREFIX'
72     Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
73
74`-iwithprefix DIR'
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.
80
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
84     `-iwithprefix'.
85
86`-isystem DIR'
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.
90
91`-nostdinc'
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'.
96
97     By using both `-nostdinc' and `-I-', you can limit the include-file
98     search path to only those directories you specify explicitly.
99
100`-undef'
101     Do not predefine any nonstandard macros.  (Including architecture
102     flags).
103
104`-E'
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.
108
109`-C'
110     Tell the preprocessor not to discard comments.  Used with the `-E'
111     option.
112
113`-P'
114     Tell the preprocessor not to generate `#line' directives.  Used
115     with the `-E' option.
116
117`-M'
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.
126
127     `-M' implies `-E'.
128
129     Another way to specify output of a `make' rule is by setting the
130     environment variable `DEPENDENCIES_OUTPUT' (*note Environment
131     Variables::.).
132
133`-MM'
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.
137
138`-MD'
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.
143
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
146     `make' command.
147
148`-MMD'
149     Like `-MD' except mention only user header files, not system
150     header files.
151
152`-MG'
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'.
157
158`-H'
159     Print the name of each header file used, in addition to other
160     normal activities.
161
162`-AQUESTION(ANSWER)'
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
166     machine.
167
168`-DMACRO'
169     Define macro MACRO with the string `1' as its definition.
170
171`-DMACRO=DEFN'
172     Define macro MACRO as DEFN.  All instances of `-D' on the command
173     line are processed before any `-U' options.
174
175`-UMACRO'
176     Undefine macro MACRO.  `-U' options are evaluated after all `-D'
177     options, but before any `-include' and `-imacros' options.
178
179`-dM'
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.
183
184`-dD'
185     Tell the preprocessing to pass all macro definitions into the
186     output, in their proper sequence in the rest of the output.
187
188`-dN'
189     Like `-dD' except that the macro arguments and contents are
190     omitted.  Only `#define NAME' is included in the output.
191
192`-trigraphs'
193     Support ANSI C trigraphs.  The `-ansi' option also has this effect.
194
195`-Wp,OPTION'
196     Pass OPTION as an option to the preprocessor.  If OPTION contains
197     commas, it is split into multiple options at the commas.
198
199
200File: gcc.info,  Node: Assembler Options,  Next: Link Options,  Prev: Preprocessor Options,  Up: Invoking GCC
201
202Passing Options to the Assembler
203================================
204
205   You can pass options to the assembler.
206
207`-Wa,OPTION'
208     Pass OPTION as an option to the assembler.  If OPTION contains
209     commas, it is split into multiple options at the commas.
210
211
212File: gcc.info,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GCC
213
214Options for Linking
215===================
216
217   These options come into play when the compiler links object files
218into an executable output file.  They are meaningless if the compiler is
219not doing a link step.
220
221`OBJECT-FILE-NAME'
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
226     input to the linker.
227
228`-c'
229`-S'
230`-E'
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
233     Options::.
234
235`-lLIBRARY'
236     Search the library named LIBRARY when linking.
237
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.
243
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.
247
248     The directories searched include several standard system
249     directories plus any that you specify with `-L'.
250
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.
259
260`-lobjc'
261     You need this special case of the `-l' option in order to link an
262     Objective C program.
263
264`-nostartfiles'
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.
268
269`-nodefaultlibs'
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.
273
274`-nostdlib'
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.
278
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':
290     Collect2..)
291
292`-s'
293     Remove all symbol table and relocation information from the
294     executable.
295
296`-static'
297     On systems that support dynamic linking, this prevents linking
298     with the shared libraries.  On other systems, this option has no
299     effect.
300
301`-shared'
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.
306
307`-symbolic'
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.
312
313`-Xlinker 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
316     how to recognize.
317
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.
324
325`-Wl,OPTION'
326     Pass OPTION as an option to the linker.  If OPTION contains
327     commas, it is split into multiple options at the commas.
328
329`-u SYMBOL'
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.
333
334
335File: gcc.info,  Node: Directory Options,  Next: Target Options,  Prev: Link Options,  Up: Invoking GCC
336
337Options for Directory Search
338============================
339
340   These options specify directories to search for header files, for
341libraries and for parts of the compiler:
342
343`-IDIR'
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.
351
352`-I-'
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>'.
356
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.)
360
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.
368
369     `-I-' does not inhibit the use of the standard system directories
370     for header files.  Thus, `-I-' and `-nostdinc' are independent.
371
372`-LDIR'
373     Add directory DIR to the list of directories to be searched for
374     `-l'.
375
376`-BPREFIX'
377     This option specifies where to find the executables, libraries,
378     include files, and data files of the compiler itself.
379
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::.).
384
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.
392
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
399     prefix.
400
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.
405
406     Another way to specify a prefix much like the `-B' prefix is to use
407     the environment variable `GCC_EXEC_PREFIX'.  *Note Environment
408     Variables::.
409
410`-specs=FILE'
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,
416     from left to right.
417
418
419File: gcc.info,  Node: Target Options,  Next: Submodel Options,  Prev: Directory Options,  Up: Invoking GCC
420
421Specifying Target Machine and Compiler Version
422==============================================
423
424   By default, GNU CC compiles code for the same type of machine that
425you are using.  However, it can also be installed as a cross-compiler,
426to compile for some other type of machine.  In fact, several different
427configurations of GNU CC, for different target machines, can be
428installed side by side.  Then you specify which one to use with the
429`-b' option.
430
431   In addition, older and newer versions of GNU CC can be installed side
432by side.  One of them (probably the newest) will be the default, but
433you may sometimes wish to use another.
434
435`-b MACHINE'
436     The argument MACHINE specifies the target machine for compilation.
437     This is useful when you have installed GNU CC as a cross-compiler.
438
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.
444
445     When you do not specify `-b', it normally means to compile for the
446     same type of machine that you are using.
447
448`-V VERSION'
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.
452
453     The default version, when you do not specify `-V', is the last
454     version of GNU CC that you installed.
455
456   The `-b' and `-V' options actually work by controlling part of the
457file name used for the executable files and libraries used for
458compilation.  A given version of GNU CC, for a given target machine, is
459normally kept in the directory `/usr/local/lib/gcc-lib/MACHINE/VERSION'.
460
461   Thus, sites can customize the effect of `-b' or `-V' either by
462changing the names of these directories or adding alternate names (or
463symbolic 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
465for `-b i386v'.
466
467   In one respect, the `-b' or `-V' do not completely change to a
468different compiler: the top-level driver program `gcc' that you
469originally invoked continues to run and invoke the other executables
470(preprocessor, compiler per se, assembler and linker) that do the real
471work.  However, since no real work is done in the driver program, it
472usually does not matter that the driver program in use is not the one
473for the specified target and version.
474
475   The only way that the driver program depends on the target machine is
476in the parsing and handling of special machine-specific options.
477However, this is controlled by a file which is found, along with the
478other executables, in the directory for the specified version and
479target machine.  As a result, a single installed driver program adapts
480to any specified target machine and compiler version.
481
482   The driver program executable does control one significant thing,
483however: the default version and target machine.  Therefore, you can
484install different instances of the driver program, compiled for
485different targets or versions, under different names.
486
487   For example, if the driver for version 2.0 is installed as `ogcc'
488and that for version 2.1 is installed as `gcc', then the command `gcc'
489will use version 2.1 by default, while `ogcc' will use 2.0 by default.
490However, you can choose either version with either command with the
491`-V' option.
492
493
494File: gcc.info,  Node: Submodel Options,  Next: Code Gen Options,  Prev: Target Options,  Up: Invoking GCC
495
496Hardware Models and Configurations
497==================================
498
499   Earlier we discussed the standard option `-b' which chooses among
500different installed compilers for completely different target machines,
501such as Vax vs. 68000 vs. 80386.
502
503   In addition, each of these target machine types can have its own
504special options, starting with `-m', to choose among various hardware
505models or configurations--for example, 68010 vs 68020, floating
506coprocessor or none.  A single installed version of the compiler can
507compile for any model or configuration, according to the options
508specified.
509
510   Some configurations of the compiler also support additional special
511options, usually for compatibility with other compilers on the same
512platform.
513
514   These options are defined by the macro `TARGET_SWITCHES' in the
515machine description.  The default for the options is also defined by
516that macro, which enables you to change the defaults.
517
518* Menu:
519
520* M680x0 Options::
521* VAX Options::
522* SPARC Options::
523* Convex Options::
524* AMD29K Options::
525* ARM Options::
526* MN10300 Options::
527* M32R/D Options::
528* M88K Options::
529* RS/6000 and PowerPC Options::
530* RT Options::
531* MIPS Options::
532* i386 Options::
533* HPPA Options::
534* Intel 960 Options::
535* DEC Alpha Options::
536* Clipper Options::
537* H8/300 Options::
538* SH Options::
539* System V Options::
540* V850 Options::
541
542
543File: gcc.info,  Node: M680x0 Options,  Next: VAX Options,  Up: Submodel Options
544
545M680x0 Options
546--------------
547
548   These are the `-m' options defined for the 68000 series.  The default
549values for these options depends on which style of 68000 was selected
550when the compiler was configured; the defaults for the most common
551choices are given below.
552
553`-m68000'
554`-mc68000'
555     Generate output for a 68000.  This is the default when the
556     compiler is configured for 68000-based systems.
557
558`-m68020'
559`-mc68020'
560     Generate output for a 68020.  This is the default when the
561     compiler is configured for 68020-based systems.
562
563`-m68881'
564     Generate output containing 68881 instructions for floating point.
565     This is the default for most 68020 systems unless `-nfp' was
566     specified when the compiler was configured.
567
568`-m68030'
569     Generate output for a 68030.  This is the default when the
570     compiler is configured for 68030-based systems.
571
572`-m68040'
573     Generate output for a 68040.  This is the default when the
574     compiler is configured for 68040-based systems.
575
576     This option inhibits the use of 68881/68882 instructions that have
577     to be emulated by software on the 68040.  If your 68040 does not
578     have code to emulate those instructions, use `-m68040'.
579
580`-m68060'
581     Generate output for a 68060.  This is the default when the
582     compiler is configured for 68060-based systems.
583
584     This option inhibits the use of 68020 and 68881/68882 instructions
585     that have to be emulated by software on the 68060.  If your 68060
586     does not have code to emulate those instructions, use `-m68060'.
587
588`-m5200'
589     Generate output for a 520X "coldfire" family cpu.  This is the
590     default when the compiler is configured for 520X-based systems.
591
592`-m68020-40'
593     Generate output for a 68040, without using any of the new
594     instructions.  This results in code which can run relatively
595     efficiently on either a 68020/68881 or a 68030 or a 68040.  The
596     generated code does use the 68881 instructions that are emulated
597     on the 68040.
598
599`-m68020-60'
600     Generate output for a 68060, without using any of the new
601     instructions.  This results in code which can run relatively
602     efficiently on either a 68020/68881 or a 68030 or a 68040.  The
603     generated code does use the 68881 instructions that are emulated
604     on the 68060.
605
606`-mfpa'
607     Generate output containing Sun FPA instructions for floating point.
608
609`-msoft-float'
610     Generate output containing library calls for floating point.
611     *Warning:* the requisite libraries are not available for all m68k
612     targets.  Normally the facilities of the machine's usual C
613     compiler are used, but this can't be done directly in
614     cross-compilation.  You must make your own arrangements to provide
615     suitable library functions for cross-compilation.  The embedded
616     targets `m68k-*-aout' and `m68k-*-coff' do provide software
617     floating point support.
618
619`-mshort'
620     Consider type `int' to be 16 bits wide, like `short int'.
621
622`-mnobitfield'
623     Do not use the bit-field instructions.  The `-m68000' option
624     implies `-mnobitfield'.
625
626`-mbitfield'
627     Do use the bit-field instructions.  The `-m68020' option implies
628     `-mbitfield'.  This is the default if you use a configuration
629     designed for a 68020.
630
631`-mrtd'
632     Use a different function-calling convention, in which functions
633     that take a fixed number of arguments return with the `rtd'
634     instruction, which pops their arguments while returning.  This
635     saves one instruction in the caller since there is no need to pop
636     the arguments there.
637
638     This calling convention is incompatible with the one normally used
639     on Unix, so you cannot use it if you need to call libraries
640     compiled with the Unix compiler.
641
642     Also, you must provide function prototypes for all functions that
643     take variable numbers of arguments (including `printf'); otherwise
644     incorrect code will be generated for calls to those functions.
645
646     In addition, seriously incorrect code will result if you call a
647     function with too many arguments.  (Normally, extra arguments are
648     harmlessly ignored.)
649
650     The `rtd' instruction is supported by the 68010, 68020, 68030,
651     68040, and 68060 processors, but not by the 68000 or 5200.
652
653`-malign-int'
654`-mno-align-int'
655     Control whether GNU CC aligns `int', `long', `long long', `float',
656     `double', and `long double' variables on a 32-bit boundary
657     (`-malign-int') or a 16-bit boundary (`-mno-align-int').  Aligning
658     variables on 32-bit boundaries produces code that runs somewhat
659     faster on processors with 32-bit busses at the expense of more
660     memory.
661
662     *Warning:* if you use the `-malign-int' switch, GNU CC will align
663     structures containing the above types  differently than most
664     published application binary interface specifications for the m68k.
665
666
667File: gcc.info,  Node: VAX Options,  Next: SPARC Options,  Prev: M680x0 Options,  Up: Submodel Options
668
669VAX Options
670-----------
671
672   These `-m' options are defined for the Vax:
673
674`-munix'
675     Do not output certain jump instructions (`aobleq' and so on) that
676     the Unix assembler for the Vax cannot handle across long ranges.
677
678`-mgnu'
679     Do output those jump instructions, on the assumption that you will
680     assemble with the GNU assembler.
681
682`-mg'
683     Output code for g-format floating point numbers instead of
684     d-format.
685
686
687File: gcc.info,  Node: SPARC Options,  Next: Convex Options,  Prev: VAX Options,  Up: Submodel Options
688
689SPARC Options
690-------------
691
692   These `-m' switches are supported on the SPARC:
693
694`-mno-app-regs'
695`-mapp-regs'
696     Specify `-mapp-regs' to generate output using the global registers
697     2 through 4, which the SPARC SVR4 ABI reserves for applications.
698     This is the default.
699
700     To be fully SVR4 ABI compliant at the cost of some performance
701     loss, specify `-mno-app-regs'.  You should compile libraries and
702     system software with this option.
703
704`-mfpu'
705`-mhard-float'
706     Generate output containing floating point instructions.  This is
707     the default.
708
709`-mno-fpu'
710`-msoft-float'
711     Generate output containing library calls for floating point.
712     *Warning:* the requisite libraries are not available for all SPARC
713     targets.  Normally the facilities of the machine's usual C
714     compiler are used, but this cannot be done directly in
715     cross-compilation.  You must make your own arrangements to provide
716     suitable library functions for cross-compilation.  The embedded
717     targets `sparc-*-aout' and `sparclite-*-*' do provide software
718     floating point support.
719
720     `-msoft-float' changes the calling convention in the output file;
721     therefore, it is only useful if you compile *all* of a program with
722     this option.  In particular, you need to compile `libgcc.a', the
723     library that comes with GNU CC, with `-msoft-float' in order for
724     this to work.
725
726`-mhard-quad-float'
727     Generate output containing quad-word (long double) floating point
728     instructions.
729
730`-msoft-quad-float'
731     Generate output containing library calls for quad-word (long
732     double) floating point instructions.  The functions called are
733     those specified in the SPARC ABI.  This is the default.
734
735     As of this writing, there are no sparc implementations that have
736     hardware support for the quad-word floating point instructions.
737     They all invoke a trap handler for one of these instructions, and
738     then the trap handler emulates the effect of the instruction.
739     Because of the trap handler overhead, this is much slower than
740     calling the ABI library routines.  Thus the `-msoft-quad-float'
741     option is the default.
742
743`-mno-epilogue'
744`-mepilogue'
745     With `-mepilogue' (the default), the compiler always emits code for
746     function exit at the end of each function.  Any function exit in
747     the middle of the function (such as a return statement in C) will
748     generate a jump to the exit code at the end of the function.
749
750     With `-mno-epilogue', the compiler tries to emit exit code inline
751     at every function exit.
752
753`-mno-flat'
754`-mflat'
755     With `-mflat', the compiler does not generate save/restore
756     instructions and will use a "flat" or single register window
757     calling convention.  This model uses %i7 as the frame pointer and
758     is compatible with the normal register window model.  Code from
759     either may be intermixed.  The local registers and the input
760     registers (0-5) are still treated as "call saved" registers and
761     will be saved on the stack as necessary.
762
763     With `-mno-flat' (the default), the compiler emits save/restore
764     instructions (except for leaf functions) and is the normal mode of
765     operation.
766
767`-mno-unaligned-doubles'
768`-munaligned-doubles'
769     Assume that doubles have 8 byte alignment.  This is the default.
770
771     With `-munaligned-doubles', GNU CC assumes that doubles have 8 byte
772     alignment only if they are contained in another type, or if they
773     have an absolute address.  Otherwise, it assumes they have 4 byte
774     alignment.  Specifying this option avoids some rare compatibility
775     problems with code generated by other compilers.  It is not the
776     default because it results in a performance loss, especially for
777     floating point code.
778
779`-mv8'
780`-msparclite'
781     These two options select variations on the SPARC architecture.
782
783     By default (unless specifically configured for the Fujitsu
784     SPARClite), GCC generates code for the v7 variant of the SPARC
785     architecture.
786
787     `-mv8' will give you SPARC v8 code.  The only difference from v7
788     code is that the compiler emits the integer multiply and integer
789     divide instructions which exist in SPARC v8 but not in SPARC v7.
790
791     `-msparclite' will give you SPARClite code.  This adds the integer
792     multiply, integer divide step and scan (`ffs') instructions which
793     exist in SPARClite but not in SPARC v7.
794
795     These options are deprecated and will be deleted in GNU CC 2.9.
796     They have been replaced with `-mcpu=xxx'.
797
798`-mcypress'
799`-msupersparc'
800     These two options select the processor for which the code is
801     optimised.
802
803     With `-mcypress' (the default), the compiler optimizes code for the
804     Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx
805     series.  This is also appropriate for the older SparcStation 1, 2,
806     IPX etc.
807
808     With `-msupersparc' the compiler optimizes code for the SuperSparc
809     cpu, as used in the SparcStation 10, 1000 and 2000 series. This
810     flag also enables use of the full SPARC v8 instruction set.
811
812     These options are deprecated and will be deleted in GNU CC 2.9.
813     They have been replaced with `-mcpu=xxx'.
814
815`-mcpu=CPU_TYPE'
816     Set the instruction set, register set, and instruction scheduling
817     parameters for machine type CPU_TYPE.  Supported values for
818     CPU_TYPE are `v7', `cypress', `v8', `supersparc', `sparclite',
819     `f930', `f934', `sparclet', `tsc701', `v9', and `ultrasparc'.
820
821     Default instruction scheduling parameters are used for values that
822     select an architecture and not an implementation.  These are `v7',
823     `v8', `sparclite', `sparclet', `v9'.
824
825     Here is a list of each supported architecture and their supported
826     implementations.
827
828              v7:             cypress
829              v8:             supersparc
830              sparclite:      f930, f934
831              sparclet:       tsc701
832              v9:             ultrasparc
833
834`-mtune=CPU_TYPE'
835     Set the instruction scheduling parameters for machine type
836     CPU_TYPE, but do not set the instruction set or register set that
837     the option `-mcpu='CPU_TYPE would.
838
839     The same values for `-mcpu='CPU_TYPE are used for
840     `-mtune='CPU_TYPE, though the only useful values are those that
841     select a particular cpu implementation: `cypress', `supersparc',
842     `f930', `f934', `tsc701', `ultrasparc'.
843
844`-malign-loops=NUM'
845     Align loops to a 2 raised to a NUM byte boundary.  If
846     `-malign-loops' is not specified, the default is 2.
847
848`-malign-jumps=NUM'
849     Align instructions that are only jumped to to a 2 raised to a NUM
850     byte boundary.  If `-malign-jumps' is not specified, the default
851     is 2.
852
853`-malign-functions=NUM'
854     Align the start of functions to a 2 raised to NUM byte boundary.
855     If `-malign-functions' is not specified, the default is 2 if
856     compiling for 32 bit sparc, and 5 if compiling for 64 bit sparc.
857
858   These `-m' switches are supported in addition to the above on the
859SPARCLET processor.
860
861`-mlittle-endian'
862     Generate code for a processor running in little-endian mode.
863
864`-mlive-g0'
865     Treat register `%g0' as a normal register.  GCC will continue to
866     clobber it as necessary but will not assume it always reads as 0.
867
868`-mbroken-saverestore'
869     Generate code that does not use non-trivial forms of the `save' and
870     `restore' instructions.  Early versions of the SPARCLET processor
871     do not correctly handle `save' and `restore' instructions used with
872     arguments.  They correctly handle them used without arguments.  A
873     `save' instruction used without arguments increments the current
874     window pointer but does not allocate a new stack frame.  It is
875     assumed that the window overflow trap handler will properly handle
876     this case as will interrupt handlers.
877
878   These `-m' switches are supported in addition to the above on SPARC
879V9 processors in 64 bit environments.
880
881`-mlittle-endian'
882     Generate code for a processor running in little-endian mode.
883
884`-m32'
885`-m64'
886     Generate code for a 32 bit or 64 bit environment.  The 32 bit
887     environment sets int, long and pointer to 32 bits.  The 64 bit
888     environment sets int to 32 bits and long and pointer to 64 bits.
889
890`-mcmodel=medlow'
891     Generate code for the Medium/Low code model: the program must be
892     linked in the low 32 bits of the address space.  Pointers are 64
893     bits.  Programs can be statically or dynamically linked.
894
895`-mcmodel=medmid'
896     Generate code for the Medium/Middle code model: the program must
897     be linked in the low 44 bits of the address space, the text
898     segment must be less than 2G bytes, and data segment must be
899     within 2G of the text segment.  Pointers are 64 bits.
900
901`-mcmodel=medany'
902     Generate code for the Medium/Anywhere code model: the program may
903     be linked anywhere in the address space, the text segment must be
904     less than 2G bytes, and data segment must be within 2G of the text
905     segment.  Pointers are 64 bits.
906
907`-mcmodel=embmedany'
908     Generate code for the Medium/Anywhere code model for embedded
909     systems: assume a 32 bit text and a 32 bit data segment, both
910     starting anywhere (determined at link time).  Register %g4 points
911     to the base of the data segment.  Pointers still 64 bits.
912     Programs are statically linked, PIC is not supported.
913
914`-mstack-bias'
915`-mno-stack-bias'
916     With `-mstack-bias', GNU CC assumes that the stack pointer, and
917     frame pointer if present, are offset by -2047 which must be added
918     back when making stack frame references.  Otherwise, assume no
919     such offset is present.
920
921
922File: gcc.info,  Node: Convex Options,  Next: AMD29K Options,  Prev: SPARC Options,  Up: Submodel Options
923
924Convex Options
925--------------
926
927   These `-m' options are defined for Convex:
928
929`-mc1'
930     Generate output for C1.  The code will run on any Convex machine.
931     The preprocessor symbol `__convex__c1__' is defined.
932
933`-mc2'
934     Generate output for C2.  Uses instructions not available on C1.
935     Scheduling and other optimizations are chosen for max performance
936     on C2.  The preprocessor symbol `__convex_c2__' is defined.
937
938`-mc32'
939     Generate output for C32xx.  Uses instructions not available on C1.
940     Scheduling and other optimizations are chosen for max performance
941     on C32.  The preprocessor symbol `__convex_c32__' is defined.
942
943`-mc34'
944     Generate output for C34xx.  Uses instructions not available on C1.
945     Scheduling and other optimizations are chosen for max performance
946     on C34.  The preprocessor symbol `__convex_c34__' is defined.
947
948`-mc38'
949     Generate output for C38xx.  Uses instructions not available on C1.
950     Scheduling and other optimizations are chosen for max performance
951     on C38.  The preprocessor symbol `__convex_c38__' is defined.
952
953`-margcount'
954     Generate code which puts an argument count in the word preceding
955     each argument list.  This is compatible with regular CC, and a few
956     programs may need the argument count word.  GDB and other
957     source-level debuggers do not need it; this info is in the symbol
958     table.
959
960`-mnoargcount'
961     Omit the argument count word.  This is the default.
962
963`-mvolatile-cache'
964     Allow volatile references to be cached.  This is the default.
965
966`-mvolatile-nocache'
967     Volatile references bypass the data cache, going all the way to
968     memory.  This is only needed for multi-processor code that does
969     not use standard synchronization instructions.  Making
970     non-volatile references to volatile locations will not necessarily
971     work.
972
973`-mlong32'
974     Type long is 32 bits, the same as type int.  This is the default.
975
976`-mlong64'
977     Type long is 64 bits, the same as type long long.  This option is
978     useless, because no library support exists for it.
979
980
981File: gcc.info,  Node: AMD29K Options,  Next: ARM Options,  Prev: Convex Options,  Up: Submodel Options
982
983AMD29K Options
984--------------
985
986   These `-m' options are defined for the AMD Am29000:
987
988`-mdw'
989     Generate code that assumes the `DW' bit is set, i.e., that byte and
990     halfword operations are directly supported by the hardware.  This
991     is the default.
992
993`-mndw'
994     Generate code that assumes the `DW' bit is not set.
995
996`-mbw'
997     Generate code that assumes the system supports byte and halfword
998     write operations.  This is the default.
999
1000`-mnbw'
1001     Generate code that assumes the systems does not support byte and
1002     halfword write operations.  `-mnbw' implies `-mndw'.
1003
1004`-msmall'
1005     Use a small memory model that assumes that all function addresses
1006     are either within a single 256 KB segment or at an absolute
1007     address of less than 256k.  This allows the `call' instruction to
1008     be used instead of a `const', `consth', `calli' sequence.
1009
1010`-mnormal'
1011     Use the normal memory model: Generate `call' instructions only when
1012     calling functions in the same file and `calli' instructions
1013     otherwise.  This works if each file occupies less than 256 KB but
1014     allows the entire executable to be larger than 256 KB.  This is
1015     the default.
1016
1017`-mlarge'
1018     Always use `calli' instructions.  Specify this option if you expect
1019     a single file to compile into more than 256 KB of code.
1020
1021`-m29050'
1022     Generate code for the Am29050.
1023
1024`-m29000'
1025     Generate code for the Am29000.  This is the default.
1026
1027`-mkernel-registers'
1028     Generate references to registers `gr64-gr95' instead of to
1029     registers `gr96-gr127'.  This option can be used when compiling
1030     kernel code that wants a set of global registers disjoint from
1031     that used by user-mode code.
1032
1033     Note that when this option is used, register names in `-f' flags
1034     must use the normal, user-mode, names.
1035
1036`-muser-registers'
1037     Use the normal set of global registers, `gr96-gr127'.  This is the
1038     default.
1039
1040`-mstack-check'
1041`-mno-stack-check'
1042     Insert (or do not insert) a call to `__msp_check' after each stack
1043     adjustment.  This is often used for kernel code.
1044
1045`-mstorem-bug'
1046`-mno-storem-bug'
1047     `-mstorem-bug' handles 29k processors which cannot handle the
1048     separation of a mtsrim insn and a storem instruction (most 29000
1049     chips to date, but not the 29050).
1050
1051`-mno-reuse-arg-regs'
1052`-mreuse-arg-regs'
1053     `-mno-reuse-arg-regs' tells the compiler to only use incoming
1054     argument registers for copying out arguments.  This helps detect
1055     calling a function with fewer arguments than it was declared with.
1056
1057`-mno-impure-text'
1058`-mimpure-text'
1059     `-mimpure-text', used in addition to `-shared', tells the compiler
1060     to not pass `-assert pure-text' to the linker when linking a
1061     shared object.
1062
1063`-msoft-float'
1064     Generate output containing library calls for floating point.
1065     *Warning:* the requisite libraries are not part of GNU CC.
1066     Normally the facilities of the machine's usual C compiler are
1067     used, but this can't be done directly in cross-compilation.  You
1068     must make your own arrangements to provide suitable library
1069     functions for cross-compilation.
1070
1071
1072File: gcc.info,  Node: ARM Options,  Next: MN10300 Options,  Prev: AMD29K Options,  Up: Submodel Options
1073
1074ARM Options
1075-----------
1076
1077   These `-m' options are defined for Advanced RISC Machines (ARM)
1078architectures:
1079
1080`-mapcs-frame'
1081     Generate a stack frame that is compliant with the ARM Procedure
1082     Call Standard for all functions, even if this is not strictly
1083     necessary for correct execution of the code.
1084
1085`-mapcs-26'
1086     Generate code for a processor running with a 26-bit program
1087     counter, and conforming to the function calling standards for the
1088     APCS 26-bit option.  This option replaces the `-m2' and `-m3'
1089     options of previous releases of the compiler.
1090
1091`-mapcs-32'
1092     Generate code for a processor running with a 32-bit program
1093     counter, and conforming to the function calling standards for the
1094     APCS 32-bit option.  This option replaces the `-m6' option of
1095     previous releases of the compiler.
1096
1097`-mhard-float'
1098     Generate output containing floating point instructions.  This is
1099     the default.
1100
1101`-msoft-float'
1102     Generate output containing library calls for floating point.
1103     *Warning:* the requisite libraries are not available for all ARM
1104     targets.  Normally the facilities of the machine's usual C
1105     compiler are used, but this cannot be done directly in
1106     cross-compilation.  You must make your own arrangements to provide
1107     suitable library functions for cross-compilation.
1108
1109     `-msoft-float' changes the calling convention in the output file;
1110     therefore, it is only useful if you compile *all* of a program with
1111     this option.  In particular, you need to compile `libgcc.a', the
1112     library that comes with GNU CC, with `-msoft-float' in order for
1113     this to work.
1114
1115`-mlittle-endian'
1116     Generate code for a processor running in little-endian mode.  This
1117     is the default for all standard configurations.
1118
1119`-mbig-endian'
1120     Generate code for a processor running in big-endian mode; the
1121     default is to compile code for a little-endian processor.
1122
1123`-mwords-little-endian'
1124     This option only applies when generating code for big-endian
1125     processors.  Generate code for a little-endian word order but a
1126     big-endian byte order.  That is, a byte order of the form
1127     `32107654'.  Note: this option should only be used if you require
1128     compatibility with code for big-endian ARM processors generated by
1129     versions of the compiler prior to 2.8.
1130
1131`-mshort-load-bytes'
1132     Do not try to load half-words (eg `short's) by loading a word from
1133     an unaligned address.  For some targets the MMU is configured to
1134     trap unaligned loads; use this option to generate code that is
1135     safe in these environments.
1136
1137`-mno-short-load-bytes'
1138     Use unaligned word loads to load half-words (eg `short's).  This
1139     option produces more efficient code, but the MMU is sometimes
1140     configured to trap these instructions.
1141
1142`-mbsd'
1143     This option only applies to RISC iX.  Emulate the native BSD-mode
1144     compiler.  This is the default if `-ansi' is not specified.
1145
1146`-mxopen'
1147     This option only applies to RISC iX.  Emulate the native
1148     X/Open-mode compiler.
1149
1150`-mno-symrename'
1151     This option only applies to RISC iX.  Do not run the assembler
1152     post-processor, `symrename', after code has been assembled.
1153     Normally it is necessary to modify some of the standard symbols in
1154     preparation for linking with the RISC iX C library; this option
1155     suppresses this pass.  The post-processor is never run when the
1156     compiler is built for cross-compilation.
1157
1158
1159File: gcc.info,  Node: MN10300 Options,  Next: M32R/D Options,  Prev: ARM Options,  Up: Submodel Options
1160
1161MN10300 Options
1162---------------
1163
1164   These `-m' options are defined for Matsushita MN10300 architectures:
1165
1166`-mmult-bug'
1167     Generate code to avoid bugs in the multiply instructions for the
1168     MN10300 processors.  This is the default.
1169
1170`-mno-mult-bug'
1171     Do not generate code to avoid bugs in the multiply instructions
1172     for the MN10300 processors.
1173
1174
1175File: gcc.info,  Node: M32R/D Options,  Next: M88K Options,  Prev: MN10300 Options,  Up: Submodel Options
1176
1177M32R/D Options
1178--------------
1179
1180   These `-m' options are defined for Mitsubishi M32R/D architectures:
1181
1182`-mcode-model=small'
1183     Assume all objects live in the lower 16MB of memory (so that their
1184     addresses can be loaded with the `ld24' instruction), and assume
1185     all subroutines are reachable with the `bl' instruction.  This is
1186     the default.
1187
1188     The addressability of a particular object can be set with the
1189     `model' attribute.
1190
1191`-mcode-model=medium'
1192     Assume objects may be anywhere in the 32 bit address space (the
1193     compiler will generate `seth/add3' instructions to load their
1194     addresses), and assume all subroutines are reachable with the `bl'
1195     instruction.
1196
1197`-mcode-model=large'
1198     Assume objects may be anywhere in the 32 bit address space (the
1199     compiler will generate `seth/add3' instructions to load their
1200     addresses), and assume subroutines may not be reachable with the
1201     `bl' instruction (the compiler will generate the much slower
1202     `seth/add3/jl' instruction sequence).
1203
1204`-msdata=none'
1205     Disable use of the small data area.  Variables will be put into
1206     one of `.data', `bss', or `.rodata' (unless the `section'
1207     attribute has been specified).  This is the default.
1208
1209     The small data area consists of sections `.sdata' and `.sbss'.
1210     Objects may be explicitly put in the small data area with the
1211     `section' attribute using one of these sections.
1212
1213`-msdata=sdata'
1214     Put small global and static data in the small data area, but do not
1215     generate special code to reference them.
1216
1217`-msdata=use'
1218     Put small global and static data in the small data area, and
1219     generate special instructions to reference them.
1220
1221`-G NUM'
1222     Put global and static objects less than or equal to NUM bytes into
1223     the small data or bss sections instead of the normal data or bss
1224     sections.  The default value of NUM is 8.  The `-msdata' option
1225     must be set to one of `sdata' or `use' for this option to have any
1226     effect.
1227
1228     All modules should be compiled with the same `-G NUM' value.
1229     Compiling with different values of NUM may or may not work; if it
1230     doesn't the linker will give an error message - incorrect code
1231     will not be generated.
1232
Note: See TracBrowser for help on using the repository browser.