GCC Chinese Manual (in) ZZ

xiaoxiao2021-03-06  16

-Wparentheses

In some cases, if you ignore the brackets

,

Warning

.

-WTemplate-Debugging

In

C

Used in the program

Template

when

,

If debugging

(Debugging)

Not completely effective

,

Warning

(

only use for

C ).

-Wall

Combined with all of the above

`-W '

Option

.

Usually we recommend to avoid these warned usage, we believe

,

The use of proper combination of macros can easily avoid these usage.

The remaining `-w ... 'option is not included in` -wall', because we believe that these compiler warned program structures can be reasonably used in the "clean" program.

-Wtraditional

If some program structure is in a tradition

C

Performance and

ANSI C

different

,

Warning

.

*

Macro ginseng appears in a string constant in the macro body

.

Tradition

C

Alternative macro

,

and

ANSI C

Then depend on part of a constant

.

*

A function in block

(Block)

Declaration is external

,

But call after the end of the block

.

*

Switch

The operability type of the statement is

Long.

-Wshadow

Once some local variables are blocked, another part variable

,

Warning

.

-WID-CLASH-LEN

Once the two determined identifiers have the same top

Len

Character

,

Warning

.

He can help you develop some obsolete

,

Procedure compiled on the compiler of the brain

.

-Wpointer-Arith

Any statement relies on the size of the function type

(size)

or

Void

Type size

,

Warning

GNU C

For convenience of calculation

Void *

Pointer and function pointer

,

That is defined as the size of these types

1.

-WCAST-QAL

Once a pointer is forced to transform, when the type modifier is removed

,

Warning

.

E.g

,

If

Const char *

Forced to convert to ordinary

Char *

Time

,

Warning will appear

.

-WCAST-ALIGN

Once a pointer type is forced to convert

,

Alignment to the address required for the target

(Alignment)

increase

,

Warning

.

E.g

,

Some machines can only be

2

or

4

Access integer on the byte boundary

,

If you put on this model

Char *

Forced conversion

Int *

Types of

,

Warning

.

-WWRITE-STRINGS

The type of string constant is specified is

Const char [length],

therefore

,

Copy this address to

Non-const char *

The pointer will produce a warning

.

These warnings can help you find out the code that is trying to write a critical quantity during compilation.

,

But you must use very carefully in the statement and intra shape

CONST,

Otherwise they can only bring trouble

;

So we didn't let

`-Wall '

Provide these warnings

.

-WConversion

If the type conversion caused by a function is different, the type conversion is different when there is no function.

,

Warning

.

Here, the mutual conversion of the fixed point and floating point number

,

Change the width or symbol of the fixed point number

,

Unless they and default statements

(Default Promotion)

the same

.

-Waggregate-return

If you define or call the return structure or a combined function

,

Warning

(

From language perspective you can return an array

,

However, it will cause warnings

.)

-Wstrict-prototypes

If the function's declaration or definition does not point out parameter types

,

Warning

(

If the forward reference description of the function points to the parameter type

,

Allows the use of old-style function definitions

,

Can't produce warning

.)

-Wmissing-prototypes

If there is no pre-declare function, the full-term function is defined.

,

Warning

.

Even if the function defines the original shape, it will generate this warning.

.

His purpose is to check the global function that is not declared in the header file.

.

-Wmissing-declarations

If there is no pre-declaration, it defines a full-class function.

,

Warning

.

Even if the function defines the original shape, it will generate this warning.

.

The purpose of this option is to check the global function that is not declared in the header file.

.

-Wredundant-decls

If you define multiple declarations in the same visible domain

,

Warning

,

Even if these repetitive declarations are valid and have no difference

.

-Wnested-externs

If a certain

Extern

Declaration appears inside the function

,

Warning

.

-Wenum-Clash

A warning for the conversion between different enumeration types

(

Only applies to

C ).

-Wlong-long

If used

Long Long

Types issued a warning

.

This warning is the default

.

use

`-Wno-long-long '

Options to prevent this warning

. `-Wlong-long '

with

`-Wno-long-long '

only at

`-pedant

Under the way

.

-WOverLoaded-Virtual

(

Only applies to

C .)

In inheritance

,

Definition of virtual functions must match the type feature declared in the virtual function in the base class

(TYPE SIGNATURE).

When the inheritance is declared a function

,

It may be a wrong attempt to define a virtual function

,

Use this option to generate warnings

:

that is

,

When a function and the virtual function in the base class are the same name

,

However, the type characteristics do not meet any virtual functions of the base class.

,

The compiler will issue a warning

.

-Winline

If a function cannot embed inner

(inline),

Whether it is a statement

inline

Or is it specified

-finline-functions

Option

,

The compiler will issue a warning

.

-Wrror

Vision warning is wrong

;

Any warning will give up compilation

.

Debugging option (DEBUGGING OPTION)

GNU CC

Have a lot of special options

,

Can debug users' programs

,

Can also

GCC

Tired

:

-g

Local format in operating system

(Stabs, Coff, XCoff,

or

DWARF).

Generate debugging information

GDB

Can use these debugging information

.

On most of the system using the Stabs format, `-g 'option launches additional debugging information that only GDB is used; this information makes the GDB debugging effect, but it is possible to cause other debugger crashes, or refuse to read the program. If You determine if you want to generate additional information, use `-gstabs ',` -gstabs', `-gxcoff ',` -gxcoff', `-gdwarf ', or` -gdwarf' (see below).

Unlike most C compilers, the GNU CC allows for use in the `-g 'and` -o' option. Optimized code occasionally manufactures some surprises: some declared variables do not exist at all; the control flow directly to It is expected that some statements are not executed because the calculation results are constant or have been determined; some statements are executed elsewhere because they have been moved outside.

However, it proves that the output of debug optimization is possible. It is reasonable to use an optimizer to use an optimizer that may contain errors.

If the GNU CC supports outputting multiple debugging information, the following options are very useful.

-ggdb

Local format

(

If supported

)

Output debugging information

,

As much as possible

GDB

Expand

.

-gstabs

In

Stabs

format

(

If supported

)

Output debugging information

,

Not included

GDB

Expand

.

This is most

BSD

System

DBX

Use format

.

-gstabs

In

Stabs

format

(

If supported

)

Output debugging information

,

Use only

Gnu

Debugger (GDB)

Understandable

Gnu

Expand

.

Using these extensions may result in other debuggers crashing or refusing to read

.

-gcoff

In

Coff

format

(

If supported

)

Output debugging information

.

This is at

System v

Most of the fourth edition

System v

System

SDB

Use format

.

-gxcoff

In

XCOFF

format

(

If supported

)

Output debugging information

.

this is

IBM RS / 6000

System

DBX

Format used by the debugger

.

-gxcoff

In

XCOFF

format

(

If supported

)

Output debugging information

,

Use only

Gnu

Debugger

(GDB)

Understandable

Gnu

Expand

.

Using these extensions may result in other debuggers crashing or refusing to read

.

-gdwarf

In

DWARF

format

(

If supported

)

Output debugging information

.

This is most

System v

Fourth edition system

SDB

Use format

.

-gdwarf

In

DWARF

format

(

If supported

)

Output debugging information

,

Use only

Gnu

Debugger

(GDB)

Understandable

Gnu

Expand

.

Using these extensions may result in other debuggers crashing or refusing to read

.

-glevel -ggdblevel -gstabslevel -gcofflevel -gxcofflevel

-gdwarflevel

Request to generate debugging information

,

At the same time

Level

Point out how much information

.

default

Level

Value

2.

Level 1 outputs the minimum amount of information, only enough in the program that does not plan to debug, include the description of the function and external variable, but there is no local variable and line number information.

Level 3 contains more information, such as all macro definitions that appear in the program. When you use the `-g3 'option, some debuggers support macro expansion.

-p

Generate additional code

,

Output

Profile

information

,

Analysis program

PROF

use

.

-pg

Generate additional code

,

Output

Profile

information

,

Analysis program

GPROF

use

.

-A

Generate additional code

,

Used to output basic blocks

(Basic Block)

of

Profile

information

,

It records the number of executions of each basic block

,

For example

TCOV

Program analysis of this class

.

But pay attention

,

This data format is not

TCOV

expected

.

finally

GNU Gprof

These data will be processed

.

-AX

Generate additional code

,

Use

'bb.in'

Document reading basic block

Profile

parameter

,

Put

Profile

The result is written

'bb.out'

file

. `bb.in '

Contains a list of functions

.

Once a function in the list is entered

, PROFILE

Operation begins

,

After leaving the outermost function

, PROFILE

End of operation

.

In

`- '

Exclude the function of the preceded name

Profile

Outside operation

.

If the function name is not unique

,

It can write

`/path/filename.d:functionname '

Come to clarify

. `bb.out '

Will list some valid file names

.

These four function names have special meaning

: `__BB_JUMPS__ '

Lead to jump

(JUMP)

Frequency writing

`bb.out '.` __bb_trace__'

Resulting in the basic block sequence through the pipe

`gzip ',

Output

`bbtrace.gz '

file

. `__BB_HIDECALL__ '

Leading from tracking

(Trace)

Exclude

Call

instruction

. `__BB_SHOWRET__ '

Resulting in tracking instructions

.

-dletters

When compiled,

in

letters

Specified timing

(DUMP).

Used to debug compiler

.

Most dump file names add words to the source file name

(

E.g

`foo.c.rtl '

or

`foo.c.jump ').

-dm

Dump all macro definitions at the end of the pretreatment

,

No output to the file

.

-DN

Dump all macro names at the end of the pretreatment

.

-DD

Dump all macro definitions at the end of the pretreatment

,

Eat on normal output

.

-dy

Parsing

(PARSE)

Time to transfer debugging information in standard error

.

-dr

RTL

Dump after the stage

`file.rtl '.

-DX

Generate only the function

RTL,

Not compiling

.

Usually and

`r '

Join

.

-dj

After the first jump optimization

`file.jump '.

-DS

CSE

Including sometimes following

CSE

Rear jump optimization

)

After dump

`file.cse '.

-DL

Recurns and then dump

`file.loop '.

-dt

the second time

CSE

deal with

(

Including sometimes following

CSE

Rear jump optimization

)

After dump

`file.cse2 '.

-DF

Process analysis

(Flow Analysis)

After dump

`file.flow '.

-DC

Instruction combination

(Instruction Combination)

After dump

`file.combine '.

-DS

First instruction arrangement

(instruction schedule)

After dump

`file.sched '.

-DL

Dump after the local register is allocated

`file.lreg '.

-dg

The global register is allocated after dump

`file.greg '.

-dr

Second command arrangement

(instruction schedule)

After dump

`file.sched2 '.

-dj

The last jump optimization is dump

`file.jump2 '.

-DD

Postpone branch schedule

Delayed Branch Scheduling

After dump

`file.dbr '.

-DK

register

-

The stack is transferred after transition to

`file.stack '.

-DA

Generate all dumps

.

-dm

After running

,

In standard error display memory usage statistics

.

-DP

What models are used in assembly output filling

(Pattern)

And alternative mode

.

-fpretend-float

Cross-compilation

,

Assume that the target machine and the host use the same floating point format

.

It causes floating point constants for output errors

,

But when running on the target machine

,

Real instruction sequences are likely to

GNU CC

Hopeful

.

-SAVE-TEMPS

Save those usually

``

temporary

'' '

Intermediate file

;

Place in the current directory

,

And naming according to the source file

.

therefore

,

use

`-c -save-temps'

Option compilation

`foo.c '

Generate

`foo.cpp '

with

`foo.s'

as well as

`foo.o '

file

.

-Print-file-name = library

Display library file

Library

Full path name

,

Use this library when connecting

---

What else is not

.

According to this option

, GNU CC

Neither compilation

,

Nor connected

,

Only display the file name

.

-Print-libgcc-file-name

with

`-Print-file-name = libgcc.a '

same

.

-Print-prog-name = program is similar to

`-Print-file-name ',

But find the program

PROGRAM

Such as

`CPP '.

Optimization option (Optimization Option)

These options control a variety of optimization measures

:

-O

-O1

optimization

.

For large functions

,

Optimize compilation to occupy a slight time and quite large memory

.

When not using the `-o 'option, the compiler's goal is to reduce the compilation overhead, so that the compile results can be debugged. Statement is independent: If you use a breakpoint abort from two statements, you can re-assign any variables. Or point the program counter to other statements in the function body, and accurately obtain the results you expect from the source program.

When you don't use the `-o 'option, you only declare that the REGISTER variable is allocated to use the register. The compile result is slightly inferior to the PCC that does not need to be` -o' option.

Using the `-o 'option, the compiler will try to reduce the size and execution time of the target code.

If you specify the `-o 'option,` -fthread-jumps' option will be opened. On the machine with DELAY SLOT, `-fdelayed-branch' option will be opened. Even if there is no frame Frame Pointer also supports debugging machines, `-fomit-frame-pointer 'option will be opened. Some machines may also open other options.

-O2

More optimization

.

In addition to optimization options involving spatial and speed exchange

,

Execute almost all optimization

.

For example, do not loop

(loop unrolling)

And functions

Inline.

with

-O

Option comparison

,

This option adds both compilation time

,

Also improve the operation of generating code

.

-O3

More more

.

Except

-O2

All

,

It is also open

-finline-functions

Option

.

-O0

Non-optimization

.

If you specify multiple -O options, no matter how the belt does not have a number, the last option is an option to take effect.

Options such as `-fflag 'describe some of the machine-independent switches. Most switches have affirmative and negation two formats; the negative format of` -ffoo' switch option should be `-fno-foo '. The following list is only displayed A format --- that is not a default option. You can construct another format by removing or adding `NO- '.

-ffloat-store

Do not store floating point variables in registers

.

This prevents unwanted high precision on some machines

,

Such as

68000

Floating point register

(

From

68881)

The precision saved exceeded

Double

Accuracy should have

.

For most programs, only high precision is only good. However, some procedures are strictly dependent on the definition of the IEEE floating point number. You can use the `-ffloat-store 'option for such programs.

-fmemoize-lookups

-fsave-memoized

Exploration method

(HEURISTIC)

Make faster compilation

(

Only

C ).

Discovery is not used by default

.

Since the exploration method is only valid for some input files

,

Compiling speeds of other programs will become slower

.

The first compiler must establish a call to the member function (or reference to member data). It must (1) to determine if this class implements the member function of that name; (2) Decide which member function of the call (involved) Specifies which type of conversion you need to do); (3) Check if the member function is visible to the caller. All of these constitute a slower compilation. General circumstances, the second to member functions (or reference to member data), It must be processed again after the same length. This means like this code

COUT << "this" << p << "HAS" << n << "leggs./n";

It is necessary to do six traverses for the entire three steps. By using software cache, `` hit '' can significantly reduce this price. However, unfortunately, using this kind of cache must implement other mechanisms, bringing its own overhead. `-fmemoize-lookups 'option Open the software cache. Because the function of the function is different, the access to the member and member function may be different, G may need to refresh the cache. Use the` -fmemoize-lookups' option, Each compilation is completely refreshed. The `-fsave-memoized 'option also enables the same cache, but when the compiler finds the access rights generated by the final compiled function, the next function is the same, the compiler Keep the cache content. This is very useful when you define a number of member functions for a class: In addition to some other classes, each member function has exactly the same access as the other member functions, so there is no need to refresh the cache.

-fno-default-inline

Silently do not embed the member function

,

Because they define within the scope of the class

(

only

C ).

-fno-defer-pop

Once the function returns

,

The parameter is immediately popped up

.

Machines that must be popped up after the call function

,

The compiler generally allows the parameters that call several functions to stack on the stack

,

Then pop up all times

.

-FFORCE-MEM

Before making mathematical operations, send the memory operand to use into the register

.

Convert memory to a potential public sub-expression

,

It may produce a better target code

.

If they are not public sub-expressions

,

Instruction combinations should eliminate their respective registers

.

I am happy to listen to different opinions.

.

-FFORCE-ADDR

Before making mathematical operations, send memory address constants to use into the register

.

It may be

`-fforce-mem '

A good target code

.

I am happy to listen to different opinions.

.

-FOMIT-FRAME-POINTER

For no frame pointer

Frame Pointer

The function

,

Do not save the frame pointer in the register

.

This avoids preservation

,

Setting and recovering the instruction of the frame pointer

;

Also provide an additional register for many functions

.

But in most machines will not be debugged

.

Some machines, such as VAX, this option is invalid because the standard call sequence automatically processes the frame pointer, and does not save anything by pretending to exist without saving anything. Machine Description Macro Frame_Pointer_Required Controls whether the target is supported.

-finline-functions

Integrate all simple functions into invigoors

.

The compiler explores what functions are simple enough

,

Worth this integration

.

If all the calls of all given functions are integrated, and the function declares that it is static, then the GCC has the right to not follow the assembly code output function.

-fcaller-saves

Allows value in the register

,

But this scheme is usually used by each function called

,

therefore

GCC

Generate additional code

,

Save and restore register content before and after the function call

.

Such assignments are achieved only when the generated code looks better than the anti-the results.

.

Some machines This option defaults to allow, usually these machines do not call the protection register instead of use.

-fkeep-inline-functions

Even if all calls are integrated

,

And the function is declared

STATIC,

Still output this function a separate

,

Releaseable version

.

-fno-function-cse

Do not store the function address into the register

;

Let the instruction of the call fixed function explicitly give the function address

.

This option generates a low efficiency target code, but if this option is not used, some unusual HACK, change the output of the handup, may be confused due to optimization.

-fno-peephole

Prohibit any machine

Peephole

optimization

.

-FFAST-MATH

This option is for speed optimization

,

allow

GCC

Violate certain

ANSI

or

IEEE

rule

/

specification

.

E.g

,

It allows compiler to assume

SQRT

The parameters of the function are non-negative numbers

.

This option is not opened by any `-o 'option, because for mathematics functions implemented strictly on the IEEE or ANSI rules / specification, the program may generate errors. The following options control a specific optimization.` -O2' option open Most optimization items, in addition to `-funroll-loops 'and` -funroll-all-loops' items.

The `-o 'option typically opens the` -fthread-jumps' and `-fdelayed-branch' optimization item, but the default optimization item on a particular machine is possible to change.

If you are very needed in special case, you can use the following options.

-fstregth-reduuce

Reduce loop strength

(Loop Stregth Reduction)

optimization

,

And eliminate repeating variables

.

-fthread-jumps

The location where the optimization is

,

If there is another condition of the destination of a jump branch

,

And this condition is included within the previous comparative statement

,

So implement optimization

.

According to the conditions

True

or

False,

The front branch redirects to the second branch or followed behind the second branch

.

-funroll-loops

Perform loop

(loop unrolling)

optimization

.

Only the number of cycles can be implemented at the time of compile or when the runtime is compiled.

.

-funroll-all-loops

Perform loop

(loop unrolling)

optimization

.

Implement all loops

.

Usually make the program run slower

.

-fcse-follow-jumps

In public sub-expression

(Common SubExpression Elimination)

when

,

If there is no other path to reach a destination of a jump

,

Sweake this

JUMP

instruction

.

E.g

,

in case

CSE

Encounter

Else

Squeaky

IF

Statement

,

When the condition is tested

False

Time

CSE

Follow

JUMP

Behind

.

-fcse-skip-blocks

It is similar to

`-fcse-follow-jumps'

Option

,

but

CSE

Back behind the condition

,

Condition jump skipping statement block

(Block).

in case

CSE

A simple

IF

Statement

,

Without

Else

Clause

, `-fcse-skip-blocks'

Option will result

CSE

follow

IF

Generated jump behind

.

-freun-cse-after-loop

After performing loop optimization

,

Return public sub-expression

.

-felide-constructionors

If you look reasonably, you will omit the omnifier.

(

only

C ).

According to this option

,

For the following code

, GNU C

Directly call

foo

initialization

Y,

No need to pass temporary variables

:

A foo (); a y = foo ();

If there is no such option, GNU C first initializes Y, then assigns Y; then the result of the FOO is assigned to the temporary variable; finally, replace the initial value of `Y 'with a temporary variable.

The ANSI C standard specifies the default behavior (`-fno-elide-constructors '). If the program is constructed,` -felide-constructors' option can make the program different performance, because some constructs may be ignored transfer.

-FEXPENSIVE-OPTIMIZATIONS

Execute some relative overhead a secondary optimization

.

-FDELAYED-BRANCH

If you support the target machine

,

It tries to rearrange the instruction

,

To use delay branch

(Delayed Branch)

Instruction void behind the instruction

.

-fschedule-insns

If you support the target machine

,

It tries to rearrange the instruction

,

In order to eliminate the execution pause caused by data

.

This can help floating point operations or memory access slower machines

,

Allow other instructions to be executed

,

Until the instruction or floating point operation is completed

.

-fschedule-insns2

Similar

`-fschedule-insns'

Option

,

But after the register is allocated

,

Need an additional instruction scheduling process

.

Relatively fewer registers

,

Moreover, the memory command is greater than one cycle machine.

,

This option is especially useful

.

Target Options (Target Option)

Default

, GNU CC

Compile the target code of this type

.

However, you can also install him into a cross compiler.

,

Compiler for other models

.

In fact

,

Different target machines

,

Can be installed at the same time

GNU CC

Corresponding configuration

.

Then

`-b '

Option Specify the target machine

.

By the way, the new version and the old version of the GNU CC can coexist. One version (which may be the latest) is the default version, but sometimes you want to use other versions.

-B Machine

parameter

Machine

Point out the compiled target model

.

This option is used to install the cross-compiler

GNU CC.

The value of the parameter Machine is the same as the machine type set when the GNU CC cross-compiler is configured. For example, if the cross-compiler is configured with `Configure i386v ', meaning compiling the System V target code on 80386, then you can pass` -b i386v 'Run the cross compiler.

If you do not specify a `-b 'option, you usually refer to compiling the native target code.

-V Version

parameter

Version

Point out which version is running

GNU CC.

This option is used to install multiple versions

GCC.

E.g

,

in case

Version

Yes

`2.0 ',

Mean operation

GNU CC 2.0

Version

.

If there is no designated `-v 'option, the default version depends on the installation of GNU CC, which is generally recommended to use universal versions.

Machine Related Option (Machine Dependent Option)

Every target model has its own special options

,

These options are used

`-m '

Switch guidance

,

Select different hardware models or configuration

---

E.g

, 68010

still is

68020,

Is there a floating point association processor

.

By specifying options

,

One version of the installation compiler can compile all models or configurations

.

In addition, some configuration of the compiler supports additional special options, usually in order to compatibility with this platform on the command line.

Below is a `-m 'option for 68000 series:

-m68000

-mc68000

Output

68000

Target code

.

If the compiler is based on

68000

System configuration

,

This option is the default option

.

-M68020

-mc68020

Output

68020

Target code

(

Instead of

68000).

If the compiler is based on

68020

System configuration

,

This option is the default option

.

-M68881

Output included

68881

Target code for floating point instructions

.

For most

68020

System This is the default option

,

Specified unless the compiler is set

-NFP.

-M68030

Output

68030

Target code

.

If the compiler is based on

68030

System configuration

,

This option is the default option

.

-m68040

Output

68040

Target code

.

If the compiler is based on

68040

System configuration

,

This option is the default option

.

-M68020-40

Output

68040

Target code

,

But do not use new instructions

.

The generated code can be

68020/68881

on

,

Can also

68030

or

68040

Upper effect

.

-MFPA

Output included

Sun FPA

Target code for floating point instructions

.

-MSoft-float

The output contains a target code that is called floating point library.

.

caveat:

The reserved library is not

GNU CC

Part

.

Generally say

GCC

Use this model

C

Compiler

,

But when you cross-compile, you can't use it directly.

.

You must manage your own function library for cross-compilation

.

-mshort

think

int

Type is

16

Bit wide

,

Equivalent

Short Int.

-Mnobitfield

Do not use the domain

(Bit-Field)

instruction

. `-m68000 '

Implicit specified

`-mnobitfield '.

-Mbitfield

Use bitmap

. `-m68020 '

Implicit specified

`-mbitfield '.

If you use unmarkable

GCC,

This is the default option

.

-mrtd

Adopt another function call

,

Function accepts fixed number of parameters

,

use

RTD

Command returns

,

This command returns the parameters in the stack when the instruction is returned.

.

This method enables the caller to save one instruction

,

Because he does not need to pop up parameters

.

This call agreed is not compatible with UNIX normal calls. So if you need to call the library function compiled by the UNIX compiler, you cannot use this option.

In addition, all parameters variable functions must provide a function prototype (including Printf); otherwise the compiler generates an error call code.

Also, if you carrier too much parameters while calling a function, the compiler will generate a serious error code. (Under normal circumstances, excess parameters are ignored safely.)

68010 and 68020 processors support RTD instructions, but 68000 does not support.

Here is the `-m 'option for VAX definitions:

-munix

No output some jump instructions

(AOBLEQ

and many more

), VAX

of

Unix

Assembler cannot span long range

(Long Ranges)

Process

.

-MGNU

If used

Gnu

Assembler

,

Output those jump instructions

,

-mg

Output

G-Format

Floating point number

,

replace

D-Format.

Here is the `-m 'option switch supported by SPARC:

-MFPU

-mhard-float

Output a target code containing floating point instructions

.

This is the default option

.

-Mno-fpu

-MSoft-float

The output contains a target code that is called floating point library.

.

caveat:

Not

Sparc

provide

Gnu

Floating point library

.

Generally speaking, using this model

C

Compiler

,

But you can't use it directly for cross-compilation

.

You must arrange yourself

,

Provide libraries for cross-compilation

.

-msoft-float changes the call agreement in the output file; therefore only use this option to compile the entire program.

-Mno-Epilogue

-mepilogue

use

-mepilogue

default

)

Option time

,

The compiler always places the exit code of the function in the tail of the function.

.

Any exit statement in the middle of a function

(

E.g

C

middle

Return

Statement

)

The jump instruction will result in the end of the function

.

When using the -Mno-epilogue option, the compiler is as used to extract the exit code at each function exit point.

-MNO-V8

-MV8

-MspARCLITE

These three options choose different kinds of

Sparc

system

.

By default (unless specifically for Fujitsu SparClite configuration), the GCC generates the SPARC V7 target code.

-MV8 generates a SPARC V8 target code. The only difference between his and V7 target code is that the compiler generates an integer multiplication and integer division instructions, and SPARC V8 supports the instruction, and the V7 system is not supported.

-msparclite generates a SparClite target code. Added an integer multiplication supported by SparClite, an Integer Divide STEP AND SCAN (FFS) instruction. The V7 system does not support these instructions.

-MCyPress

-MSUPERSPARC

These two options selection processor model

,

Code optimization for the processor

.

-mcypress option (default) Enables the compiler to optimize the CYPRESS CY7C602 chip, the SparcStation / SparcServer 3xx series uses this chip. This option also applies to old SparcStation 1, 2, IPX and other models ..- MSUPARC option makes compilation The SUPERSPARC processor optimizes code, SparcStation 10, 1000, and 2000 Series use this chip. At the same time, the option enables a complete SPARC V8 instruction set.

Here is the `-m 'option for Convex definitions:

-mc1

Output

C1

Target code

.

Compiler

C1

Moderate

,

This is the default option

.

-mc2

Output

C2

Target code

.

Compiler

C2

Moderate

,

This is the default option

.

-Margcount

Place a parameter count in front of each parameter list

Argument Count Word.

Some irreplaceable

Convex

with

VAX

Program requires this parameter number

(

The debugger doesn't need him

,

Unless the function comes with a list of viable parameters

;

This information is stored in the symbol table

.)

-Mnoargcount

Ignore parameter counting

.

If you use unmarkable

GCC,

This is the default option

.

Below is the `-m 'option defined for the AMD AM29000:

-mdw

The generated target code is considered

DW

Position

,

that is

,

Bytes and half-word operations are supported by hardware

.

This option is the default option

.

-MNODW

The generated target code is considered

DW

Unsettled

.

-MBW

The generated target is considered to support bytes and half-word write operations.

.

This option is the default option

.

-MNBW

The generated target code considers that the system does not support bytes and half-word write operations

.

This option is hidden.

`-mnodw '

Option

.

-msmall

Use small memory mode

,

Small memory mode assumes that all functions of all functions are located in one

256 kB

Segment

,

Or all the absolute addresses are less than

256K.

This can be used

Call

Instruction

Const, Consth, Calli

Instruction sequence

.

-mlarge

Assume that you can't use

Call

instruction

;

This is the default option

.

-M29050

Output

AM29050

Target code

.

-M29000

Output

AM29000

Target code

.

This is the default option

.

-Mkernel-registers

Generated target code reference

GR64-GR95

Register instead of

GR96-GR127

register

.

This option can be used to compile kernel code

,

The kernel needs a set of global registers

,

These global registers and registers used by user mode are completely unrelated

.

Note that when using this option, the register name in the `-f 'option must be Normal, User-Mode, Names.

-muser-registers

Use ordinary global register set

GR96-GR127.

This is the default option

.

-MSTACK-CHECK

Insert one after each stack adjustment

__MSP_CHECK

transfer

.

This option is often used for kernel code

.

Here is the `-m 'option defined for the Motorola 88K system:

-m88000

The generated target code can be

M88100

with

M88110

Normal work

.

-M88100

The generated target code is

M88100

The best work

,

But

M88110

Run on

.

-m88110

The generated target code is

M88110

The best work

,

May not be in

M88100

Run on

.

-midentify-revision

In the output of the assembler contains one

Ident

instruction

,

Record source file name

,

Compiler name and version

,

Time standard

,

And useful compilation options

,

-Mno-underscores

Output of the assembler

,

No next line does not add a next line in front of the symbol name

.

The default is to increase the underscore prefix in front of each name

.

-Mno-check-zero-division-mcheck-zero-division

Early model

88K

System in addition to zero operation

,

Many machines cannot be saved in a specific situation

.

Use these options to avoid inclusion

(

Or you can clearly include

)

Additional code

,

These codes can check

,

Send exception signal

GCC

all

88K

Configuration default

`-mcheck-zero-division '

Option

.

-MOCS-Debug-Info

-Mno-OCS-Debug-Info

contain

(

Ignore

)

Additional debugging information

(

About the use of registers in each stack structure

88Open Object Compatibility Standard, `` OCS '',

Due to this information

GDB

No need for these extra information

DG / UX, SVR4,

with

Delta 88 SVR3.2

The default configuration is to include debugging information

,

other

88K

The default configuration of the model is to ignore this information

.

-MOCS-FRAME-POSITION

-Mno-OCS-Frame-Position

Mandatory

(

Not required

)

Store register values ​​to the specified location in the stack frame structure

(

press

OCS

instruction of

DG / UX, Delta88 SVR3.2

with

BCS

Default configuration

`-mocs-frame-position '

Option

;

other

88K

The default configuration of the model is

`-mno-ivs-frame-position '.

-Moptimize-arg-area

-Mno-Optimize-Arg-area

Control how to store function parameters in a stack structure

. `-moptimize-arg-area '

save space

,

But it is likely to drop some debugger

(

Not

GDB). `-Mno-Optimize-arg-area '

Calve better than standard options

.

by default

GCC

Non-optimization parameter domain

.

-mshort-data-

Num

Pass and

r0

Association

,

Send smaller data reference

(Data Reference),

This allows you to transfer a value with a single instruction.

(

Not a normal dual directive

).

Users in the options

Num

Which data reference control changes?

.

E.g

,

If you specify

`-mshort-data-512 ',

Then the affected data is less than

512

Byte data movement

. -MSHORT-DATA-NUM

Option pair is greater than

64K

of

Num

invalid

.

-Mserialize-Volatile

-Mno-Serialize-Volatile

produce

,

Or do not generate code to ensure consistent consistency of volatility

.

For commonly used processor sub-models, the GNU CC always guarantees such consistency by default. How to implement the results consistently depend on the processor sub-model.

The M88100 processor does not rearrange the memory reference, so the access results are always consistent. If you are using the `-m88100 'option, the GNU CC does not produce special instructions consistent with the results.

The memory reference order of the M88110 processor does not always comply with the order of the instruction request. In particular, a read instruction may be executed before the previous storage instruction. Under the multiprocessor environment, the charter access to disturb the variable memory access Consistency. Therefore, when using `-m88000 'or` -m88110' option, the GNU CC produces special instructions when appropriate, forcing the execution order correct.

These additional code used to ensure consistency may affect the performance of the program. If you confirm that you can give up this guarantee, you can use the `-Mno-serialize-volatile 'option.

If you use a `-m88100 'option, you need to match the results of the M88110 processor, you should add the` -mserialize-volatile' option.

转载请注明原文地址:https://www.9cbs.com/read-45570.html

New Post(0)