Changing the Compiler's Behavior with Options

Options control the operation of the compiler. This section provides a description of option conventions and an option summary table. It also provides detailed descriptions of the most frequently used options, including options used for type-checking and assembling.

For a help screen summary of the options, enter cl6x with no parameters on the command line.

The following apply to the compiler options:

You can define default options for the compiler by using the C6X_C_OPTION environment variable. For a detailed description of the environment variable, see Section 3.4.1.

Table 3-6 through Table 3-29 summarize all options (including link options). Use the references in the tables for more complete descriptions of the options.

Table 3-1 Processor Options

Option Alias Effect Section
--silicon_version=id -mv Selects target version. Defaults to 6400+. The other supported options are 6600 and 6740. Section 3.3.5
--big_endian -me Produces object code in big-endian format. Section 3.3.4

Table 3-2 Optimization Options(1)

Option Alias Effect Section
--opt_level=off Disables all optimization (default). Section 4.1
--opt_level=n -On Level 0 (-O0) optimizes register usage only.
Level 1 (-O1) uses Level 0 optimizations and optimizes locally.
Level 2 (-O2) uses Level 1 optimizations and optimizes globally.
Level 3 (-O3) uses Level 2 optimizations and optimizes the file. ()
Section 4.1, Section 4.3
--opt_for_space=n -ms Controls code size on four levels (0, 1, 2, and 3). Section 4.9
--opt_for_speed[=n] -mf Controls the tradeoff between size and speed (0-5 range). If this option is specified without n, the default value is 4. If this option is not specified, the default setting is 4. Section 4.2
--fp_mode={relaxed|strict} Enables or disables relaxed floating-point mode. Section 3.3.3
--fp_reassoc={on|off} Enables or disables the reassociation of floating-point arithmetic. Section 3.3.3
--sat_reassoc={on|off} Enables or disables the reassociation of saturating arithmetic. Default is --sat_reassoc=off. Section 3.3.3
Note: Machine-specific options (see Table 3-11) can also affect optimization.

Table 3-3 Advanced Optimization Options(1)

Option Alias Effect Section
--auto_inline=[size] -oi Sets automatic inlining size (--opt_level=3 only). If size is not specified, the default is 1. Section 4.5
--call_assumptions=n -opn Level 0 (-op0) specifies that the module contains functions and variables that are called or modified from outside the source code provided to the compiler.
Level 1 (-op1) specifies that the module contains variables modified from outside the source code provided to the compiler but does not use functions called from outside the source code.
Level 2 (-op2) specifies that the module contains no functions or variables that are called or modified from outside the source code provided to the compiler (default).
Level 3 (-op3) specifies that the module contains functions that are called from outside the source code provided to the compiler but does not use variables modified from outside the source code.
Section 4.4.1
--gen_opt_info=n -onn Level 0 (-on0) disables the optimization information file.
Level 1 (-on2) produces an optimization information file.
Level 2 (-on2) produces a verbose optimization information file.
Section 4.3.1
--optimizer_interlist -os Interlists optimizer comments with assembly statements. Section 4.16
--program_level_compile -pm Combines source files to perform program-level optimization. Section 4.4
--aliased_variables -ma Notifies the compiler that addresses passed to functions may be modified by an alias in the called function. Section 4.12.1
Note: Machine-specific options (see Table 3-11) can also affect optimization.

Table 3-4 Debug Options

Option Alias Effect Section
--symdebug:dwarf -g Default behavior. Enables symbolic debugging. The generation of debug information no longer impacts optimization. Therefore, generating debug information is enabled by default. If you explicitly use the -g option but do not specify an optimization level, no optimization is performed. Section 3.3.6
Section 4.17
--symdebug:none Disables all symbolic debugging. Section 3.3.6
Section 4.17
--disable_push_pop Disables the code-size optimization that calls the RTS functions _push_rts() and _pop_rts(). You may want to use this option if you receive warnings about calls to RTS routines that are placed out of range of the calling location. --
--machine_regs Displays reg operands as machine registers in assembly code. Section 3.3.12

Table 3-5 Include Options

Option Alias Effect Section
--include_path=directory -I Adds the specified directory to the #include search path. Section 3.5.2.1
--preinclude=filename Includes filename at the beginning of compilation. Section 3.3.3

Table 3-6 Control Options

Option Alias Effect Section
--compile_only -c Disables linking (negates --run_linker). Section 6.1.3
--help -h Prints (on the standard output device) a description of the options understood by the compiler. Section 3.3.2
--run_linker -z Causes the linker to be invoked from the compiler command line. Section 3.3.2
--skip_assembler -n Compiles C/C++ source file or linear assembly source file, producing an assembly language output file. The assembler is not run and no object file is produced. Section 3.3.2

Table 3-7 Language Options

Option Alias Effect Section
--c89 Processes C files according to the ISO C89 standard. Section 7.13
--c99 Processes C files according to the ISO C99 standard. Section 7.13
--c++14 Processes C++ files according to the ISO C++14 standard.
The --c++03 option has been deprecated.
Section 7.13
--cpp_default -fg Processes all source files with a C extension as C++ source files. Section 3.3.8
--exceptions Enables C++ exception handling. Section 7.6
--extern_c_can_throw Allow extern C functions to propagate exceptions. --
--float_operations_allowed={none| all|32|64} Restricts the types of floating point operations allowed. Section 3.3.3
--gen_cross_reference -px Generates a cross-reference listing file (.crl). Section 3.9
---gen_preprocessor_listing -pl Generates a raw listing file (.rl). Section 3.10
--multithread Inserts a build attribute into the compiler-generated object file that will cause the TI linker to choose a thread-safe version of the RTS library when auto-selecting an RTS library or resolving a reference to libc.a. Alternately, a linker option with the same name (--multithread) can be used to force the linker to choose a thread-safe version of the RTS library, even if none of the object files contain this build attribute. If you use the --openmp option, the --multithread option is enabled automatically. Section 8.10.2
--openmp --omp Enables support for OpenMP. Using this option automatically enables the --multithread option, which causes the TI linker to choose a thread-safe version of the RTS library when auto-selecting an RTS library or resolving a reference to libc.a. Section 8.10.1
--relaxed_ansi -pr Enables relaxed mode; ignores strict ISO violations. This is on by default. To disable this mode, use the --strict_ansi option. Section 7.13.2
--rtti -rtti Enables C++ run-time type information (RTTI). –-
--small_enum --small-enum Uses the smallest possible size for the enumeration type. Section 3.3.4
--strict_ansi -ps Enables strict ANSI/ISO mode (for C/C++, not for K&R C). In this mode, language extensions that conflict with ANSI/ISO C/C++ are disabled. In strict ANSI/ISO mode, most ANSI/ISO violations are reported as errors. Violations that are considered discretionary may be reported as warnings instead. Section 7.13.2
--vectypes={on|off} Enable support for native vector data types. Section 7.4.2
--wchar_t={32|16} Sets the size of the C/C++ type wchar_t. Default is 16 bits. Section 3.3.4

Table 3-8 Parser Preprocessing Options

Option Alias Effect Section
--preproc_dependency[=filename] -ppd Performs preprocessing only, but instead of writing preprocessed output, writes a list of dependency lines suitable for input to a standard make utility. Section 3.5.8
--preproc_includes[=filename] -ppi Performs preprocessing only, but instead of writing preprocessed output, writes a list of files included with the #include directive. Section 3.5.9
--preproc_macros[=filename] -ppm Performs preprocessing only. Writes list of predefined and user-defined macros to a file with the same name as the input but with a .pp extension. Section 3.5.10
--preproc_only -ppo Performs preprocessing only. Writes preprocessed output to a file with the same name as the input but with a .pp extension. Section 3.5.4
--preproc_with_comment -ppc Performs preprocessing only. Writes preprocessed output, keeping the comments, to a file with the same name as the input but with a .pp extension. Section 3.5.6
--preproc_with_compile -ppa Continues compilation after preprocessing with any of the -pp<x> options that normally disable compilation. Section 3.5.5
--preproc_with_line -ppl Performs preprocessing only. Writes preprocessed output with line-control information (#line directives) to a file with the same name as the input but with a .pp extension. Section 3.5.7

Table 3-9 Predefined Symbols Options

Option Alias Effect Section
--define=name[=def] -D Predefines name. Section 3.3.2
--undefine=name -U Undefines name. Section 3.3.2

Table 3-10 Diagnostic Message Options

Option Alias Effect Section
--compiler_revision Prints out the compiler release revision and exits. --
--diag_error=num -pdse Categorizes the diagnostic identified by num as an error. Section 3.7.1
--diag_remark=num -pdsr Categorizes the diagnostic identified by num as a remark. Section 3.7.1
--diag_suppress=num -pds Suppresses the diagnostic identified by num. Section 3.7.1
--diag_warning=num -pdsw Categorizes the diagnostic identified by num as a warning. Section 3.7.1
--diag_wrap={on|off} Wrap diagnostic messages (default is on). Note that this command-line option cannot be used within the Code Composer Studio IDE.
--display_error_number -pden Displays a diagnostic's identifiers along with its text. Note that this command-line option cannot be used within the Code Composer Studio IDE. Section 3.7.1
--emit_warnings_as_errors -pdew Treat warnings as errors. Section 3.7.1
--issue_remarks -pdr Issues remarks (non-serious warnings). Section 3.7.1
--no_warnings -pdw Suppresses diagnostic warnings (errors are still issued). Section 3.7.1
--quiet -q Suppresses progress messages (quiet). --
--section_sizes={on|off} Generates section size information, including sizes for sections containing executable code and constants, constant or initialized data (global and static variables), and uninitialized data. (Default is off if this option is not included on the command line. Default is on if this option is used with no value specified.) Section 3.7.1
--set_error_limit=num -pdel Sets the error limit to num. The compiler abandons compiling after this number of errors. (The default is 100.) Section 3.7.1
--super_quiet -qq Super quiet mode. --
--tool_version -version Displays version number for each tool. --
--verbose Display banner and function progress information. --
--verbose_diagnostics -pdv Provides verbose diagnostic messages that display the original source with line-wrap. Note that this command-line option cannot be used within the Code Composer Studio IDE. Section 3.7.1
--write_diagnostics_file -pdf Generates a diagnostic message information file. Compiler only option. Note that this command-line option cannot be used within the Code Composer Studio IDE. Section 3.7.1

Table 3-11 Run-Time Model Options

Option Alias Effect Section
--common={on|off} On by default. When on, uninitialized file scope variables are emitted as common symbols. When off, common symbols are not created. Section 3.3.4
--debug_software_pipeline -mw Produce verbose software pipelining report. Section 4.6.2
--disable_software_pipeline -mu Turns off software pipelining. Section 4.6.1
--fp_not_associative -mc Prevents reordering of associative floating-point operations. Section 4.13
--gen_data_subsections={on|off} Place all aggregate data (arrays, structs, and unions) into subsections. This gives the linker more control over removing unused data during the final link step. The default is on. Section 6.2.3
--gen_func_subsections={on|off} -mo Puts each function in a separate subsection in the object file. Section 6.2.2
--interrupt_threshold[=num] -mi Specifies an interrupt threshold value. Section 3.12
--mem_model:const=
    {far_aggregates|far|data}
Allows const objects to be made far independently of the --mem_model:data option. Section 8.1.4.3
--mem_model:data=
    {far_aggregates|near|far}
Determines data access model. Section 8.1.4.1
--no_bad_aliases -mt Allows certain assumptions about aliasing and loops. Section 4.12.2
Section 5.6.2
--no_compress Prevents compression. --
--no_reload_errors Turns off all reload-related loop buffer error messages. --
--printf_support={nofloat|full|
    minimal}
Enables support for smaller, limited versions of the printf function family (sprintf, fprintf, etc.) and the scanf function family (sscanf, fscanf, etc.) run-time-support functions. Section 3.3.3
--profile:breakpt Enables breakpoint-based profiling. Section 3.3.6
Section 4.17.1
--speculate_loads=n -mh Specifies speculative load byte count threshold. Allows speculative execution of loads with bounded address ranges. Section 4.6.3.1
--speculate_unknown_loads Allows speculative execution of loads with unbounded addresses. Section 3.3.4
--symdebug:dwarf_version=2|3 Specifies the DWARF format version. Section 3.3.6
--use_const_for_alias_analysis -ox Uses const to disambiguate pointers. Section 3.3.4

Table 3-12 Entry/Exit Hook Options

Option Alias Effect Section
--entry_hook[=name] Enables entry hooks. Section 3.16
--entry_parm={none|name|
    address}
Specifies the parameters to the function to the --entry_hook option. Section 3.16
--exit_hook[=name] Enables exit hooks. Section 3.16
--exit_parm={none|name|address} Specifies the parameters to the function to the --exit_hook option. Section 3.16
--remove_hooks_when_inlining Removes entry/exit hooks for auto-inlined functions. Section 3.16

Table 3-13 Feedback Options

Option Alias Effect Section
--analyze={codecov|callgraph} Generate analysis info from profile data. Section 4.11.4.2
--analyze_only Only generate analysis. Section 4.11.4.2
--gen_profile_info Generates instrumentation code to collect profile information. Section 4.10.1.3
--use_profile_info=file1[, file2,...] Specifies the profile information file(s). Section 4.10.1.3

Table 3-14 Assembler Options

Option Alias Effect Section
--keep_asm -k Keeps the assembly language (.asm) file. Section 3.3.12
--asm_listing -al Generates an assembly listing file. Section 3.3.12
--c_src_interlist -ss Interlists C source and assembly statements. Section 3.13
Section 4.16
--src_interlist -s Interlists optimizer comments (if available) and assembly source statements; otherwise interlists C and assembly source statements. Section 3.3.2
--asm_define=name[=def] -ad Sets the name symbol. Section 3.3.12
--asm_dependency -apd Performs preprocessing; lists only assembly dependencies. Section 3.3.12
--asm_includes -api Performs preprocessing; lists only included #include files. Section 3.3.12
--asm_undefine=name -au Undefines the predefined constant name. Section 3.3.12
--asm_listing_cross_reference -ax Generates the cross-reference file. Section 3.3.12
--include_file=filename -ahi Includes the specified file for the assembly module. Section 3.3.12
--no_const_clink Stops generation of .clink directives for const global arrays. Section 3.3.3
--strip_coff_underscore Aids in transitioning hand-coded assembly from COFF to EABI. Section 3.3.12

Table 3-15 File Type Specifier Options

Option Alias Effect Section
--ap_file=filename -fl Identifies filename as a linear assembly source file regardless of its extension. By default, the compiler and assembly optimizer treat .sa files as linear assembly source files. Section 3.3.8
--asm_file=filename -fa Identifies filename as an assembly source file regardless of its extension. By default, the compiler and assembler treat .asm files as assembly source files. Section 3.3.8
--c_file=filename -fc Identifies filename as a C source file regardless of its extension. By default, the compiler treats .c files as C source files. Section 3.3.8
--cpp_file=filename -fp Identifies filename as a C++ file, regardless of its extension. By default, the compiler treats .C, .cpp, .cc and .cxx files as a C++ files. Section 3.3.8
--obj_file=filename -fo Identifies filename as an object code file regardless of its extension. By default, the compiler and linker treat .obj files as object code files. Section 3.3.8

Table 3-16 Directory Specifier Options

Option Alias Effect Section
--asm_directory=directory -fs Specifies an assembly file directory. By default, the compiler uses the current directory. Section 3.3.11
--list_directory=directory -ff Specifies an assembly listing file and cross-reference listing file directory By default, the compiler uses the .obj directory. Section 3.3.11
--obj_directory=directory -fr Specifies an object file directory. By default, the compiler uses the current directory. Section 3.3.11
--output_file=filename -fe Specifies a compilation output file name; can override --obj_directory. Section 3.3.11
--pp_directory=dir Specifies a preprocessor file directory. By default, the compiler uses the current directory. Section 3.3.11
--temp_directory=directory -ft Specifies a temporary file directory. By default, the compiler uses the current directory. Section 3.3.11

Table 3-17 Default File Extensions Options

Option Alias Effect Section
--ap_extension=[.]extension -el Sets a default extension for linear assembly source files. Section 3.3.10
--asm_extension=[.]extension -ea Sets a default extension for assembly source files.

Section 3.3.10
--c_extension=[.]extension -ec Sets a default extension for C source files. Section 3.3.10
--cpp_extension=[.]extension -ep Sets a default extension for C++ source files. Section 3.3.10
--listing_extension=[.]extension -es Sets a default extension for listing files. Section 3.3.10
--obj_extension=[.]extension -eo Sets a default extension for object files. Section 3.3.10

Table 3-18 Dynamic Linking Support Compiler Options

Option Alias Description
--dprel Specifies that all non-const data is addressed using DP-relative addressing. Section 8.1.4.2
--dsbt Generates addressing via Dynamic Segment Base Table. Section 3.3.13
--export_all_cpp_vtbl Exports C++ virtual tables by default. Section 3.3.13
--import_helper_functions Treats compiler helper functions as imported references. Section 3.3.13
--import_undef[={off|on}] Imports all undefined symbols. Default is on. Section 3.3.13
--inline_plt[={off|on}] Inlines the import function call stub. Default is on. Section 3.3.13
--linux Generates code for Linux. Section 3.3.13
--pic[={near|far}] Generates position independent addressing for a shared object. Default is near. Section 3.3.13
--visibility={hidden|fhidden|default|
    protected}
Specifies visibility of global symbols. Section 3.3.13

Table 3-19 Command Files Options

Option Alias Effect Section
--cmd_file=filename -@ Interprets contents of a file as an extension to the command line. Multiple -@ instances can be used. Section 3.3.2

Table 3-20 MISRA-C 2004 Options

Option Alias Effect Section
--check_misra[={all|required|
    advisory|none|rulespec}]
Enables checking of the specified MISRA-C:2004 rules. Default is all. Section 3.3.3
--misra_advisory={error|warning|
    remark|suppress}
Sets the diagnostic severity for advisory MISRA-C:2004 rules. Section 3.3.3
--misra_required={error|warning|
    remark|suppress}
Sets the diagnostic severity for required MISRA-C:2004 rules. Section 3.3.3

Table 3-21 Performance Advisor Options

Option Alias Effect Section
--advice:performance[={all|none}] Generates compiler optimization advice. Default is all. Section 3.14
--advice:performance_file={stdout|
    stderr|user_specified_filename}
Specifies that advice be written to stdout, stderr, or a file. Section 3.14
--advice:performance_dir=
    {user_specified_directory_name}
Specifies that advice file be created in the named directory. Section 3.14