Compiler Options Quick Reference Guide

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

Option Description Default Reference
-0f_check
IA-32 only
Avoids the incorrect decoding of certain 0f instructions for code targeted at older processors. OFF Avoiding Incorrect Decoding of Certain Instructions
-A- Disables all predefined macros. OFF Defining Macros
-Aname[(value)]

Associates a symbol name  with the specified sequence of value . Equivalent to an #assert preprocessing directive.

OFF Defining Macros
-ansi[-] Enables [disables] assumption of the program's ANSI conformance. OFF Specifiying ANSI Conformance
-ax{i|M|K|W}
IA-32 only
Generates specialized code for processor-specific codes i, M, K, W while also generating generic IA-32 code.
i
= Pentium® Pro and Pentium II processor instructions
M
=  MMX(TM) instructions
K
= streaming SIMD extensions
W
= Pentium 4 processor instructions
OFF Specialized Code with -ax

 

-C Places comments in preprocessed source output. OFF Preserving Comments in Preprocessed Source Output
-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 Suppressing Linking
-Dname[{=|#}value]

Defines a macro name  and associates it with the specified value .

OFF Defining Macros
-E Stops the compilation process after the C or C++ source files have been preprocessed, and writes the results to stdout. OFF Preprocessing Only
-EP Preprocess to stdout omitting #line directives. OFF

Preprocessing Only

-fdiv_check[-]
IA-32 only
Enables a software patch for the floating-point division flaw that exists in some steppings of the Pentium processor. OFF Enabling the Floating-point Division Check
-fp
IA-32 only
Disable using EBP as general purpose register. ON Preparing for Debugging
-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  
-g Generates symbolic debugging information in the object code for use by source-level debuggers. OFF Preparing for Debugging
-H Print "include" file order; don't compile. OFF  
-help Prints compiler options summary. OFF  
-Idirectory

Specifies an additional directory  to search for include files.

OFF Include Files
-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 Interprocedural Optimization (IPO)
-ip_no_inlining Disables inlining that would result from the -ip interprocedural optimization, but has no effect on other interprocedural optimizations. OFF Controlling Inline Expansion of User Functions

-ip_no_pinlining

Disable partial inlining. Requires -ip or -ipo.

 

 

-ipo

Enables interprocedural optimizations across files.

OFF

Interprocedural Optimization (IPO)

-ipo_c Generates a multifile object file (ipo_out.o) that can be used in further link steps. OFF Analyzing the Effects of Multifile IPO
-ipo_obj Forces the compiler to create real object files when used with -ipo. OFF (IA-32)
ON (Itanium-based systems)
Interprocedural Optimization (IPO)
-ipo_S Generates a multifile assembly file named ipo_out.s that can be used in further link steps. OFF Analyzing the Effects of Multifile IPO
-Kc++ Compile all source or unrecognized file types as C++ source files. OFF

 

-Kc++eh

Enable C++ exception handling.

OFF

 

-Knopic, -KNOPIC
Itanium-based
systems only

Don't generate position independent code.

OFF

 

-Knovtab Suppresses definition of vftables for classes without non-inline vfns OFF  
-KPIC, -Kpic Generate position independent code. OFF  
-Krtti Enables C++ Runtime Type Information (RTTI). ON  
-Ldirectory

Instruct linker to search directory  for libraries.

OFF

Linking

-lm Link with math library. OFF

 

-long_double Changes the default size of the long double data type from 64 to 80 bits. OFF Floating-point Arithmetic Precision
-M Generates makefile dependency lines for each source file, based on the #include lines found in the source file. OFF

 

-mp Favors conformance to the ANSI C and IEEE 754 standards for floating-point arithmetic. Behavior for NaN comparisons does not conform. (disables some optimization) OFF Floating-point Arithmetic Precision
-mp1 Improve floating-point precision (speed impact is less than -mp). OFF

Floating-point Arithmetic Precision

-nobss_init Places variables that are initialized with zeroes in the DATA section. Disables placement of zero-initialized variables in BSS (use DATA). OFF Allocation of Zero-initialized Variables
-nolib_inline Disables inline expansion of standard library functions. OFF Inline Expansion of Library Functions
-O same as -O1. ON

 

-O0 Disables optimizations. OFF Restricting Optimizations
-O1 Enable optimizations. ON Optimization Choices
-O2 Same as -O1. ON Optimization Choices
-O3 Enable -O2 plus more aggressive optimizations that may not improve performance for all programs. OFF

Optimization Choices

-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 Parallelization With OpenMP*
-openmp_report{0|1|2} Controls the OpenMP* parallelizer's diagnostic levels. -openmp_report1 Parallelization With OpenMP*
-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 Preprocessing Only
-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. ON

 

-pc80
IA-32 only
Set internal FPU precision to 64-bit significand. OFF

 

-prec_div
IA-32 only
Disables the floating point division-to-multiplication optimization. Improves precision of floating-point divides. OFF Floating-point Arithmetic Precision.
-prof_dir dirname

Specify the directory (dirname ) to hold profile information (*.dyn, *.dpi).

OFF Profile-Guided Optimization (PGO)
-prof_file filename

Specify the   filename  for profiling summary file.

OFF Profile-Guided Optimization (PGO)
-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 Profile-Guided Optimization (PGO)
-prof_use Uses dynamic feedback information. OFF Profile-Guided Optimization (PGO)
-Qansi[-]
Itanium-based
systems only
Enable [disable] stating ANSI compliance of the compiled program and that optimizations can be based on the ANSI rules.    
-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 Specifying Alternate Tools and Paths
-Qoption,tool,list

Passes an argument list  to another tool  in the compilation sequence, such as the assembler or linker.

OFF Specifying Alternate Tools and Paths

-qp, -p

Compile and link for function profiling with UNIX* prof tool

 

 

-rcd
IA-32 only

Disables changing of the FPU rounding control. Enables fast float-to-int conversions.

OFF

Floating-point Arithmetic Precision

-restrict Enables pointer disambiguation with the
restrict
qualifier.
OFF  
-S Generate assembly files with .s suffix OFF  Compilation and Linking
-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. NOTE: This option is maintained for compatibility only on Itanium(TM)-based systems. 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 Parsing for Syntax Only
-Timplinc Enable implicit inclusion of source files for finding template definitions. OFF  
-Tlocal Instantiate template functions used in this compilation and make local. OFF  
-Tnoauto Disable automatic instantiation of templates. OFF  
-tpp5
IA-32 only
Targets the optimizations to the Intel® Pentium® processor. OFF Targeting a Processor and Extensions Support  
-tpp6
IA-32 only
Targets the optimizations to the Intel Pentium Pro, Pentium II and Pentium III processors. ON Targeting a Processor and Extensions Support
-tpp7
IA-32 only
Tunes code to favor the Intel Pentium 4 processor. OFF Targeting a Processor and Extensions Support
-Tused Instantiate template functions used in this compilation. OFF  
-Uname

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

OFF Defining Macros
-unroll0
Itanium-based
systems only
Disable loop unrolling. OFF

Loop Unrolling

-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

Loop Unrolling

-use_asm
IA-32 only

Produce objects through assembler.

 

 

-use_msasm
IA-32 only

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

ON

 

-V

Display compiler version information.

OFF

 

-vec[-]

Enable [disable] the vectorizer.

ON

 

-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

-vec_report1

Vectorizer Quick Reference

-w Disable 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  

OFF

Supressing Warning Messages

-wdL1[,L2,...]

Disables diagnostics L1 through LN.

OFF Controlling the Severity of Diagnostics
-weL1[,L2,...] Changes severity of diagnostics L1 through LN to error. OFF Controlling the Severity of Diagnostics
-wnn

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

n=100 Limiting the Number of Errors Reported
-wp_ipo Compile all objects over entire program with multifile interprocedural optimizations. This option additionally makes the whole program assumption that all variables and functions seen in compiled sources are referenced only within those sources; the user must guarantee that this assumption is safe. OFF Interprocedural Optimization (IPO)
-wrL1[,L2,...] Changes the severity of diagnostics L1 through LN to remark. OFF Controlling the Severity of Diagnostics
-wwL1[,L2,...] Changes severity of diagnostics L1 through LN to warning. OFF Controlling the Severity of Diagnostics
-X Removes the standard directories from the list of directories to be searched for include files. OFF Removing Include Directories
-XA C++ compilation follows ARM. OFF  
-Xa Select extended ANSI C dialect. OFF  
-XC C++ compilation follows cfront. OFF  
-Xc Select strict ANSI conformance dialect. OFF  
-x{i|M|K|W}
IA-32 only
Generates specialized code to run exclusively on processors supporting the extensions indicated by processor-specific codes i, M, K, W. OFF Targeting a Processor and Extensions Support
-Xk Select K&R dialect. OFF  
-XO C++ compilation follows ARM with anachronisms. OFF  
-Xt Select ANSI transition dialect. OFF  
-XU C++ compilation follows ARM and cfront with anachronisms. 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. -Zp16 Specifying Structure Tag Alignments