2.8. Optimization (General)

The following sections describe general optimization options.

2.8.1. -O [level] (CC, cc, c89 Commands)

Default option: 

Equivalent to the appropriate -h option

The -O level option specifies the optimization level for a group of compiler features. Specifying -O with no arguments is the same as not specifying the -O option. A value of 0, 1, 2, or 3 sets that level of optimization for the -h inline, -h scalar, -h task, and -h vector options.

For example, -O2 is equivalent to the following:

-h inline2,scalar2,task2,vector2

Optimization features specified by -O are equivalent to the following -h options (taskn is ignored on UNICOS/mk systems):

Table 2-1. -h option descriptions

-h option

Description location

-h inlinen

Section 2.12.1

-h scalarn

Section 2.13.2

-h taskn

Section 2.11.1

-h vectorn

Section 2.10.2

2.8.2. -h [no]aggress (CC, cc Commands)

Default option: 

-h noaggress

The -h aggress option provides greater opportunity to optimize loops that would otherwise by inhibited from optimization due to an internal compiler size limitation. -h noaggress leaves this size limitation in effect.

With -h aggress, internal compiler tables are expanded to accommodate larger loop bodies. This option can increase the compilation's time and memory size. On UNICOS systems, this option also disables the limit on the number of vector updates in a single loop. On UNICOS/mk systems, this option enables the compiler to aggressively assign registers and schedule instructions.

2.8.3. -h [no]intrinsics (CC, cc Commands)

Default option: 

-h intrinsics

The -h intrinsics option allows the use of intrinsic hardware functions, which allow direct access to some Cray Research hardware instructions or generate inline code for some functions. This option has no effect on specially-handled library functions.

Intrinsic functions are described in Appendix D.

2.8.4. -h [no]pattern (CC, cc Commands)

Default option: 

-h pattern

The -h [no]pattern option globally enables or disables pattern matching. Pattern matching is on by default, but takes effect only when -h vector2 or -h scalar2 or greater are specified.

2.8.5. -h [no]overindex (CC, cc Commands)

Default option: 

-h nooverindex

The -h overindex option declares that there are array subscripts that index a dimension of an array that is outside the declared bounds of that array. The -h nooverindex option declares that there are no array subscripts that index a dimension of an array that is outside the declared bounds of that array.