Intel C++ 编译器11.1 中文文档(不完全翻译)

早期在尝试icc 编译器测试时顺便将英文文档做了部分中文翻译,术语太强,部分翻译也不能保障准确性,将就看看吧。

Intel(R) C++ 编译器11.1 中文帮助文档
=================================

用法: icc [选项] 文件1 [文件2…]
icpc [选项] 文件1 [文件2…]

这些参数可以为空或其它编译选项

文件(N) 可以是 C/C++ 源代码文件(例如 .C .c .cc .cpp .cxx .c++ .i .ii),
集合 (.s .S), 对象 (.o), 静态库 (.a), 或者其它连接文件

The icpc command uses the same compiler options as the icc
icpc 命令的使用与icc 编译选项相同

command.  Invoking the compiler using icpc compiles .c and .i files
可以调用icpc 编译器来编译 .c 和 .i 文件为c++。

as C++.  Invoking the compiler using icc compiles .c and .i files as
调用icc 编译器来编译.c 和 .i 文件为 C

C.  Using icpc always links in C++ libraries.  Using icc only
使用icpc 编译器必须连接C++ 库,使用icc 编译器只需要在命令行下
links in C++ libraries if C++ source is provided on the command line.
连接 C++ 库和提供C++源代码
Commonly used options may be placed in the icc .cfg file.
常用的选项可能会存放在 icc.cfg 文件里

Some options listed are only available on a specific system
一些列出的选项只适用于特定的系统
i32    indicates the feature is available on systems based on IA-32
architecture
说明该功能只能用在32位(IA-32)构架的系统上面

i64em  indicates the feature is available on systems using Intel(R) 64
architecture
说明该功能只能用在英特尔64位构架的系统上面

编译参数列表
——————–

优化参数
————

-O1       optimize for maximum speed, but disable some optimizations which
increase code size for a small speed benefit
对速度进行最大优化,但会禁用一些代码体积优化来换取速度提高

-O2       optimize for maximum speed (DEFAULT)
对速度进行最大优化(默认)

-O3       optimize for maximum speed and enable more aggressive optimizations
that may not improve performance on some programs
对速度进行最大优化并开启高级优化,对部分程序性能可能无法提高

-O        same as -O2
和 -O2 相同

-Os       enable speed optimizations, but disable some optimizations which
increase code size for small speed benefit
开启速度优化,但会禁用一些代码体积优化来换取速度提高

-O0       disable optimizations
禁用优化

-fast     enable -xHOST -O3 -ipo -no-prec-div -static
options set by -fast cannot be overridden with the exception of
-xHOST, list options separately to change behavior
用-fast 可同时开启 -xHOST -O3 -ipo -no-prec-div -static 选项,但不能
和-xHOST 共用,否则列出的选项将独立使用
-fno-alias
assume no aliasing in program
不采用代码混淆(用于保护代码,防反编译)
-fno-fnalias
assume no aliasing within functions, but assume aliasing across calls
不采用内部函数混淆,只混淆外部调用 ???
-f[no-]builtin
disable inline expansion of intrinsic functions
禁用固有函数在内部扩展
-fno-builtin-<func>
disable the <func> intrinsic
禁用内建函数 <函数名>
-ffunction-sections
separate functions for the linker (COMDAT)
分离连接器函数
-fdata-sections
same as -ffunction-sections
和 -ffunction-sections 相同
-nolib-inline
disable inline expansion of intrinsic functions
禁用 固有函数的内联展开

Code Generation
代码生成
—————

-x<code1>[,<code2>,…]
generate specialized code to run exclusively on processors
indicated by <code> as described below
生成指定的代码运行在专门的处理器上
<code>内表示的参数如下所示

Host generate instructions for the highest instruction set and
processor available on the compilation host machine
主机生成指令用于对应的处理器主机上最高指令集设置

SSE2 Intel Pentium 4 and compatible Intel processors.  Enables new
optimizations in addition to Intel processor-specific
optimizations
英特尔奔腾4 和兼容的英特尔处理器,开启新的优化用于英特尔指定处理器优化

SSE3    Intel(R) Core(TM) processor family with Streaming SIMD
Extensions 3 (Intel(R) SSE3) instruction support
单指令多数据流(Intel(R)SSE3)指令集支持的英特尔(R) 酷睿(TM) 处理器家族

SSE3_ATOM Can generate MOVBE instructions for Intel processors and
can optimize for the Intel(R) Atom(TM) processor.
可以生成MOVBE 指令用于英特尔处理器和对英特尔(R)凌动(TM)处理器

SSSE3   Intel(R) Core(TM)2 processor family with Supplemental
Streaming SIMD Extensions 3 (SSSE3)
支持单指令多数据流指令集扩展的英特尔酷睿2处理器家族

SSE4.1  Intel(R) 45nm Hi-k next generation Intel Core(TM)
microarchitecture with support for SSE4 Vectorizing
Compiler and Media Accelerator instructions
用于支持SSE4 矢量化编译和媒体加速指令的 英特尔 45纳米Hi-k 工艺的下一
代英特尔酷睿微架构

SSE4.2  Can generate Intel(R) SSE4 Efficient Accelerated String
and Text Processing instructions supported by Intel(R)
Core(TM) i7 processors. Can generate Intel(R) SSE4
Vectorizing Compiler and Media Accelerator, Intel(R) SSSE3,
SSE3, SSE2, and SSE instructions and it can optimize for
the Intel(R) Core(TM) processor family.
可以生成英特尔 SSE4 高效字串和文本处理加速指令支持的Intel 酷睿 i7 处
理器可以生成英特尔 SSE4 矢量化编译和媒体加速,英特尔SSE3,SSE2 和SSE
指令集和它能够优化的 英特尔酷睿处理器家族

AVX     Enable Intel(R) Advanced Vector Extensions instructions
启用英特尔高级向量扩展指令

-ax<code1>[,<code2>,…]
generate code specialized for processors specified by <codes>
while also generating generic IA-32 instructions.
生成代码指定与用于指定的处理器到 <codes> ,也同时生成通用的IA-32 指令

<codes> includes one or more of the following:
<codes > 里面包含一个或多个如下所示

SSE2 Intel Pentium 4 and compatible Intel processors.  Enables new
optimizations in addition to Intel processor-specific
optimizations
英特尔奔腾4 和兼容的英特尔处理器,开启新的优化用于英特尔指定处理器优化

SSE3    Intel(R) Core(TM) processor family with Streaming SIMD
Extensions 3 (Intel(R) SSE3) instruction support
单指令多数据流(Intel(R)SSE3)指令集支持的英特尔(R) 酷睿(TM) 处理器家族

SSSE3   Intel(R) Core(TM)2 processor family with Supplemental
Streaming SIMD Extensions 3 (SSSE3)
支持单指令多数据流指令集扩展的英特尔酷睿2处理器家族

SSE4.1  Intel(R) 45nm Hi-k next generation Intel Core(TM)
microarchitecture with support for Streaming SIMD
Extensions 4 (Intel(R) SSE4) Vectorizing
Compiler and Media Accelerator instructions
用于支持SSE4 矢量化编译和媒体加速指令的 英特尔 45纳米Hi-k 工艺的下一
代英特尔酷睿微架构

SSE4.2  Can generate Intel(R) SSE4 Efficient Accelerated String
and Text Processing instructions supported by Intel(R)
Core(TM) i7 processors. Can generate Intel(R) SSE4
Vectorizing Compiler and Media Accelerator, Intel(R) SSSE3,
SSE3, SSE2, and SSE instructions and it can optimize for
the Intel(R) Core(TM) processor family.
可以生成英特尔 SSE4 高效字串和文本处理加速指令支持的Intel 酷睿 i7 处
理器,可以生成英特尔 SSE4 矢量化编译和媒体加速,英特尔 SSE3, SSE2 和
SSE指令集和它能够优化的英特尔酷睿处理器家族

AVX     Enable Intel(R) Advanced Vector Extensions instructions
启用英特尔高级向量扩展指令
-mcpu=<cpu>
same as -mtune=<cpu>
和 -mtune=<cpu> 相同

-mtune=<cpu>
optimize for a specific <cpu>
特定优化<cpu>
pentium3  – optimize for Pentium(R) III processors
用于 奔腾3 处理器优化
pentium4  – optimize for Pentium(R) 4 processor (DEFAULT)
用于 奔腾4 处理器优化(默认)

-march=<cpu>
generate code exclusively for a given <cpu>
单独为CPU生成代码<cpu>
pentium3  – streaming SIMD extensions
单指令多数据流扩展
pentium4  – Pentium(R) 4 New Instructions
奔腾 4 新指令

-mia32    generates code which will run on any Intel Pentium or later
processor.  Disables any default extended instruction settings, and
any previously set extended instruction settings.
生成代码将运行于任何英特尔奔腾或更高的处理器,禁用任何默认扩展的指令设置和先前
设置的扩展的指令设置

-msse     generate code for Intel Pentium III and compatible Intel processors
生成代码用于英特尔奔腾III和英特尔兼容处理器

-msse2    generate code for Intel Pentium 4 and compatible Intel processors
生成代码用于英特尔奔腾4和英特尔兼容处理器

-msse3    generate code for Intel(R) Core(TM) Duo processors, Intel(R) Core(TM)
Solo processors, Intel Pentium 4 and compatible Intel processors with
Streaming SIMD Extensions 3 (Intel(R) SSE3) instruction support
生成代码用于单指令多数据流指令(SSE3)支持的英特尔酷睿2处理器,英特尔酷睿低电压
版处理器英特尔奔腾四和兼容的英特尔处理器

-mssse3   Intel(R) Core(TM)2 processor family with Supplemental Streaming
SIMD Extensions 3 (SSSE3)
英特尔酷睿2处理器家族并支持单指令多数据流扩展(SSE3)

-msse4.1  Intel(R) 45nm Hi-k next generation Intel Core(TM) microarchitecture
with support for Streaming SIMD Extensions 4 (Intel(R) SSE4)
Vectorizing Compiler and Media Accelerator instructions
英特尔 45纳米Hi-k 工艺的下一代英特尔酷睿微架构用于支持SSE4 矢量化编译和媒体加速指令的
-minstruction=<keyword>
Refine instruction set output for the selected target processor
指定已选择的目标处理器精简指令集输出设置
[no]movbe  – Do/do not generate MOVBE instructions with SSE3_ATOM
(requires -xSSE3_ATOM)
不生成 MOVBE指令用于 SSE3_ATOM  (要求 -xSSE3_ATOM)

-f[no-]omit-frame-pointer
enable(DEFAULT)/disable use of EBP as general purpose register.
-fno-omit-frame-pointer replaces -fp
开启(默认)/关闭 EBP作为通用寄存器

-f[no-]exceptions
enable/disable(DEFAULT) C++ exception handling table generation
开启/关闭(默认) 生成C++ 异常处理表

-fnon-call-exceptions
enable/disable(DEFAULT) code that allows exceptions from trapping
instructions to be caught
开启/关闭(默认)允许捕获例外的代码异常

Interprocedural Optimization (IPO)
间接优化
———————————-

-[no-]ip  enable(DEFAULT)/disable single-file IP optimization
within files
开启(默认)/禁用单文件间接优化内部文件

-ipo[n]   enable multi-file IP optimization between files
在文件中开启多文件间接优化

-ipo-c    generate a multi-file object file (ipo_out.o)
生成一个多文件的目标文件 (ipo_out.o)

-ipo-S    generate a multi-file assembly file (ipo_out.S)
生成多文件集文件(ipo_out.S)

-ip-no-inlining
disable full and partial inlining
禁用全部和部分内联

-ip-no-pinlining
disable partial inlining
禁用部分内联

-ipo-separate
create one object file for every source file (overrides -ipo[n])
为每个源文件创建一个对象(overrides -ipo[n])

-ipo-jobs<n>
specify the number of jobs to be executed simultaneously during the
IPO link phase
指定队列编号,以同时执行IPO连接?

Advanced Optimizations
高级优化
———————-

-unroll[n]
set maximum number of times to unroll loops.  Omit n to use default
heuristics.  Use n=0 to disable the loop unroller
设置循环展开的最大次数,去掉 n 则使用默认启发,使用 n=0 则去掉unroller 循环

-[no-]unroll-aggressive
enables more aggressive unrolling heuristics
开启更多的强制展开启发 ??

-funroll-loops
unroll loops based on default heuristics
展开循环在默认启发

-[no-]scalar-rep
enable(DEFAULT)/disable scalar replacement (requires -O3)
启用 禁用 标量替换(需要 -o3 )
-[no-]ansi-alias
enable/disable(DEFAULT) use of ANSI aliasing rules optimizations;
user asserts that the program adheres to these rules

-[no-]complex-limited-range
enable/disable(DEFAULT) the use of the basic algebraic expansions of
some complex arithmetic operations.  This can allow for some
performance improvement in programs which use a lot of complex
arithmetic at the loss of some exponent range.
-[no-]alias-const
enable/disable(DEFAULT) a heuristic stating that if two arguments to
a function have pointer type, a pointer to const does not alias a
pointer to non-const. Also known as the input/output buffer rule, it
assumes that input and output buffer arguments do not overlap.
-fargument-alias
arguments may alias each other and may alias global storage
-fargument-noalias
arguments do not alias each other but may alias global storage
-fargument-noalias-global
arguments do not alias each other and do not alias global storage
-ftls-model=<model>
change thread-local storage model, where <model> can be the
following: global-dynamic, local-dynamic, initial-exec or local-exec
-[no-]opt-multi-version-aggressive
enables more aggressive multi-versioning to check for pointer
aliasing and scalar replacement
-opt-ra-region-strategy[=<keyword>]
select the method that the register allocator uses to partition each
routine into regions
routine – one region per routine
block   – one region per block
trace   – one region per trace
loop    – one region per loop
default – compiler selects best option
-[no-]vec
enables(DEFAULT)/disables vectorization
开启 关闭 向量化
-[no-]vec-guard-write
enables cache/bandwidth optimization for stores under conditionals
within vector loops
开启缓存/带宽优化用于???
-vec-threshold[n]
sets a threshold for the vectorization of loops based on the
probability of profitable execution of the vectorized loop in
parallel
-opt-malloc-options={0|1|2|3|4}
specify malloc configuration parameters.  Specifying a non-zero <n>
value will cause alternate configuration parameters to be set for
how malloc allocates and frees memory
-opt-calloc
enable/disable(DEFAULT) calls to fast calloc function
-opt-jump-tables=<arg>
control the generation of jump tables
default – let the compiler decide when a jump table, a series of
if-then-else constructs or a combination is generated
large   – generate jump tables up to a certain pre-defined size
(64K entries)
<n>     – generate jump tables up to <n> in size
use -no-opt-jump-tables to lower switch statements as chains of
if-then-else constructs
-fno-jump-tables
do not generate jump tables for switches and if-then-else statements
-opt-block-factor=<n>
specify blocking factor for loop blocking
-ffreestanding
compile in a freestanding environment where the standard library
may not be present
-opt-streaming-stores <arg>
specifies whether streaming stores are generated
always – enables generation of streaming stores under the
assumption that the application is memory bound
auto   – compiler decides when streaming stores are used (DEFAULT)
never  – disables generation of streaming stores
-ipp[=<arg>]
link some or all of the Intel(R) Integrated Performance Primitives
(Intel(R) IPP) libraries and bring in the associated headers
common        – link using the main libraries set.  This is the
default value when -ipp is specified
crypto        – link using the main libraries set and the crypto
library
nonpic        – link using the version of the libraries that do not
have position independent code
nonpic_crypto – link using the crypto library and the version of
the libraries that do not have position independent
code
-mkl[=<arg>]
link to the Intel(R) Math Kernel Library (Intel(R) MKL) and bring
in the associated headers
parallel   – link using the threaded Intel(R) MKL libraries. This
is the default when -mkl is specified
sequential – link using the non-threaded Intel(R) MKL libraries
cluster    – link using the Intel(R) MKL Cluster libraries plus
the sequential Intel(R) MKL libraries
-tbb      link to the Intel(R) Threading Building Blocks (Intel(R) TBB)
libraries and bring in the associated headers
-[no-]opt-subscript-in-range
assumes no overflows in the intermediate computation of the
subscripts
-[no-]use-intel-optimized-headers
take advantage of the optimized header files

Profile Guided Optimization (PGO)
配置向导优化
———————————

-prof-dir <dir>
specify directory for profiling output files (*.dyn and *.dpi)
指定目录用于输出文件(*.dyn and *.dpi)

-prof-src-root <dir>
specify project root directory for application source files to
enable relative path resolution during profile feedback on sources
below that directory
指定应用程序的源代码的根目录文件,可以在配置文件的相对路径来源反馈决议
??????????低于该目录

-prof-src-root-cwd
specify the current directory as the project root directory for
application source files to enable relative path resolution during
profile feedback on sources below that directory
指定为项目的根目录为当前目录应用程序源代码,以便在解决相对路径
??????????文件反馈低于该目录的来源

-[no-]prof-src-dir
specify whether directory names of sources should be
considered when looking up profile records within the .dpi file
具体说明来源的目录名应该是查找时考虑范围内。dpi的文件记录的文件

-prof-file <file>
specify file name for profiling summary file
指定文件的文件名分析总结

-[no-]prof-data-order
enable/disable(DEFAULT) static data ordering with profiling
启用/禁用(默认)静态数据排序分析

-[no-]prof-func-order
enable/disable(DEFAULT) function ordering with profiling
启用/禁用(默认)函数分析排序

-[no-]prof-func-groups
enable(DEFAULT with PGO)/disable function grouping
启用(默认与通例)/禁用功能分组

-prof-gen[=keyword]
instrument program for profiling.
Optional keyword may be srcpos or globdata
机器语言分析,可选关键字 srcpos 或者 globdata

-no-prof-gen
disable profiling instrumentation
禁用分析仪器

-prof-use[=<arg>]
enable use of profiling information during optimization
启用分析在优化过程中信息的使用
weighted  – invokes profmerge with -weighted option to scale data
based on run durations
[no]merge – enable(default)/disable the invocation of the profmerge
tool
-no-prof-use
disable use of profiling information during optimization
-opt-prefetch[=n]
enable levels of prefetch insertion, where 0 disables.
n may be 0 through 4 inclusive.  Default is 2.
-no-opt-prefetch
disable(DEFAULT) prefetch insertion.  Equivalent to -opt-prefetch=0
-p        compile and link for function profiling with UNIX gprof tool
On IA32 and Intel(r)64, -pg is also valid
-f[no-]instrument-functions
determine whether function entry and exit points are instrumented
-prof-hotness-threshold=<val>
set the hotness threshold for function grouping and function ordering
val indicates percentage of functions to be placed in hot region.
This option requires -prof-use
and -prof-func-groups or -prof-func-order
Optimization Reports
优化报告
——————–

-vec-report[n]
control amount of vectorizer diagnostic information
n=0    no diagnostic information
不显示诊断信息
n=1    indicate vectorized loops (DEFAULT)
显示矢量循环
n=2    indicate vectorized/non-vectorized loops
显示矢量/非矢量循环循环
n=3    indicate vectorized/non-vectorized loops and prohibiting
data dependence information
显示矢量/非循环和禁止矢量数据相关的信息
n=4    indicate non-vectorized loops
表明非矢量环
n=5    indicate non-vectorized loops and prohibiting data
dependence information
显示非循环和禁止矢量数据依存信息
-opt-report [n]
generate an optimization report to stderr
生成优化报告到stderr
0   disable optimization report output
禁用优化报告输出
1   minimum report output
最低的报告输出
2   medium output (DEFAULT when enabled)
中等输出(默认启用时)
3   maximum report output
最大输出报告
-opt-report-file=<file>
specify the filename for the generated report
指定的文件名生成的报告
-opt-report-phase=<phase>
specify the phase that reports are generated against
指定生成的报告对相
-opt-report-routine=<name>
reports on routines containing the given name
报告包含给定名称例程
-opt-report-help
display the optimization phases available for reporting
显示可用的优化报告信息
-tcheck [mode]
enable analysis of threaded applications (requires Intel(R) Thread
Checker; cannot be used with compiler alone)
tci – instruments a program to perform a thread-count-independent
analysis
tcd – instruments a program to perform a thread-count-dependent
analysis (DEFAULT when mode is not used)
api – instruments a program at the api-imports level
-tprofile
generate instrumentation to analyze multi-threading performance
(requires Intel(R) Thread Profiler; cannot be used with compiler
alone)
-tcollect[=<lib>]
inserts instrumentation probes calling the Intel(R) Trace Collector
API.  The library -l<lib> is linked in the default being -lVT
(requires Intel(R) Trace Collector)
-tcollect-filter file
Enable or disable the instrumentation of specified functions.
(requires Intel(R) Trace Collector)

OpenMP* and Parallel Processing
OpenMP* 和并行处理
——————————-

-openmp   enable the compiler to generate multi-threaded code based on the
OpenMP* directives
-openmp-profile
enable analysis of OpenMP application when the Intel(R) Thread
Profiler is installed
-openmp-stubs
enables the user to compile OpenMP programs in sequential mode.  The
OpenMP directives are ignored and a stub OpenMP library is linked
(sequential)
-openmp-report{0|1|2}
control the OpenMP parallelizer diagnostic level
-openmp-lib <ver>
choose which OpenMP library version to link with
compat – use the GNU compatible OpenMP run-time libraries
(DEFAULT)
-openmp-link <library>
choose whether to link with the static or dynamic OpenMP
libraries.  Default is dynamic.
-openmp-task <arg>
choose which OpenMP tasking model to support
omp   – support OpenMP 3.0 tasking (DEFAULT)
intel – support Intel taskqueuing
-openmp-threadprivate <ver>
choose which threadprivate implementation to use
compat – use the GNU compatible thread local storage
legacy – use the Intel compatible implementation
(DEFAULT)
-parallel
enable the auto-parallelizer to generate multi-threaded code for
loops that can be safely executed in parallel
-par-report{0|1|2|3}
control the auto-parallelizer diagnostic level
-par-threshold[n]
set threshold for the auto-parallelization of loops where n is an
integer from 0 to 100
-[no-]par-runtime-control
enable compiler to generate runtime control code for effective
automatic parallelization
-par-schedule-static[=n]
Specifies a scheduling algorithm for DO loop iteration.
Divides iterations into contiguous pieces.  Size n if
specified, equal sized pieces if not.
-par-schedule-static-balanced[=n]
Divides iterations into even-sized chunks.  Size n if
specified, equal sized pieces if not.
-par-schedule-static-steal[=n]
Divides iterations into even-sized chunks, but allows
threads to steal parts of chunks from neighboring threads
-par-schedule-dynamic[=n]
Specifies a scheduling algorithm for DO loop iteration.
Assigns iterations to threads in chunks dynamically.
Chunk size is n iterations if specified, otherwise 1.
-par-schedule-guided[=n]
Specifies a scheduling algorithm for DO loop iteration.
Indicates a minimum number of iterations.  If specified,
n is the minimum number, otherwise 1.
-par-schedule-guided-analytical[=n]
Divides iterations by using exponential distribution or
dynamic distributions.
-par-schedule-runtime
Specifies a scheduling algorithm for DO loop iteration.
Defers the scheduling decision until runtime.
-par-schedule-auto
Lets the compiler or run-time system determine the
scheduling algorithm.
-par-affinity=[<modifier>,…]<type>[,<permute>][,<offset>]
tune application performance by setting different thread affinity
-par-num-threads=<n>
tune application performance by setting different number of threads

Floating Point
浮点(运算)
————–

-fp-model <name>
enable <name> floating point model variation
[no-]except – enable/disable floating point semantics
启用/禁用浮点语义
fast[=1|2]  – enables more aggressive floating point optimizations
可以更积极的浮点优化
precise     – allows value-safe optimizations
允许值安全优化
source      – enables intermediates in source precision
使源中间体精度
strict      – enables -fp-model precise -fp-model except, disables
contractions and enables pragma stdc fenv_access
double      – rounds intermediates in 53-bit (double) precision
extended    – rounds intermediates in 64-bit (extended) precision
-fp-speculation=<mode>
enable floating point speculations with the following <mode>
conditions:
fast   – speculate floating point operations (DEFAULT)
safe   – speculate only when safe
strict – same as off
off    – disables speculation of floating-point operations
-pc32     set internal FPU precision to 24 bit significand
设置内部浮点运算单元精确到24位尾数

-pc64     set internal FPU precision to 53 bit significand (DEFAULT)
设置内部浮点运算单元精确到53位尾数

-pc80     set internal FPU precision to 64 bit significand
设置内部浮点运算单元精确到64位尾数
-mp1      improve floating-point precision (speed impact less than -mp)
改进浮点精度

-mieee-fp
same as -mp, can be disabled with -mno-ieee-fp
-[no-]prec-sqrt
determine if certain square root optimizations are enabled
-[no-]prec-div
improve precision of FP divides (some speed impact)
-[no-]fast-transcendentals
generate a faster version of the transcendental functions
-[no-]fp-port
round fp results at assignments and casts (some speed impact)
-fp-stack-check
enable fp stack checking after every function/procedure call
-rcd      rounding mode to enable fast float-to-int conversions
-[no-]ftz
enable/disable flush denormal results to zero

Inlining
内联
——–

-inline-level=<n>
control inline expansion:
n=0  disable inlining
n=1  inline functions declared with __inline, and perform C++
inlining
n=2  inline any function, at the compiler’s discretion
-f[no-]inline
inline functions declared with __inline, and perform C++ inlining
-f[no-]inline-functions
inline any function at the compiler’s discretion
-finline-limit=<n>
set maximum number of statements a function can have and still be
considered for inlining
-inline-min-size=<n>
set size limit for inlining small routines
-no-inline-min-size
no size limit for inlining small routines
-inline-max-size=<n>
set size limit for inlining large routines
-no-inline-max-size
no size limit for inlining large routines
-inline-max-total-size=<n>
maximum increase in size for inline function expansion
-no-inline-max-total-size
no size limit for inline function expansion
-inline-max-per-routine=<n>
maximum number of inline instances in any function
-no-inline-max-per-routine
no maximum number of inline instances in any function
-inline-max-per-compile=<n>
maximum number of inline instances in the current compilation
-no-inline-max-per-compile
no maximum number of inline instances in the current compilation
-inline-factor=<n>
set inlining upper limits by n percentage
-no-inline-factor
do not set set inlining upper limits
-inline-forceinline
treat inline routines as forceinline
-inline-calloc
directs the compiler to inline calloc() calls as malloc()/memset()

Output, Debug, PCH
输出,调试,预编译头文件
——————

-c        compile to object (.o) only, do not link
-S        compile to assembly (.s) only, do not link
-fsource-asm
produce assembly file with optional source annotations (requires -S)
-f[no-]verbose-asm
produce assembly file with compiler comments (DEFAULT) (requires -S)
-fcode-asm
produce assembly file with optional code annotations (requires -S)
-use-msasm
support Microsoft* style assembly language insertion using MASM style
syntax
-o <file>
name output file
-g        produce symbolic debug information in object file (implies -O0 when
another optimization option is not explicitly set)
-debug [keyword]
enable debug information and control output of enhanced debug
information
启用调试信息和控制输出 增强调试输出信息
keywords:  all, full, minimal, none, [no]inline-debug-info
[no]variable-locations, [no]semantic-stepping,
extended
parallel
[no]expr-source-pos
-g0       disable generation of symbolic debug information
-gdwarf-2
enable generation of debug information using the DWARF2 format
-ftrapuv  trap uninitialized variables
-map-opts
enable option mapping tool
-print-multi-lib
print information about libraries being used
-pch-create <file>
create precompiled header file
-pch-use <file>
use precompiled header file
-pch      enable automatic precompiled header file creation/usage
-pch-dir <dir>
name precompiled header directory

Preprocessor
预处理
————

-A<name>[<val>]
create an assertion <name> having value <val>
-C        do not strip comments
-D<name>[=<text>]
define macro
-U<name>  remove predefined macro
-E        preprocess to stdout
-EP       preprocess to stdout, omitting #line directives
-P        preprocess to file, omitting #line directives
-I<dir>   add directory to include file search path
-idirafter<dir>
add directory to the second include file search path (after -I)
-isystem<dir>
add directory to the start of the system include path
-X, -nostdinc
remove standard directories from include file search path
-nostdinc++
remove standard C++ directories from include file search path
-iprefix <prefix>
use <prefix> with -iwithprefix as a prefix
-iwithprefix <dir>
append <dir> to the prefix passed in by -iprefix and put it on the
include search path at the end of the include directories
-iwithprefixbefore <dir>
similar to -iwithprefix except the include directory is placed in the
same place as -I command line include directories
-iquote <dir>
add directory to the front of the include file search path for files
included with quotes, but not brackets
-imacros <file>
treat <file> as an #include file, but throw away all preprocessing
while macros defined remain defined
-H        print include file order
-B<prefix>
find libraries, headers and executables in <prefix>
-M        generate makefile dependency information
-MM       similar to -M, but do not include system header files
-MG       similar to -M, but treat missing header files as generated files
-MD       preprocess and compile, generating output file containing dependency
information ending with extension .d
-MMD      similar to -MD, but do not include system header files
-MF<file>
generate makefile dependency information in file (must specify -M
or -MM)
-MP       add a phony target for each dependency
-MT<target>
change the default target rule for dependency generation
-MQ<target>
same as -MT, but quotes special Make characters
-dM       output macro definitions in effect after preprocessing (use with -E)
-dD       same as -dM, but output #define directives in preprocessed source
-dN       same as -dD, but #define directives contain only macro names
-gcc      Predefine the “__GNUC__”, “__GNUC_MINOR__”, and
“__GNUC_PATCHLEVEL__” macros (DEFAULT)
-no-gcc   Do not predefine GNUC macros listed in -gcc mode. Warning: can
prevent correct system header compilation, see -gcc-sys
-gcc-sys  same as -no-gcc, except that the GNU macros are defined only while
preprocessing the system include headers
-no-icc   do not predefine the “__ICC” and “__INTEL_COMPILER” macros.
Warning: can prevent correct Intel header compilation
-pragma-optimization-level=[Intel|GCC]
process #pragma optimize using Intel (DEFAULT) or GCC syntax

Component Control
控制组件
—————–

-Qoption,<tool>,<opts>
pass options <opts> to tool specified by <tool>
-Qlocation,<tool>,<dir>
set <dir> as the location of tool specified by <tool>
-Qinstall <dir>
set <dir> as root of compiler installation

Language
语言
——–

-std=<std>
enable language support for <std>, as described below
c99   enable C99 support for C programs
c++0x enable preliminary support for some C++0x features
-x <type>
all source files found subsequent to -x <type> will be recognized
as one of the following types:
c                  – C source file
c++                – C++ source file
c-header           – C header file
cpp-output         – C pre-processed file
c++-cpp-output     – C++ pre-processed file
assembler          – assembly file
assembler-with-cpp – assembly file that needs to be preprocessed
none               – revert to original file extension
-ansi     equivalent to GNU -ansi
-strict-ansi
strict ANSI conformance dialect
-Zp[n]    specify alignment constraint for structures where
n=1,2,4,8,16. 16 is the default
-fsyntax-only
perform syntax and semantic checking only (no object file produced)
-fpermissive
allows extensions for some non-conformant code
-funsigned-char
change default char type to unsigned
-fshort-enums
allocate as many bytes as needed for enumerated types
-f[no-]unsigned-bitfields
change default bitfield type to unsigned
-fno-rtti
disable RTTI support
-fno-implicit-templates
never emit code for non-inline templates which are instantiated
implicitly; only emit code for explicit instantiations
-fno-implicit-inline-templates
do not emit code for implicit instantiations of inline templates
-ftemplate-depth-[n]
control the depth in which recursive templates are expanded
-[no]align
analyze and reorder memory layout for variables and arrays
-[no-]restrict
enable/disable the ‘restrict’ keyword for disambiguating pointers
-[no-]early-template-check
enable/disable (DEFAULT) semantic checking of function template
prototypes (before instantiation). Requires -gcc-version=340 or
later
-[no-]check-uninit
check for uninitialized variables
-export   enable the export template feature
-export-dir <dir>
add directory to export template search path
-help-pragma
output supported pragmas and their usage syntax

Compiler Diagnostics
编译诊断
——————–

-w        disable all warnings
-w<n>     control diagnostics
n = 0    display errors (same as -w)
n = 1    display warnings and errors (DEFAULT)
n = 2    display remarks, warnings and errors
-Wbrief   print brief one-line diagnostics
-Werror   force warnings to be reported as errors
-Werror-all
force warnings and remarks to be reported as errors
-Wall     enable all warnings
-Wcheck   enable more strict diagnostics
-Weffc++  enable effective C++ diagnostic warnings
-wo<L1>[,<L2>,…]
issue diagnostics L1 through LN only once
-W[no-]fatal-errors
ends compilation after the first error encountered
-W[no-]format
enable argument checking for calls to printf, scanf, etc
-W[no-]format-security
warn for uses of format strings and specifiers in printf,
scanf, etc that may introduce security problems
-W[no-]missing-declarations
warn for global functions and variables without prior declaration
-W[no-]missing-prototypes
warn for missing prototypes
-W[no-]strict-aliasing
warn for code that might violate the optimizer’s strict aliasing
rules. Warnings are issued only when using -fstrict-aliasing or
-ansi-alias.
-W[no-]strict-prototypes
warn for functions declared or defined without specified argument
types
-W[no-]pointer-arith
warn for questionable pointer arithmetic
-W[no-]uninitialized
warn if a variable is used before being initialized
-Winline  enable inline diagnostics
-W[no-]deprecated
print warnings related to deprecated features
-W[no-]abi
warn if generated code is not C++ ABI compliant
-Wcontext-limit=<n>
set maximum number of template instantiation contexts shown in
diagnostic
-Wcast-qual
warn if cast is used to override pointer type qualifier
-W[no-]unused-function
warn if declared function is not used
-W[no-]unknown-pragmas
warn if an unknown #pragma directive is used (DEFAULT)
-W[no-]main
warn if return type of main is not expected
-W[no-]comment[s]
warn when   comment
-W[no-]conversion
warn for implicit conversions that may alter a value
-W[no-]return-type
warn when a function uses the default int return type and warn when
a return statement is used in a void function
-W[no-]extra-tokens
warn about extra tokens after prepreprocessor directives
-W[no-]pragma-once
warn about the use of #pragma once
-W[no-]shadow
warn when a variable declaration hides a previous declaration
-Woverloaded-virtual
warn when a function declaration hides virtual functions from a base
class
-W[no-]trigraphs
warn about the recognition and conversion of trigraphs
-W[no-]multichar
warn if a multicharacter constant (‘ABC’) is used
-W[no-]overflow
warn for operations that could result in integer overflow
-Wwrite-strings
Issues a diagnostic message if const char * is converted
to (non-const) char *.
-Wp64     print diagnostics for 64-bit porting
-W[no-]shorten-64-to-32
warn for values implicitly converted from a 64-bit to a 32-bit type.
Similar to -Wp64
-[no]traceback
specify whether the compiler generates data to allow for source file
traceback information at runtime (only to be used when linking with
Fortran programs)
-noerror-limit
set no maximum number on error-level or fatal-level error messages
-diag-enable <v1>[,<v2>,…]
enable the specified diagnostics or diagnostic groups
-diag-disable <v1>[,<v2>,…]
disable the specified diagnostics or diagnostic groups
where <vN> may be individual diagnostic numbers or group names.
where group names include:
sc[n]      – perform source code analysis: n=1 for critical
errors, n=2 for all errors and n=3 for all errors
and warnings
sc-include – perform source code analysis on include files
sc-parallel[n] – perform analysis of parallelization in
source code: n=1 for critical errors,
n=2 for errors, n=3 for all errors and
warnings
thread     – enable diagnostics to aid in thread-enabling source
port-win   – enable diagnostics for GNU extensions that may
cause errors when porting to Windows
-diag-error <v1>[,<v2>,…]
output the specified diagnostics or diagnostic groups as errors
-diag-warning <v1>[,<v2>,…]
output the specified diagnostics or diagnostic groups as warnings
-diag-remark <v1>[,<v2>,…]
output the the specified diagnostics or diagnostic groups as remarks
-diag-dump
display the currently enabled diagnostic messages to stdout or to a
specified diagnostic output file.
-diag-file[=<file>]
<file> where diagnostics are emitted to.  Not specifying this causes
messages to be output to stderr
-diag-file-append[=<file>]
<file> where diagnostics are emitted to. When <file> already exists,
output is appended to the file
-[no-]diag-id-numbers
enable(DEFAULT)/disable the diagnostic specifiers to be output in
numeric form
-diag-error-limit <num>
specify the maximum number of errors emitted
-diag-once <v1>[,<v2>,…]
issue diagnostics v1 through vN only once

Miscellaneous
混杂
————-

-V        display compiler version information
显示编译器版本信息
-dumpversion
display the compiler version number only
显示编译器版本号
-dumpmachine
display the target machine only
显示目标机器
–version
display GCC style version information
显示版本信息(GCC 样式)
-[no-]sox
enable/disable(DEFAULT) saving of compiler options and version in
the executable
启用/禁用 编译器参数和版本保存功能
-save-temps
store the intermediate files in current directory and name them
based on the source file.  Only saves files that are generated by
default
-dryrun   show driver tool commands but do not execute tools
-v        show driver tool commands and execute tools
-[no-]multibyte-chars
provide support for multi-byte characters
-multiple-processes[=<n>]
create multiple processes that can be used to compile large numbers
of source files at the same time

Data
数据
—-

-Zp[n]    specify alignment constraint for structures (n=1,2,4,8,16
-Zp16 DEFAULT)
-[no]align
analyze and reorder memory layout for variables and arrays
-fminshared
Compilation is for the main executable. Absolute addressing can be
used and non-position independent code generated for symbols that
are at least protected
-fcommon  Enables the compiler to treat common variables as if they were
defined.  That in turn allows the use of gprel addressing of common
data variables.  -fno-common disables
-freg-struct-return
return struct and union values in registers when possible
-fstack-security-check
enable overflow security checks.
-f[no-]stack-security-check disables (DEFAULT)
-fstack-protector
enable stack overflow security checks.
-f[no-]stack-protector disables (DEFAULT)
-fpic, -fPIC
generate position independent code (-fno-pic/-fno-PIC is DEFAULT)
-fpie, -fPIE
generate position independent code that will be linked into an
executable (-fno-pie/-fno-PIE is DEFAULT)
-[no-]global-hoist
enable(DEFAULT)/disable external globals are load safe
-f[no-]keep-static-consts
enable/disable(DEFAULT) emission of static const variables even
when not referenced
-fpack-struct
pack structure members together
-f[no-]math-errno
set ERRNO after calling standard math library functions
-no-bss-init
disable placement of zero-initialized variables in BSS (use DATA)
-falign-functions=[2|16]
align the start of functions on a 2 (DEFAULT) or 16 byte boundary
-falign-functions
align the start of functions to an optimal machine-dependent value.
-fno-align-functions (DEFAULT) aligns on a 2-byte boundary
-falign-stack=<mode>
stack alignment method to use on entry to routines
default          – use default heuristics
maintain-16-byte – do not assume any specific alignment, but
maintain alignment in case the stack is already
aligned
assume-16-byte   – assume the stack is aligned on 16-byte
boundaries
-fvisibility=[extern|default|protected|hidden|internal]
Global symbols (data and functions) will get the visibility
attribute given by default. Symbol visibility attributes explicitly
set in the source code or using the symbol visibility attribute
file options will override the -fvisibility setting
-fvisibility-extern=<file>
Space separated symbols listed in the <file> argument will geti
visibility set to extern
-fvisibility-default=<file>
Space separated symbols listed in the <file> argument will get
visibility set to default
-fvisibility-protected=<file>
Space separated symbols listed in the <file> argument will get
visibility set to protected
-fvisibility-hidden=<file>
Space separated symbols listed in the <file> argument will get
visibility set to hidden
-fvisibility-internal=<file>
Space separated symbols listed in the <file> argument will get
visibility set to internal
-fvisibility-inlines-hidden
mark inline member functions as hidden

Compatibility
兼容性
————-

-gcc-name=<name>
name and location of gcc if not where expected
-gxx-name=<name>
name and location of g++ if not where expected
-gcc-version=<version>
specify the <version> of gcc compatibility.  Default value matches
gcc version installed.  Major/Minor versions listed but patch
levels (i.e. 345) are permissible
320 – gcc 3.2.x compatibility
330 – gcc 3.3.x compatibility
340 – gcc 3.4.x compatibility
400 – gcc 4.0.x compatibility
410 – gcc 4.1.x compatibility
420 – gcc 4.2.x compatibility
-fabi-version=<val>
directs the compiler to select a specific ABI implementation
0 – most recent ABI implementation
1 – g++ 3.2 compatible ABI implementation
2 – most conformant ABI implementation

Linking/Linker
连接,连接器
————–

-L<dir>   instruct linker to search <dir> for libraries
-l<string>
instruct the linker to link in the -l<string> library
-shared-intel
link Intel provided libraries dynamically
-static-intel
link Intel provided libraries statically
Intel 提供的静态链接库

-shared-libgcc
libgcc的动态链接
-static-libgcc
libgcc的静态链接
-dynamic-linker<file>
select dynamic linker other than the default
-no-cxxlib
do not link in C++ runtime libraries
-cxxlib[=dir]
link using C++ run-time libraries provided with gcc dir is an
optional top-level location for the gcc binaries and libraries
-nodefaultlibs
do not use standard libraries when linking
-nostartfiles
do not use standard startup files when linking
-nostdlib
do not use standard libraries and startup files when linking
-static   prevents linking with shared libraries
-shared   produce a shared object
-Bstatic  specify following libraries are linked statically
-Bdynamic
specify following libraries are linked dynamically
-pthread  use POSIX* thread library for multithreading support
-cxxlib-<mode>
tell the compiler which C++ run-time libraries to use
nostd – do not link in standard C++ library
-u <symbol>
pretend the <symbol> is undefined
-T <file>
direct linker to read link commands from <file>
-Xlinker <val>
pass <val> directly to the linker for processing
-Wa,<o1>[,<o2>,…]
pass options o1, o2, etc. to the assembler
-Wl,<o1>[,<o2>,…]
pass options o1, o2, etc. to the linker for processing
-Wp,<o1>[,<o2>,…]
pass options o1, o2, etc. to the preprocessor

Linker Specific Options
连接器指定参数
———————–

These options are specific to the linker.  Details can be found in the linker
documentation and man page
-L<dir>
-T<arg>
-h<arg>
-u<arg>
-z<arg>
-i
-r
-s
-N
-Bsymbolic
-Bdynamic
-Bstatic

Deprecated Options
已无效的参数(相对早期版本)
——————

-Ob                      use -inline-level=<n>
-cxxlib-gcc[=dir]        use -cxxlib[=dir]
-i-dynamic               use -shared-intel
-i-static                use -static-intel
-inline-debug-info       use -debug inline-debug-info
-mp                      use -fp-model <arg>
-use-asm                 no replacement
-A-                      use -U<arg>
-prefetch                use -opt-prefetch
-prof-genx               use -prof-gen=srcpos
-openmp-lib=legacy       use -openmp-lib=compat
-xB                      use -xSSE2 (i32 only)
-xK                      use -xSSE (i32 only)
-axK                     No replacement
-xW                      use -msse2
-axW                     use -msse2
-xN                      use -xSSE2
-axN                     use -axSSE2
-xP                      use -xSSE3
-axP                     use -axSSE3
-xT                      use -xSSSE3
-axT                     use -axSSSE3
-xS                      use -xSSE4.1
-axS                     use -axSSE4.1
-xO                      use -msse3
-func-groups             use -prof-func-groups
-diag-enable sv<n>       use -diag-enable sc<n>
-diag-enable sv-include  use -diag-enable sc-include
-diag-disable sv         use -diag-disable sc
-diag-sv                 use -diag-enable sc
-diag-sv-error           use -diag-disable warning
-diag-sv-include         use -diag-enable sc-include
-diag-sv-level           No replacement
-diag-sv-sup             use -diag-disable <v1>[,<v2>,…]
-alias-args              use -fargument-alias
-c99                     use -std=c99
-create-pch              use -pch-create
-fwritable-strings       no replacement
-Kc++                    use -x c++
-no-alias-args           use -fargument-noalias
-use-pch                 use -pch-use
-wn                      use -diag-error-limit
-wd                      use -diag-disable
-we                      use -diag-error
-ww                      use -diag-warning
-wr                      use -diag-remark
-wo                      use -diag-once

-help [category]   print full or category help message

Valid categories include
advanced        – Advanced Optimizations
codegen         – Code Generation
compatibility   – Compatibility
component       – Component Control
data            – Data
deprecated      – Deprecated Options
diagnostics     – Compiler Diagnostics
float           – Floating Point
help            – Help
inline          – Inlining
ipo             – Interprocedural Optimization (IPO)
language        – Language
link            – Linking/Linker
misc            – Miscellaneous
opt             – Optimization
output          – Output
pgo             – Profile Guided Optimization (PGO)
preproc         – Preprocessor
reports         – Optimization Reports
openmp          – OpenMP and Parallel Processing

Copyright (C) 1985-2009, Intel Corporation.  All rights reserved.
* Other brands and names are the property of their respective owners.