Compiling for strict IEEE conformance
By default, XL C/C++ follows most, but not all of the rules in the IEEE
standard. If you compile with the -qnostrict option,
which is enabled by default at optimization level -O3 or higher, some IEEE floating-point rules are violated in ways that
can improve performance but might affect program correctness. To avoid this
issue, and to compile for strict compliance with the IEEE standard, do the
following:
- Use the -qfloat=nomaf compiler option.
- If the program changes the rounding mode at run time, use the -qfloat=rrm option.
- If the data or program code contains signaling NaN values (NaNS), use
the -qfloat=nans option. (A signaling NaN is different
from a quiet NaN; you must explicitly code it into the program or data or
create it by using the -qinitauto compiler option.)
- If you compile with -O3, include the option -qstrict after it.
Related information