STRICT_INDUCTION | NOSTRICT_INDUCTION

Category

Optimization and tuning

Pragma equivalent

None.

Purpose

Prevents the compiler from performing induction (loop counter) variable optimizations. These optimizations may be unsafe (may alter the semantics of your program) when there are integer overflow operations involving the induction variables.

When the STRICT_INDUCTION option is in effect, the compiler disables loop induction variable optimizations.

When the NOSTRICT_INDUCTION compiler option is in effect, the compiler permits loop induction variable optimizations.

Syntax

Read syntax diagramSkip visual syntax diagramNOSTRICT_INDUCSTRICT_INDUC

Defaults

NOSTRICT_INDUCTION

Note: The c99 compiler invocation command for a regular compile in the z/OS® UNIX System Services environment uses STRICT_INDUCTION as the default option.

Usage

Loop induction variable optimizations can change the result of a program if truncation or sign extension of a loop induction variable occurs as a result of variable overflow or wrap-around.

The STRICT_INDUCTION option only affects loops which have an induction (loop counter) variable declared as a different size than a register. Unless you intend such variables to overflow or wrap-around, use NOSTRICT_INDUCTION.

The usage status of this option is inserted in the object file to aid you in diagnosing a problem with your program.

IPA effects

If you specify the STRICT_INDUCTION option for any compilation unit in the IPA compile step, the compiler generates information for the IPA link step. This option also affects the regular object module if you request one by specifying the IPA(OBJECT) option.

The IPA link step merges and optimizes your application’s code, and then divides it into sections for code generation. Each of these sections is a partition. The IPA link step uses information from the IPA compile step to ensure that an object is included in a compatible partition.

The compiler sets the value of the STRICT_INDUCTION option for a partition to the value of the first subprogram that is placed in the partition. During IPA inlining, subprograms with different STRICT_INDUCTION settings may be combined in the same partition. When this occurs, the resulting partition is always set to STRICT_INDUCTION.

You can override the setting of STRICT_INDUCTION by specifying the option on the IPA link step. If you do so, all partitions will contain that value, and the prolog section of the IPA link step listing will display the value.

Predefined macros

None.