Everything
2.5.1 Compile options

This section explains options for the compile phase.

 

Caution about options are shown below.

-

Uppercase characters and lowercase characters are distinguished for options.

-

When numerical values are specified as parameters, decimal or hexadecimal numbers which starts with "0x" ("0X") can be specified.
Uppercase characters and lowercase characters are not distinguished for the alphabet of hexadecimal numbers.

-

When a file name is specified as a parameter, it can include the path (absolute path or relative path).
When a file name without the path or a relative path is specified, the reference point of the path is the current folder.

-

When a parameter includes a space (such as a path name), enclose the parameter in a pair of double quotation marks (").

 

The types and explanations for options are shown below.

Table 2.2

Compile Options

Classification

Option

Description

Version/help display specification

-V

This option displays the version information of ccrh.

-h

This option displays the descriptions of ccrh options.

Output file specification

-o

This option specifies the output file name.

-Xobj_path

This option specifies the folder to save an object file generated during compilation.

-Xasm_path

This option specifies the folder to save an assembly source file generated during compilation.

-Xprep_path

This option specifies the folder to save the preprocessed file.

Source debugging control

-g

This option outputs information for source debugging.

-g_line [V1.05.00 or later]

This option enhances information for source debugging at optimization.

Device specification

-Xcommon

This option specifies that an object file common to the various devices is generated.

-Xcpu

This option specifies that an object for the specified core is generated.

Processing interrupt specification

-P

This option executes only preprocess processing for the input file.

-S

This option does not execute processing after assembling.

-c

This option does not execute processing after linking.

Preprocessor control

-D

This option defines preprocessor macros and assembler symbols.

-U

This option deletes the definition of the preprocessor macro or assembler symbol by the -D option.

-I

This option specifies the folder to search include files.

-Xpreinclude

This option specifies the file that is included at the top of the compilation unit.

-Xpreprocess

This option controls outputting the result of preprocessing.

C language control

-lang [V1.07.00 or later]

This option specifies the language standard.

-strict_std [V1.07.00 or later]

This option processes the C source program in strict accordance with the language standard.

-Xenum_type

This option specifies which integer type the enumeration type handles.

-Xvolatile

This option specifies external variables as volatile.

-Xcheck

This option checks the compatibility of a C source file.

-Xmisra2004 [Professional Edition only]

This option checks source code against the MISRA-C: 2004 rules.

-Xmisra2012 [Professional Edition only]

This option checks source code against the MISRA-C: 2012 rules.

-Xignore_files_misra [Professional Edition only]

This option specifies files that will not be checked against the MISRA-C: 2004 rules or MISRA-C: 2012 rules.

-Xcheck_language_extension [Professional Edition only]

This option enables the source-code checking of the MISRA-C: 2004 rules or MISRA-C: 2012 rules, which are partially suppressed by the extended language specifications.

-misra_intermodule [Professional Edition only] [V2.01.00 or later]

This option checks source code in multiple files against the MISRA-C:2012 rules.

-Xuse_fp16 [Professional Edition only] [V1.05.00 or later]

This option selects the use of the half-precision floating-point type.

Japanese/Chinese character control

-Xcharacter_set

This option specifies the Japanese/Chinese character code.

Optimization specification

-O

This option specifies the optimization level or the details of each optimization items.

-Xintermodule

This option performs inter-module optimization.

-Xinline_strcpy

This option performs inline expansion of standard library functions "strcpy", "strcmp", "memcpy", and "memset" calls.

-Xmerge_string

This option merges string literals.

-Xalias

This option performs optimization with consideration for the type of the data indicated by the pointer.

-Xmerge_files

This option merges two or more C source files and compiles them.

-Xwhole_program

This option performs optimization assuming that the files to be compiled comprise the entire program.

-library [V2.00.00 or later]

This option performs inline expansion for calling the standard library functions.

-goptimize [V2.01.00 or later]

This option generates information for link-time optimization.

Generated code control

-Xpack

This option performs the structure packing.

-misalign [V2.04.00 or later]

This option generates an instruction string that performs a misaligned memory access.

-Xbit_order

This option specifies the order of bit-field members.

-Xpass_source

This option outputs a C source program as a comment to the assembly source file.

-Xswitch

This option specifies a mode in which the code of a switch statement is to be output.

-Xreg_mode

This option specifies the register mode.

-Xreserve_r2

This option reserves the r2 register.

-r4 [V1.07.00 or later]

This option specifies how to handle the r4 register.

-Xep

This option specifies how to handle the ep register.

-Xfloat

This option controls generating floating-point calculation instructions.

-Xfxu [V2.00.00 or later]

This option controls usage of FXU instructions.

-Xcall_jump

This option controls generating function-call branch instructions.

-Xfar_jump

This option controls outputting far jump.

-Xdiv

This option generates the div and divu instructions for division.

-Xcheck_div_ov

This option checks the OV flag at division.

-relaxed_math [V2.00.00 or later]

This option generates a floating-point calculation code with efficiency given precedence over strictness.

-Xuse_fmaf

This option generates product-sum operation instructions.

-use_recipf [V2.00.00 or later]

This option generates the recipf instructions.

-approximate [V2.02.00 or later]

This option replaces floating-point calculations with equivalent approximate calculations.

-Xunordered_cmpf

This option detects invalid operation exceptions in floating-point comparison.

-Xmulti_level

This option specifies the generation of a multi-core program.

-Xpatch

This option applies a patch.

-Xdbl_size

This option specifies the data size of double and long double type.

-Xround

This option specifies the mode for rounding floating-point constants.

-Xalign4

This option specifies the alignment value for branch destination addresses.

-Xstack_protector/-Xstack_protector_all [Professional Edition only]

This option generates a code for detection of stack smashing.

-Xsection

This option specifies the default sections for data.

Generated code control

-stuff [V2.03.00 or later]

This option allocates variables to sections separated according to the number of alignment.

-Xcheck_exclusion_control [V1.04.00 or later]

This option enables checking of exclusive control.

-Xresbank_mode [V2.00.00 or later]

This option specifies the operating mode of the resbank instruction.

-insert_dbtag_with_label [V1.06.00 or later]

This option controls insertion of the dbtag instruction.

-store_reg [Professional Edition only] [V1.06.00 or later]

This option controls detection of writing to control registers or insertion of synchronization processing between registers.

-control_flow_integrity [Professional Edition only] [V1.07.00 or later]

This option generates code for the detection of illegal indirect function calls.

-pic [V1.07.00 or later]

This option enables the PIC facility.

-pirod [V1.07.00 or later]

This option enables the PIROD facility.

-pid [V1.07.00 or later]

This option enables the PID facility.

Information file output control

-Xcref

This option outputs the static analysis information file.

Error output control

-Xerror_file

This option outputs error messages to a file.

Warning message output control

-Xno_warning

This option suppresses outputting warning messages of the specified number.

-change_message [V1.07.00 or later]

This option changes specified warning messages into error messages.

Phase individual option specification

-Xasm_option

This option specifies assemble options.

-Xlk_option

This option specifies link options.

Subcommand file specification

@

This option specifies a subcommand file.