[Previous] [Contents] [Index] [Next]

icc

Intel C and C++ compiler


Note: You must purchase and install the Intel compiler separately.

Syntax:

icc [option...] file...

Runs on:

Windows

Targets:

x86

Options:

option
One of the options described below.
file
C/C++ source (.C, .c, .cc, .cpp, .cxx, or .i), assembly (.s), object (.o), static library (.a), or other linkable files.

Note: You can place commonly used options in the icc.cfg file.

We've grouped the options into these categories:

Performance

-O1
Optimize to favor code size and code locality. Disable loop unrolling.
-O2
Optimize for code speed (the default). This is the generally recommended optimization level.
-O3
Enable -O2 and do more aggressive optimizations that might not improve performance for all programs.
-O0
Disable optimizations.
-O
Same as -O2.
-Obn
Control inline expansion:
0
Disable inlining.
1
Inline any functions declared with __inline and perform C++ inlining (default).
2
Inline any function, at the compiler's discretion (the same as -ip).
-falias
Assume aliasing in program (default).
-fast
Enhance speed across the entire program; set the following command options that can improve runtime performance: -O3, -ipo, and -static.
-fno-alias
Assume no aliasing in program.
-ffnalias
Assume aliasing within functions (default).
-fno-fnalias
Assume no aliasing within functions, but assume aliasing across calls.
-nolib_inline
Disable the inline expansion of intrinsic functions.
-mp
Maintain floating point precision (disables some optimizations).
-mp1
Improve floating-point precision (the impact on speed is less than with -mp).
-fp
Disable the use of EBP as a general-purpose register.
-prec_div
Improve the precision of floating-point division (some speed impact).
-fp_port
Round floating-point results at assignments and casts (some speed impact).
-fpstkchk
Generate extra code after every function call to assure that the FP stack is in the expected state.
-pc32
Set internal FPU precision to 24-bit significand.
-pc64
Set internal FPU precision to 53-bit significand.
-pc80
Set internal FPU precision to 64-bit significand (default).
-rcd
Enable fast float-to-int conversions.
-tpp5
Optimize for the Intel Pentium processor.
-tpp6
Optimize for the Intel Pentium Pro, Intel Pentium II and Intel Pentium III processors.
-tpp7
Optimize for Intel Pentium 4 processors, Intel Xeon processors, Intel Pentium M processors, and Intel Pentium 4 Processors with Streaming SIMD Extensions 3 (SSE3) instruction support (default on IA-32).
-mcpu=cpu
Optimize for a specific CPU:
-axcodes
Generate code specialized for processor extensions specified by codes while also generating generic IA-32 code. The codes string can include one or more of:
-xcodes
Generate specialized code to run exclusively on processors supporting the extensions indicated by codes, which includes one or more of the values given above for the -ax option.
-march=cpu
Generate code exclusively for a given cpu:

Advanced performance

You can use the following options to enable and specify the scope of Interprocedural (IP) optimizations:

-ip
Enable single-file IP optimizations (within files).
-ipo
Enable multi-file IP optimizations (between files).
-ipo_c
Generate a multi-file object file (ipo_out.o).
-ipo_S
Generate a multi-file assembly file (ipo_out.s).

You can use these options to modify the behavior of IP:

-ip_no_inlining
Disable full and partial inlining (requires -ip or -ipo).
-ip_no_pinlining
Disable the inlining that would result from the -ip interprocedural optimization. This option has no effect on other interprocedural optimizations.
-ipo_obj
Force the generation of real object files (requires -ipo).

Other advanced performance options include:

-unroll[n]
Set the maximum number of times to unroll loops. To use the default heuristics, omit n. To disable the loop unroller, specify 0 for n.
-prof_dir dir
Specify the directory in which to place the output files from profiling (*.dyn and *.dpi).
-prof_file file
Specify the name for the profiling summary file.
-prof_gen[x]
Instrument the program for profiling; with the x qualifier, extra information is gathered.
-prof_use
Enable the use of profiling information during optimization.
-qp, -p
Compile and link for function profiling with the UNIX prof tool.
-vec_report[n]
Control the amount of vectorizer diagnostic information:
-opt_report
Generate an optimization report to stderr.
-opt_report_filefile
Specify the filename for the generated report.
-opt_report_level[level]
Specify the level of report verbosity (min, med, or max). The default is min.
-opt_report_phasename
Specify the optimizer phase to generate reports against.
-opt_report_routinename
Report on routines containing the given name.
-opt_report_help
List the logical names of the optimizers that are available for report generation.
-openmp
Enable the compiler to generate multi-threaded code based on the OpenMP* directives.
-openmp_stubs
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.
-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 the threshold for the auto-parallelization of loops, where n is an integer from 0 to 100. The default is 75.
-alias_args[-]
Arguments may be aliased [not aliased]. The default is -alias_args.
-ansi_alias[-]
Use ANSI aliasing rules in optimizations. If you specify -ansi_alias, the compiler assumes:

If your program satisfies all of these conditions, setting the -ansi_alias flag helps the compiler better optimize the program. Otherwise, if you use -ansi_alias, the compiler might generate incorrect code.

-complex_limited_range
Cause the compiler to use the highest performance formulations of complex arithmetic operations, which may not produce acceptable results for input values near the top or bottom of the legal range. Without this option, the compiler uses a better formulation of complex arithmetic operations that produces acceptable results for the full range of input values, with some loss in performance.

Output and debug

-c
Compile to an object (.o) only; don't link.
-S
Compile to assembly (.s) only; don't link.
-use_asm
Produce objects through assembler.
-use_msasm
Support Microsoft-style assembly language insertion using MASM style syntax and, if requested, output assembly in MASM format.
-fcode-asm
Produce assembly file with optional code annotations.
-fsource-asm
Produce assembly file with optional code annotations.
-f[no]verbose-asm
Produce assembly file with compiler comments (default).
-ofile
Name the output file.
-g
Produce symbolic debug information in the object file.
-inline_debug_info
Preserve the source position of inlined code instead of assigning the call-site source position to inlined code.

C preprocessor

-Aname[(val)]
Create an assertion, name, having the value, val.
-A-
Remove all predefined macros.
-C
Don't strip comments.
-Dname[=text]
Define a macro.
-E
Preprocess to stdout.
-EP
Preprocess to stdout, omitting #line directives.
-P
Preprocess to file.
-Idir
Add the given directory to the path for finding include files.
-idirafterdir
Add the given directory to the second path for finding include files (after -I).
-isystemdir
Add the given directory to the start of the path for finding system include files.
-Uname
Remove the specified predefined macro.
-X
Remove standard directories from the path for finding include files.
-nostdinc
Same as -X.
-no-gcc
Don't predefine __GNUC__, __GNUC_MINOR__, or __GNUC_PATCHLEVEL__.
-H
Print the "include" file order and continue compiling.
-M
Generate makefile dependency information.
-MD
Preprocess and compile. Generate an output file (with an extension of .d) that contains dependency information.
-MFfile
Generate makefile dependency information in file. You must also specify -M or -MM.
-MG
Similar to -M, but treat missing header files as generated files.
-MM
Similar to -M, but don't include system header files.
-MMD
Similar to -MD, but don't include system header files.
-MX
Generate a dependency file (with an extension of .o.dep) that contains information used for the Intel wb tool.
-dM
Output the macro definitions that are in effect after preprocessing (use with -E).
-pch
Automatically use an appropriate precompiled header (PCH). If there isn't a precompiled header, create one.
-pch_dirdirname
Look for (and create, if necessary) precompiled headers in the specified directory.
-create_pchfilename
Create a precompiled header called filename.pchi. The filename can be a full path; if it isn't, the directory that you specified with the -pch_dir option is added to the beginning of the filename.
-use_pchfilename
Use the precompiled header, filename.pchi. The filename can be a full path; if it isn't, the directory that you specified with the -pch_dir option is added to the beginning of the filename.

Note: You can use only one of -pch, -create_pch, and -use_pch.

Component control

-Qoption,str,opts
Pass the options opts to the tool specified by str (cpp, c, asm, or ld).
-Qlocation,str,dir
Set dir as the location of the tool specified by str.
-Qinstall dir
Set dir as the root of the compiler installation.

Language

-[no]restrict
Enable [disable] the restrict keyword for disambiguating pointers.
-ansi
Support all ANSI standard C programs. This option is equivalent to the -ansi option to gcc.
-strict_ansi
Select strict ANSI C/C++ conformance dialect.
-c99[-]
Enable (default) [disable] C99 support for C programs.
-std=c99
Enable C99 support for C programs.
-Kc++
Compile all source or unrecognized file types as C++ source files.
-fno-rtti
Disable RTTI support.
-[no]align
Analyze and reorder memory layout for variables and arrays.
-Zp[n]
Specify the alignment constraint for structures (1, 2, 4, 8, or 16).
-syntax
Only check the syntax.
-fshort-enums
Allocate as many bytes as needed for enumerated types.
-fsyntax-only
Same as -syntax.
-funsigned-char
Change the default char type to be unsigned.
-funsigned-bitfields
Change the default bitfield type to unsigned.

Compiler diagnostics

-w
Disable all warnings.
-wn
Control the diagnostics:
-wnn
Print a maximum of n errors.
-wdL1[,L2,...]
Disable diagnostics L1 through LN.
-weL1[,L2,...]
Change the severity of diagnostics L1 through LN to be errors.
-wwL1[,L2,...]
Change the severity of diagnostics L1 through LN to be warnings.
-wrL1[,L2,...]
Change the severity of diagnostics L1 through LN to be remarks.
-Wall
Enable all warnings.
-Werror
Force warnings to be reported as errors.
-Wbrief
Print brief one-line diagnostics.
-Wcheck
Enable stricter diagnostics; check for code that:

Miscellaneous

-help
Print a list of compiler options.
-V
Display information about the version of the compiler.
-dryrun
Show the driver tool commands, but don't execute the tools.
-v
Show the driver tool commands and execute the tools.
-x type
Assume that source files listed after this option are of the specified type, where type is one of:
c
C source file.
c++
C++ source file.
c-header
C header file.
cpp-output
C preprocessed file.
assembler
Assembly file.
assembler-with-cpp
Assembly file that needs to be preprocessed.
none
Use the file extension to determine the file types.
For example, if you type:
icc -x c source_file -x none source_file2
  

source_file is compiled as a C file, and source_file2 is compiled as whatever its extension indicates.

-sox[-]
Enable [disable] (the default) the saving of compiler options and version in the executable.
-Kpic, KPIC
Deprecated; use -fpic instead. By default, this option is off.
-fpic, fPIC
For IA-32, generate position-independent code. By default, this option is off.
-fvisibility=[extern|default|protected|hidden|internal]
Use the specified visibility as the default for global symbols (data and functions). Symbol-visibility attributes explicitly set in the source code or using the symbol-visibility attribute file options override the -fvisibility setting.
-fvisibility-extern=file
Set the visibility for the symbols listed in the given file to be extern. The symbols listed in the file are separated by spaces.
-fvisibility-default=file
Set the visibility for the symbols listed in the given file to be the default. The symbols listed in the file are separated by spaces.
-fvisibility-protected=file
Set the visibility for the symbols listed in the given file to be protected. The symbols listed in the file are separated by spaces.
-fvisibility-hidden=file
Set the visibility for the symbols listed in the given file to be hidden. The symbols listed in the file are separated by spaces.
-fvisibility-internal=file
Set the visibility for the symbols listed in the given file to be internal. The symbols listed in the file are separated by spaces.
-fwritable-strings
Place string literals in a writable data section. This option provides compatibility with legacy programs that write into string literals.
-fminshared
Compile for the main executable. Permit absolute addressing and the generation of non-position independent code for symbols that are at least protected.
-fno-common
Treat common variables as if they were defined. This in turn lets you use gprel addressing for common data variables.
-long_double
Enable 80-bit long double.
-nobss_init
Disable the placement of zero-initialized variables in BSS (use DATA).

Linking and linker

-Ldir
Search dir for libraries.
-i_dynamic
Link Intel-provided libraries dynamically.
-dynamic-linkerfilename
Select a dynamic linker (filename) other than the default.
-mrelax
Pass -relax to the linker.
-mnorelax
Don't pass -relax to the linker.
-no_cpprt
Don't link in the C++ runtime libraries.
-cxxlib-gcc
Use the C++ libraries provided by gcc.
-cxxlib-icc
Use the C++ libraries provided by the Intel compiler.
-gcc-name=name
Use name as the fullpath to the location of g++ when the compiler can't locate the gcc C++ libraries. Use this option with -cxxlib-gcc configuration.
-nodefaultlibs
Don't use standard libraries when linking.
-nostartfiles
Don't use standard startup files when linking.
-nostdlib
Don't use standard libraries and startup files when linking.
-shared
Produce a shared object.
-shared-libcxa
Link the Intel libcxa C++ library dynamically, overriding the default behavior when -static is used.
-static
Prevent linking with shared libraries.
-static-libcxa
Link the Intel libcxa C++ library statically.
-u symbol
Pretend that symbol is undefined.
-T file
Direct the linker to read link commands from file.
-Xlinker val
Pass val directly to the linker for processing.
-Wl,o1[,o2,...]
Pass the options o1, o2, and so on to the linker for processing.

Description:

The Intel C++ Compiler, icc is designed to preprocess, compile, assemble, and link C and C++ programs on IA-32 systems.

As compared with the output of the standard gcc compiler, the Intel C++ Compiler can provide significant improvement in application performance on IA-32 processors and reduce executable code size.

For in-depth information on using icc and its compiler options, see the Intel C++ Compiler for QNX Neutrino RTOS User's Guide.

Author:

Intel Corporation

© 2004, QNX Software Systems Ltd. All rights reserved.

© 1985-2004, Intel Corporation. All rights reserved.

See also:

gcc, qcc


[Previous] [Contents] [Index] [Next]