Miscellaneous Useful Options

Following are detailed descriptions of miscellaneous options:

--advice:performance[=all|none] When Trigonometric Math Unit (TMU) support is enabled (--tmu_support) and --fp_mode=strict, advice will be generated if the compiler encounters function calls that could be replaced with TMU hardware instructions under --fp_mode=relaxed. These include floating point division, sqrt, sin, cos, atan, and atan2.

In addition, when compiling for EABI with --float_support=fpu32, enabling this option causes advice to be provided if double floating point operations are detected. Since EABI doubles are 64 bits, you should consider changing doubles to floats for improved performance in FPU32-mode.

--check_misra={all|required|
    advisory|none|rulespec}
Displays the specified amount or type of MISRA-C documentation. This option must be used if you want to enable use of the CHECK_MISRA and RESET_MISRA pragmas within the source code. The rulespec parameter is a comma-separated list of specifiers. See Section 6.3 for details.
--float_operations_allowed= {none|all|32|64} Restricts the type of floating point operations allowed in the application. The default is all. If set to none, 32, or 64, the application is checked for operations that will be performed at runtime. For example, if --float_operations_allowed=32 is specified on the command line, the compiler issues an error if a double precision operation will be generated. This can be used to ensure that double precision operations are not accidentally introduced into an application. The checks are performed after relaxed mode optimizations have been performed, so illegal operations that are completely removed result in no diagnostic messages.
--fp_mode={relaxed|strict} The default floating-point mode is strict. To enable relaxed floating-point mode use the --fp_mode=relaxed option. Relaxed floating-point mode causes double-precision floating-point computations and storage to be converted to integers where possible. This behavior does not conform with ISO, but it results in faster code, with some loss in accuracy. The following specific changes occur in relaxed mode:
  • Division by a constant is converted to inverse multiplication.
  • Certain C standard float functions--such as sqrt, sin, cos, atan, and atan2--are redirected to optimized inline functions where possible.
  • If the --tmu_support option is used to enable support for the Trigonometric Math Unit (TMU) and relaxed floating-point mode is enabled, RTS library calls are replaced with the corresponding TMU hardware instructions for the following floating-point operations: floating point division, sqrt, sin, cos, atan, and atan2. Note that there are algorithmic differences between the TMU hardware instructions and the library routines, so the results of operations may differ slightly.
  • Additionally, if the --tmu_support=tmu1 option is used with --fp_mode=relaxed, special "relaxed" versions of the following 32-bit RTS math functions are used: exp2f(), expf(), log2f(), logf(), and powf(). Note that relaxed versions that work with double types are not provided.
--fp_reassoc={on|off} Enables or disables the reassociation of floating-point arithmetic. The default value is --fp_reassoc=on.

Because floating-point values are of limited precision, and because floating-point operations round, floating-point arithmetic is neither associative nor distributive. For instance, (1 + 3e100) - 3e100 is not equal to 1 + (3e100 - 3e100). If strictly following IEEE 754, the compiler cannot, in general, reassociate floating-point operations. Using --fp_reassoc=on allows the compiler to perform the algebraic reassociation, at the cost of a small amount of precision for some operations.

When --fp_reassoc=on, RPT MACF32 instructions may be generated. Because the RPT MACF32 instruction computes two partial sums and adds them together afterward to compute the entire accumulation, the result can vary in precision from a serial floating-point multiply accumulate loop.

--misra_advisory={error|
    warning|remark|suppress}
Sets the diagnostic severity for advisory MISRA-C:2004 rules.
--misra_required={error|
    warning|remark|suppress}
Sets the diagnostic severity for required MISRA-C:2004 rules.
--preinclude=filename Includes the source code of filename at the beginning of the compilation. This can be used to establish standard macro definitions. The filename is searched for in the directories on the include search list. The files are processed in the order in which they were specified.
--printf_support={full|
    nofloat|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. The valid values are:
  • full: Supports all format specifiers. This is the default.
  • nofloat: Excludes support for printing and scanning floating-point values. Supports all format specifiers except %a, %A, %f, %F, %g, %G, %e, and %E.
  • minimal: Supports the printing and scanning of integer, char, or string values without width or precision flags. Specifically, only the %%, %d, %o, %c, %s, and %x format specifiers are supported

There is no run-time error checking to detect if a format specifier is used for which support is not included. The --printf_support option precedes the --run_linker option, and must be used when performing the final link.

--sat_reassoc={on|off} Enables or disables the reassociation of saturating arithmetic.