Option Type | Default Value | #pragma options | C | C++ |
-qoption | nostrict | STRICT | x | x |
Syntax
-qstrict | -qnostrict STRICT | NOSTRICT
Purpose
Turns off aggressive optimizations that have the potential to alter the semantics of
your program.
Notes
-qnostrict has no effect at -O
optimization level 0.
-qstrict turns off the following optimizations:
Unless explicitly set otherwise by the -qfloat option:
You can use -qfloat=fltint and -qfloat=rsqrt to override the -qstrict settings.
For example:
Defaults
Default setting for the strict option varies according to -O optimization level in effect:
Optimization
levelDefault setting for
strict option
0 -qstrict 2 -qstrict 3 -qnostrict 4 -qnostrict
You can override the default settings by explicitly setting either -qstrict or -qnostrict. In the example below, -qstrict is active regardless of the -O3 optimization level selected.
xlc myprogram.c -O3 -qstrict -qfloat=fltint:rsqrt
Example
To compile myprogram.c so that the aggressive optimizations of -O3
are turned off, range checking is turned off (-qfloat=fltint),
and division by the result of a square root is replaced by multiplying by the reciprocal (-qfloat=rsqrt),
enter:
xlc myprogram.c -O3 -qstrict -qfloat=fltint:rsqrt
List of Compiler Options and Their Defaults
strict_induction compiler option