Gcc User Manual (4)-General Linux technology-Linux programming and kernel information. Read the following for details. The following '-m' option is used for MIPS Family computers:
-Mcpu = cpu-type
When the command is generated, assume that the default machine type is cpu-type. The default cpu-type is defa.
Ult, GCC will select the command that is the longest cycle time on any model, so that the code can be in all the MIP
S processors run at a reasonable speed. Other options for cpu-type are r2000, r3000, r4000, and r.
6000. Although a cpu-type is selected, GCC will schedule the corresponding work for the selected chip, if
Do not specify ?? -With the-mips2 or-mips3 option, the compiler will not output any non-mips isa (instructio
N set architecture) level-1 code.
-Mips2
Output mips isa second-level commands (possible extensions, such as square root commands).-mcpu = r4000 or-mcpu = r6000
The option must be used with-mips2.
-Mips3
Output mips isa Level 3 command (64-bit command). The-mcpu = r4000 option must be used with-mips2.
-Mips3)
-Mint64
-Mlong64
-Mlonglong128
These options do not work currently.
-Mmips-
Generates code for MIPS Assembler and adds common debugging information using mips-tfile. For most
Platform: This is the default option, except for OSF/1 reference platform, it uses the OSF/rose target format. If any
-Ggdb,-ststabs, or-ststabs + Option Switch, the mips-tfile program encapsulates stab in MIPS EC
OFF.
-Mgas
Generate code for the GNU assembler. This is the default option on the OSF/1 Reference Platform and it uses the OSF/rose target
Format.
-Mrnames
-Mno-rnames
-The mrnames switch option tells the output code to use the MIPS software name to describe the register, instead of the hardware name (
Yes, use a0 instead). The GNU assembler does not support the-mrnames option, while the MIPS assembler runs the mips c pre-
The processor processes the source file.-mno-rnames is the default option.
-Mgpopt
-Mno-gpopt
-The mgpopt switch option requires that all data statements be written to the front of the instruction in the body segment, so that various MIPS assembly
To output a single word for short global or static data items (short global or static data items ).
Memory Access instead of Dual-word memory access. This is the default function when compilation optimization is enabled.
-Mstats
-Mno-stats
After a non-inline function is processed, the-mstats switch option causes the compiler
The quasi-error file outputs a line of program statistics (number of stored registers, stack size, and so on ).
-Mmemcpy
-Mno-memcpy
-The mmemcpy option enables all block movement operations to call the appropriate string function (memcpy or bcopy), while
Not to generate embedded code.
-Mmips-tfile
-Mno-mips-tfile
When the MIPS assembler generates the mips-tfile file (used for debugging), The-mno-mips-tfile Option
Prevents the compiler from using the mips-tfile post-processing (postprocess) target file. If you do not run mips-tfile
There is no local variable followed by the debugger. In addition, the stage2 and stage3 target files will pass the temporary file name
The assembler is embedded in the target file, which means that the target file is not compared.
-Msoft-float
The output contains floating-point library calls. Warning: the required library is not part of gnu cc. Generally, this model is used locally.
The corresponding components of the C compiler, but cannot be directly used for cross-compilation. You must arrange it yourself to provide cross-Compilation
Library function used.
-Mhard-float
The output contains floating point commands. If the compiler is not modified, This is the default option.
-Mfp64
The compiler considers the FR (on) of the state word, that is, there is a 32 64-bit floating-point register, instead of a 32 32
-Bit floating point register. The-mcpu = r4000 and-mips3 must be enabled at the same time.
-Mfp32
32 32-bit floating point register. This is the default option.
-Mabicils
-Mno-abicils
Output (or do not output). abicils,. cpload, And. cprestore pseudocommands, some System V.4 versions
Used for location-independent code.
-Mhalf-pic
-Mno-half-pic
-The mhalf-pic option requires that the externally referenced pointer be placed in the Data Segment and loaded into the memory, instead of being placed in the positive
Text. This option does not work currently.
-G num
Place the global or static data smaller than or equal to num in a small data segment or bss segment, rather than a common data segment.
Or bss segment. In this way, the assembler can output single-Word Memory Access commands based on global pointers (gp or Cool, rather than general
By default, when MIPS assembler is used, num is 8, while the GNU assembler is 0. In addition,-Gn
The um option is also passed to the assembler and connector. All modules must be compiled under the same-Gnum value.
-Nocpp
When you compile an assembly file (with the '. s' suffix), the MIPS assembler is told not to run the Preprocessor.
The following '-m' option is used for Intel 80386 computers:-m1 _
Mno-486
Control whether to generate code optimized for 486.
-Msoft-float
The output contains floating-point library calls. Warning: the required library is not part of gnu cc. Generally, this model is used locally.
The corresponding components of the C compiler, but cannot be directly used for cross-compilation. You must arrange it yourself to provide cross-Compilation
Library function used.
When the function places the floating point return value on the machine of the 80387 register stack, even if the '-msoft-float' option is set
May also issue some floating point operation codes.
Mno-fp-ret-in-387
Function values are returned without using the FPU register.
The function call Convention usually places the return values of float and double in the FPU register, even if FPU does not exist.
The idea is that the operating system should simulate FPU.
The '-mno-fp-ret-in-387' option enables floating point values to be returned through common CPU registers.
The following '-m' option is used for HPPA computers:
Mpa-risc-1-0
Generates the target code of the PA 1.0 processor.
Mpa-risc-1-1
Generates the target code of the PA 1.1 processor.
-Mkernel
Generate the target code for the kernel. In particular, avoid the add command. One parameter is the DP register. Use addil
Replace the add command. This avoids a serious bug in the HP-UX connector.
-Mshared-libs
Generates a target code that can connect to the HP-UX shared library. This option does not implement all functionality, default off for PA targets
Closed. This option will cause the compiler to generate an incorrect target code.
-Mno-shared-libs
Do not generate the target code to connect to the HP-UX shared library. This is the default option for the PA target.
-Mlong-CILS
The generated target code allows function calls in the same source file. The distance between the call point and the called function can exceed 2.
56 k away. You do not need to turn on this option unless the connector gives ''branch out of range erro
Rs.
-Mdisable-fpregs
Prevents the use of floating-point registers in any situation. This option is required for compiling the kernel. The kernel switches the execution of floating-point registers.
The speed of the row environment is very slow. If this option is enabled and a floating point operation is attempted at the same time, compilation will fail.
-Mdisable-indexing
Prevent the compiler from using the index address mode. In this way, compile the MIG generation on the MACH.
To avoid some obscure problems.
-Mtrailing-colon
Add a colon (for ELF assembler) at the end of the label definition ).
The following '-m' option is used for Intel 80960 computers:
-Mcpu-type
The default machine type is cpu-type, which enables the compiler to generate corresponding commands. The address mode and memory are aligned. The default
The cpu-type is kb. Other options include ka, mc, ca, cf, sa, and sb.
-Mnumerics
-Msoft-float
-The mnumerics switch option indicates that the processor does not support floating point commands.-The msoft-float switch option indicates that it should not
This indicates that the machine supports floating point operations.
-Mleaf-procedures
-Mno-leaf-procedures
Attempts (or prevention) to change the leaf procedure so that it can be called by the bal and call commands.
For direct function calls, if the bal command can be replaced by the assembler or connector, this can generate a more effective generation.
Code, but in other cases, produce inefficient code, such as calling a function through a function pointer, or
With this optimized connector.
-Mtail-call
-Mno-tail-call
Execute (or do not execute) more attempts (except those unrelated to the compiler) to optimize tail recursion into the branch
(Tail-recursive) call. You may not need this because the detection is not complete.
The default switch is-mno-tail-call.
-Mcomplex-addr
-Mno-complex-addr
It is considered (or not considered) that the current i960 device is worth using the composite address mode (complex addressing
Mode). The compound address mode may not be applicable to the K Series, but it must be used in the C series.
And CC processors. On other processors-mcomplex-addr is the default option.
-Mcode-align
-Mno-code-align
Alignment the target code to the 8-byte boundary (or not required), so that the read speed will be faster. Currently, only C series
Open.
-Mic-compat
-Mic2.0-compat
-Mic3.0-compat
Compatible with iC960 v2.0 or v3.0.
-Masm-compat
-Mintel-asm
Compatible with iC960 assembler.
-Mstrict-align
-Mno-strict-align
Access with (or without) Non-Alignment boundaries is not allowed.
-Mold-align
Structure-alignment is compatible with Intel's gcc release version 1.3 (based on gcc 1.37 ).
This option is a bit problematic at present, because # pragma align 1 is always set in the same way and cannot be switched off.
The following '-m' option is used for the DEC Alpha device:
-Mno-soft-float
-Msoft-float
Use (or do not use) Hardware floating point commands for floating point operations. When-msoft-float is enabled, 'libgcc
1. The functions in c 'perform floating-point operations. Unless they are replaced by a simulated floating-point operation routine, or similarly, they are
Compiled to call simulation routines, which will initiate floating-point operations.
Translation program, you must ensure that this library is created so that simulation routines are not called.
Note that Alpha without floating point operations also requires floating point registers.
-Mfp-reg
-Mno-fp-regs
Generate the target code for using (or not using) the floating-point register group.-mno-fp-regs contains-msoft-float
Switch option. If the floating-point register is not used, the floating-point operand is transmitted through the integer register like an integer,
Put the floating point operation result instead of $ f0. this is a non-standard call, so any parameter or return value with a floating point
If the target Code Compiled by the-mno-fp-regs switch is called, it must also be compiled using this option.
This option is typically used to establish a kernel, and the kernel does not use any floating-point registers, so there is no need to save and restore
Repeat these registers.
The following additional options appear in System V version 4 to be compatible with other compilers in these systems:
-G
In the SVr4 system, gcc accepts the '-G' option for compatibility (and passes it to the connector). However, we recommend that you use
Use the '-symbolic' or '-shared' option instead of the gcc command line.
-Qy
Verify the version of the tool used by the compiler and output it to The. ident Assembly command.
-Qn
Stop the. ident command at the output end (default option ).
-YP, dirs
For the library file specified by '-l', only search for dirs. You can use a colon to separate directory items in dirs.
-Ym, dir
Find the M4 Preprocessor in the dir directory. The assembler uses this option.
CODE GENERATION OPTION)
The following options are irrelevant to the platform and used to control the interface conventions for generating the target code.
Most options start with '-F'. These options have two formats: "-ffoo" and "-ffoo ".
'-Fno-foo'. The following description will only list one of the formats-non-default format. You can add
Add or remove 'no-'to deduce another format.
-Fnonnull-objects
Assume that the object obtained through reference is not null (only C ++ ).
In general, gnu c ++ makes conservative assumptions on the objects obtained through reference. For example, the compiler will certainly check
A In the code is not null:
Obj & a = g (); a. f (2 );
Checking similar references requires additional code, but it is not necessary for many programs. If your program does not
You can ignore this check using the '-fnonnull-objects' option.
-Fpcc-struct-return
When the function returns the struct and union values, it adopts the same parameter conventions as the local compiler. For a small structure,
This Convention is inefficient and cannot be re-imported on many machines. It has the advantage of allowing GCC to compile the target code.
And the target Code Compiled by PCC call each other.
-Freg-struct-return
It is possible to return the values of the struct and union functions through registers. For a small structure, it is better than-fpcc-st.
Ruct-return is more efficient.
If neither-fpcc-struct-return nor-freg-struct-return, GNU CC
By default, the standard convention of the target machine is used. If there is no standard convention, gnu cc uses-fpcc-struct-re by default.
Turn.
-Fshort-enums
Only the number of bytes in the declared value range is allocated to the enum type. That is to say, the enum type is equal to the size of enough.
The smallest integer type.
-Fshort-double
Make the size of the double type the same as that of the float type.
-Fshared-data
The data that requires compilation results and non-const variables are shared data, rather than private data.
It makes sense on the operating system that the shared data is shared among several processes of the same program, while private data
Each process has a secondary component.
-Fno-common
Even uninitialized global variables are allocated to the bss segment of the target file, instead of using them as common blocks (com
Mon block). The result is that if the same variable is declared in two different compilation results (
If you do not use extern), an error will occur when you connect them. This option may be useful only when you want
Verify that the program runs on another system, which is always the case for other systems.
-Fno-ident
Ignore the '# ident' command.
-Fno-gnu-linker
Do not output global initialization components (such as C ++ constructor and deconstruct) as the format used by the GNU connector (in G
The NU connector is a standard method system). You can use this option when you plan to use a non-GNU connector.
Non-GNU connectors also require the collect2 program to ensure that the system connector is placed into the constructor and
Destructor. (The gnu cc release package contains the collect2 program .)
In ect2 systems, the compiler driver gcc is automatically configured to do so.
-Finhibit-size-directive
Do not output. size Assembly commands, or other similar commands. When a function is split into two parts, the two parts are in the memory
A long distance may cause problems. This option is required when 'crtstuff. c' is compiled; otherwise
Use.
-Fverbose-asm
Add additional comments when outputting assembly code. This option is only used when you really need to read Assembly output.
(When debugging the compiler itself ).
-Fvolatile
Make the compiler think that all the memory accessed through pointers is volatile ).
-Fvolatile-global
Make the compiler think that all external and global variables are variable memory.
-Fpic
If this type of target machine is supported, the compiler generates a location-independent target code, which is applicable to shared librar
Y ).
-FPIC
If this type of target machine is supported, the compiler outputs location-independent target codes. This method is applicable to dynamic connections (dynamic lin ).
King), even if the branch needs to be transferred in a large range.
-Ffixed-reg
Treat registers Named reg as fixed registers (fixed register); the generated destination code should not be referenced
It (except for a stack pointer, frame pointer, or other fixed roles ).
Reg must be the register name. The register name depends on the machine. Use the machine to describe REGISTER_NA of the macro file.
MES macro definition.
This option does not have a negative format because it lists three choices.
-Fcall-used-reg
The register name reg is regarded as an allocable register and cannot be used between function calls. It can be used temporarily or
If you use a variable, the lifetime cannot exceed one function. In this way, the compiled function does not need to save or restore the reg register.
If the registers described in this option are used as fixed roles in the executable module, catastrophic results will be produced,
For example, a stack pointer or frame pointer.
This option does not have a negative format because it lists three choices.
-Fcall-saved-reg
View the registers Named reg according to the allocable registers protected by the function. They can be used temporarily or as variables.
It can even survive between functions. In this way, the compiled function will save and restore the reg register in use.
If the registers described in this option are used as fixed roles in the executable module, catastrophic results will be produced,
For example, a stack pointer or frame pointer.
Another disaster is to use the Register described in this option to return the function value.
This option does not have a negative format because it lists three choices.
PRAGMAS
Gnu c ++ supports two '# pragm' commands to enable the same header file to have two purposes: Interface Definition of the object class
Complete object class content definition.
# Pragma interface
(Only for C ++) in the header file that defines the object class, using this command can save most of the targets that use this class.
File size. In general, some information (embedded member functions backup sub-parts, debugging information, implement virtual functions)
The local sub-parts must be saved in each target file containing the class definition.
The gma command can avoid such replication. When the compilation references the header file containing the '# pragma interface' command
Will not generate the auxiliary information (unless the input main file uses '# pragma implementation
'Command). As an alternative, the target file will contain references that can be parsed during connection ).
# Pragma implementation
# Pragma implementation "objects. h"
(Only for C ++) If you want to generate a complete output (globally visible) from the original file, you should
Use the '# pragma interface' command in The pragma header file.
The tation file will generate backup and debugging information for all embedded member functions, and implement internal tables of virtual functions.
If '# pragma implementation' does not contain a parameter, it indicates that it has the same basic name as the source file.
For example, in 'allclass. CC', '# pragma implementation' is equal to '# pragma implement
Ation allclass. h '. If an implementation file needs to introduce code from multiple headers
This string parameter is used.
It is impossible to divide the content in a header file into multiple implementation files.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service