Compiler Options Quick Reference Guide

This topic provides you with a reference to all the compiler options and some linker control options.

All other options are supported on both IA-32 and Itanium-based systems.

Option Description Default
-0f_check
IA-32 only
Avoids the incorrect decoding of certain 0f instructions for code targeted at older processors.
OFF
-A- Disables all predefined macros.
OFF
-[no]align
IA-32 only
Analyze and reorder memory layout for variables and arrays. OFF
-Aname[(value)] Associates a symbol name with the specified sequence of value. Equivalent to an #assert preprocessing directive.
OFF

-ansi

Select strict ANSI C/C++ conformance dialect.

OFF

-ansi_alias[-]

-ansi_alias directs the compiler to assume the following:

  • Arrays are not accessed out of bounds.
  • Pointers are not cast to non-pointer types, and vice-versa.
  • References to objects of two different scalar types cannot alias. For example, an object of type int cannot alias with an object of type float, or an object of type float cannot alias with an object of type double.

If your program satisfies the above conditions, setting the -ansi_alias flag will help the compiler better optimize the program. However, if your program does not satisfy one of the above conditions, the -ansi_alias flag may lead the compiler to generate incorrect code.

OFF

-ax{M|i|K|W}
IA-32 only

Generates specialized code for processor-specific codes M, i, K, W while also generating generic IA-32 code.

  • M = Intel® Pentium® processors with MMX(TM) technology
  • i = Intel Pentium Pro and Intel Pentium II processors
  • K = Intel Pentium III processors
  • W = Intel Pentium 4 processors, Intel® Xeon(TM) processors, and Intel® Pentium® M processors

OFF

-C Places comments in preprocessed source output.
OFF
-c Stops the compilation process after an object file has been generated. The compiler generates an object file for each C or C++ source file or preprocessed source file. Also takes an assembler file and invokes the assembler to generate an object file.
OFF
-c99[-] Enables [disables] C99 support for C programs.
ON
-complex_limited_range This option causes 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 users a better formulation of complex arithmetic operations which produces acceptable results for the full range of input values, at some loss in performance. OFF
-dM Output macro definitions in effect after preprocessing (use with -E). OFF
-Dname[=value] Defines a macro name and associates it with the specified value. Equivalent to a #define preprocessor directive.
OFF
-dryrun Show driver tool commands but do not execute tools. OFF

-dynamic-linkerfilename

Selects a dynamic linker (filename) other than the default.

OFF

-E

Stops the compilation process after the C or C++ source files have been preprocessed, and writes the results to stdout.

OFF

-EP Preprocess to stdout omitting #line directives.
OFF
-falias Assume aliasing in program. ON
-fcode-asm Produce assemblable file with optional code annotations. Requires -S. OFF
-fno-alias Assume no aliasing in program. OFF
-ffnalias Assume aliasing within functions ON
-fno-fnalias Assume no aliasing within functions, but assume aliasing across calls. OFF
-fno-rtti Disable RTTI support. OFF
-f[no]verbose-asm Produce assemblable file with compiler comments. ON

-fnsplit[-]
Itanium-based
systems only

Enables [disables] function splitting. Default is ON with -prof_use. To disable function splitting when you use -prof_use, also specify -fnsplit-.

OFF

-fp
IA-32 only

Disable using the EBP register as general purpose register.

OFF

-fpic, -fPIC Generate position independent code. OFF
-fp_port
IA-32 only
Round fp results at assignments and casts. Some speed impact. OFF
-fr32
Itanium-based
systems only
Use only lower 32 floating-point registers. OFF
-fshort-enums Allocate as many bytes as needed for enumerated types. OFF
-fsource-asm Produce assemblable file with optional code annotations. Requires -S. OFF
-fsyntax-only Same as -syntax. OFF
-ftz[-]
Itanium-based
systems only
Flushes denormal results to zero. The option is turned ON with -O3.
OFF
-funsigned-char Change default char type to unsigned. OFF
-funsigned-bitfields Change default bitfield type to unsigned. OFF
-g Generates symbolic debugging information in the object code for use by source-level debuggers.
OFF
-H Print "include" file order and continue compilation. OFF
-help Prints compiler options summary. OFF
-idirafterdir Add directory (dir) to the second include file search path (after -I). OFF
-Idirectory Specifies an additional directory  to search for include files.
OFF
-i_dynamic Link Intel provided libraries dynamically. OFF
-inline_debug_info Preserve the source position of inlined code instead of assigning the call-site source position to inlined code. OFF
-ip Enables interprocedural optimizations for single file compilation.
OFF
-IPF_fma[-]
Itanium-based
systems only
Enable [disable] the combining of floating-point multiplies and add/subtract operations.
OFF
-IPF_fltacc[-]
Itanium-based
systems only
Enable [disable] optimizations that affect floating-point accuracy.
OFF
-IPF_flt_eval_method0
Itanium-based
systems only
Floating-point operands evaluated to the precision indicated by the program.
OFF
-IPF_fp_speculationmode
Itanium-based
systems only
Enable floating-point speculations with the following mode conditions:
  • fast - speculate floating-point operations
  • safe - speculate only when safe
  • strict - same as off
  • off - disables speculation of floating-point operations
OFF
-ip_no_inlining Disables inlining that would result from the -ip interprocedural optimization, but has no effect on other interprocedural optimizations.
OFF
-ip_no_pinlining
IA-32 only
Disable partial inlining. Requires -ip or -ipo. OFF
-ipo Enables interprocedural optimizations across files.
OFF
-ipo_c Generates a multifile object file (ipo_out.o) that can be used in further link steps.
OFF
-ipo_obj Forces the compiler to create real object files when used with -ipo.
OFF
-ipo_S Generates a multifile assemblable file named ipo_out.s that can be used in further link steps.
OFF
-ivdep_parallel
Itanium-based
systems only
This option indicates there is absolutely no loop-carried memory dependency in the loop where IVDEP directive is specified.
OFF
-Kc++ Compile all source or unrecognized file types as C++ source files. ON
(for icpc/ecpc)
-Knopic, -KNOPIC
Itanium-based
systems only
Don't generate position independent code. OFF
-KPIC, -Kpic Generate position independent code. OFF for IA-32
ON for Itanium-based systems
-Ldirectory Instruct linker to search directory  for libraries.
OFF
-long_double
IA-32 only
Changes the default size of the long double data type from 64 to 80 bits.
OFF
-M Generates makefile dependency lines for each source file, based on the #include lines found in the source file. OFF
-march=cpu
IA-32 only
Generate code excusively for a given cpu. Values for cpu are:
  • pentiumpro - Pentium® Pro and Pentium II processor instructions.
  • pentiumii - MMX(TM) instructions.
  • pentiumiii - Streaming SIMD extensions.
  • pentium4 - Pentium 4 instructions.
OFF
-mcpu=cpu Optimize for a specific cpu.

For IA-32, cpu values are:

  • pentium - Optimize for Pentium processor.
  • pentiumpro - Optimize for Pentium Pro, Pentium II and Pentium III processors.
  • pentium4 - Optimize for Pentium 4 processor (Default).
For Itanium-based Systems, cpu values are:
  • itanium - Optimize for Itanium processor.
  • itanium2 - Optimize for Itanium 2 processor (Default).
ON

pentium
on IA-32

itanium2
on Itanium-based
Systems

-MD Preprocess and compile. Generate output file (.d extension) containing dependency information. OFF
-MFfile Generate makefile dependency information in file. Must specify -M or -MM. OFF
-MG Similar to -M, but treats missing header files as generated files. OFF
-MM Similar to -M, but does not include system header files. OFF
-MMD Similar to -MD, but does not include system header files. OFF
-MX Generate dependency file (.o.dep extension) containing information used for the Intel wb tool. OFF
-mp Favors conformance to the ANSI C and IEEE 754 standards for floating-point arithmetic. OFF
-mp1 Improve floating-point precision (speed impact is less than -mp).
OFF
-mrelax Pass -relax to the linker. ON
-mno-relax Do not pass -relax to the linker. OFF
-mserialize-volatile
Itanium-based
systems only
Impose strict memory access ordering for volatile data object references. OFF
-mno-serialize-volatile
Itanium-based
systems only
The compiler may suppress both run-time and compile-time memory access ordering for volatile data object references. Specifically, the .rel/.acq completers will not be issued on referencing loads and stores. OFF
-nobss_init Places variables that are initialized with zeroes in the DATA section. Disables placement of zero-initialized variables in BSS (use DATA).
OFF
-no_cpprt Do not link in C++ run-time libraries. OFF
-nodefaultlibs Do not use standard libraries when linking.  
-nolib_inline Disables inline expansion of standard library functions.
OFF
-nostartfiles Do not use standard startup files when linking. OFF
-nostdlib Do not use standard libraries and startup files when linking. OFF
-O Same as -O1 on IA-32. Same as -O2 on Itanium-based systems. OFF
-O0 Disables optimizations.
OFF
-O1 Enable optimizations. Optimizes for speed. For Itanium compiler, -O1 turns off software pipelining to reduce code size.
ON
-O2 Same as -O1 on IA-32. Same as -O on Itanium-based systems.
OFF
-O3 Enable -O2 plus more aggressive optimizations that may increase the compilation time. Impact on performance is application dependent, some applications may not see a performance improvement.
OFF

-Obn

Controls the compiler's inline expansion. The amount of inline expansion performed varies with the value of n as follows:

  • 0: Disables inlining.
  • 1: Enables (default) inlining of functions declared with the __inline keyword. Also enables inlining according to the C++ language.
  • 2: Enables inlining of any function. However, the compiler decides which functions to inline. Enables interprocedural optimizations and has the same effect as -ip.

ON

-ofile

Name output file.

OFF

-openmp Enables the parallelizer to generate multi-threaded code based on the OpenMP* directives. The -openmp option only works at an optimization level of -O2 (the default) or higher.
OFF
-openmp_report{0|1|2} Controls the OpenMP parallelizer's diagnostic levels.
ON
-openmp_report1
-openmp_stubs Enables OpenMP programs to compile in sequential mode. The OpenMP directives are ignored and a stub OpenMP library is linked sequentially. OFF
-opt_report Generates an optimization report directed to stderr, unless -opt_report_file is specified. OFF
-opt_report_filefilename Specifies the filename for the optimization report. It is not necessary to invoke -opt_report when this option is specified. OFF
-opt_report_levellevel Specifies the verbosity level of the output. Valid level arguments:
  • min
  • med
  • max

If a level is not specified, min is used by default.

OFF
-opt_report_phasename Specifies the compilation name for which reports are generated. The option can be used multiple times in the same compilation to get output from multiple phases.
Valid name arguments:
  • ipo: Interprocedural Optimizer
  • hlo: High Level Optimizer
  • ilo: Intermediate Language Scalar Optimizer
  • ecg: Code Generator
  • omp: OpenMP*
  • all: All phases
OFF
-opt_report_routinesubstring Specifies a routine substring. Reports from all routines with names that include substring as part of the name are generated. By default, reports for all routines are generated. OFF
-opt_report_help Displays all possible settings for -opt_report_phase. No compilation is performed. OFF
-P, -F Stops the compilation process after C or C++ source files have been preprocessed and writes the results to files named according to the compiler's default file-naming conventions.
OFF
-parallel Detects parallel loops capable of being executed safely in parallel and automatically generates multithreaded code for these loops. OFF
-par_report{0|1|2|3} Controls the auto-parallelizer's diagnostic levels 0, 1, 2, or 3 as follows:
  • -par_report0: no diagnostic information is displayed.
  • -par_report1: indicates loops successfully auto-parallelized (default).
  • -par_report2: loops successfully and unsccessfully auto-parallelized.
  • -par_report3: same as 2 plus additional information about any proven or assumed dependences inhibiting auto-parallelization.
OFF
-par_threshold[n] Sets a threshold for the auto-parallelization of loops based on the probability of profitable execution of the loop in parallel, n=0 to 100. This option is used for loops whose computation work volume cannot be determined at compile time.
  • -par_threshold0: loops get auto-parallelized regardless of computation work volume.
  • -par_threshold100: loops get auto-parallelized only if profitable parallel execution is almost certain.
OFF
-pc32
IA-32 only
Set internal FPU precision to 24-bit significand. OFF
-pc64
IA-32 only
Set internal FPU precision to 53-bit significand. OFF
-pc80
IA-32 only
Set internal FPU precision to 64-bit significand. ON
-prec_div
IA-32 only
Disables the floating point division-to-multiplication optimization. Improves precision of floating-point divides.
OFF
-prof_dir dirname Specify the directory (dirname) to hold profile information (*.dyn, *.dpi).
OFF
-prof_file filename Specify the filename for profiling summary file.
OFF
-prof_gen[x] Instruments the program to prepare for instrumented execution and also creates a new static profile information file (.spi ). With the x qualifier, extra information is gathered.
OFF
-prof_use Uses dynamic feedback information.
OFF
-Qinstall dir Sets dir as root of compiler installation. OFF
-Qlocation,tool,path Sets path as the location of the tool specified by tool .
OFF
-Qoption,tool,list Passes an argument list to another tool in the compilation sequence, such as the assembler or linker.
OFF
-qp, -p Compile and link for function profiling with UNIX* prof tool OFF
-rcd
IA-32 only
Disables changing of the FPU rounding control. Enables fast float-to-int conversions.
OFF
-[no]restrict Enables/disables pointer disambiguation with the
restrict
qualifier.
OFF
-S Generates assemblable files with .s suffix, then stops the compilation.
OFF 
-shared Produce a shared object. OFF
-size_lp64
Itanium-based
systems only
Assume 64-bit size for long and pointer types. OFF
-sox[-]
IA-32 only
Enables [disables] the saving of compiler options and version information in the executable file. -sox-
-static Prevents linking with shared libraries. OFF
-std=c99 Enable C99 support for C programs. ON
-syntax Checks the syntax of a program and stops the compilation process after the C or C++ source files and preprocessed source files have been parsed. Generates no code and produces no output files. Warnings and messages appear on stderr.
OFF
-tpp1
Itanium-based
systems only
Target optimization to the Itanium processor. OFF
-tpp2
Itanium-based
systems only
Target optimization to the Itanium® 2 processor. Generated code is compatible with the Itanium processor. ON

-tpp5
IA-32 only

Targets the optimizations to the Pentium processor.

OFF

-tpp6
IA-32 only
Targets the optimizations to the Pentium Pro, Pentium II and Pentium III processors.
OFF
-tpp7
IA-32 only
Tunes code to favor the Pentium 4 and Intel® Xeon(TM) processor.
ON
-Uname

Suppresses any definition of a macro name. Equivalent to a #undef preprocessing directive.

OFF
-unroll0
Itanium-based
systems only
Disable loop unrolling.
OFF
-unroll[n]
IA-32 only

Set maximum number of times to unroll loops. Omit n to use default heuristics. Use n =0 to disable loop unroller.

OFF

-use_asm

Produce objects through assembler.

OFF

-use_msasm
IA-32 only

Accept the Microsoft* MASM-style inlined assembly format instead of GNU-style.   

OFF

-u symbol

Pretend the symbol is undefined.

OFF

-V

Display compiler version information.

OFF

-v

Show driver tool commands and execute tools.

 

-vec_report[n]
IA-32 only

Controls the amount of vectorizer diagnostic information.

  • n = 0 no diagnostic information
  • n = 1 indicates vectorized loops (DEFAULT)          
  • n = 2 indicates vectorized/non-vectorized loops
  • n = 3 indicates vectorized/non-vectorized loops and prohibiting data dependence information
  • n = 4 indicates non-vectorized loops
  • n = 5 indicates non-vectorized loops and prohibiting data

ON
-vec_report1

-w Disable all warnings. OFF

-Wall

Enable all warnings.

OFF

-wn

Control diagnostics.

  • n = 0 displays errors (same as -w)
  • n = 1 displays warnings and errors (DEFAULT)
  • n = 2 displays remarks, warnings, and errors

ON
-w1

-wdL1[,L2,...]

Disables diagnostics L1 through LN.

OFF
-weL1[,L2,...] Changes severity of diagnostics L1 through LN to error.
OFF

-Werror

Force warnings to be reported as errors.

OFF

-wnn

Limits the number of errors displayed prior to aborting compilation to n.

ON
-wn100

-wrL1[,L2,...] Changes the severity of diagnostics L1 through LN to remark.
OFF
-wwL1[,L2,...] Changes severity of diagnostics L1 through LN to warning.
OFF

-Wl,o1[,o2,...]

Pass options o1, o2, etc. to the linker for processing.

OFF

-xtype

All source files found subsequent to -xtype 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 preprocessed file
  • assembler - assemblable file
  • assembler-with-cpp - Assemblable file that needs to be preprocessed.
  • none - Disable recognition and revert to file extension.

OFF

-X

Removes the standard directories from the list of directories to be searched for include files.

OFF

-Xa Select extended ANSI C dialect. ON
-Xc Select strict ANSI conformance dialect. OFF
-x{M|i|K|W}
IA-32 only

Generates specialized code for processor-specific codes M, i, K, W.

  • M = Intel® Pentium® processors with MMX(TM) technology
  • i = Intel Pentium Pro and Intel Pentium II processors
  • K = Intel Pentium III processors
  • W = Intel Pentium 4 processors, Intel Xeon processors, and Intel Pentium M processors

OFF
-Xlinker val Pass val directly to the linker for processing. OFF
-Zp{1|2|4|8|16} Specifies the strictest alignment constraint for structure and union types as one of the following: 1, 2, 4, 8, or 16 bytes.
ON
-Zp16