Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public
Document Table of Contents

fstrict-overflow, Qstrict-overflow

Determines whether strict overflow is enabled for signed addition, subtraction, and multiplication wrap arounds using twos-complement representation. This feature is only available for ifx.

Syntax

Linux:

-fstrict-overflow (for Clang compatibility)

-fno-strict-overflow (for Clang compatibility)

Windows:

/Qstrict-overflow

/Qstrict-overflow-

Arguments

None

Default

-fstrict-overflow or /Qstrict-overflow

Strict overflow is enabled for signed arithmetic overflow of addition, subtraction, and multiplication wrap arounds using twos-complement representation.

Description

This option determines whether strict overflow is enabled for signed addition, subtraction, and multiplication wrap arounds using twos-complement representation.

Integer overflow occurs when an operation on two integer values results in a value that is too large to be represented in an integer of the size specified; for example, two 32-bit integers added together result in a value that does not fit into 32 bits.

When overflow occurs, as much of the value as can fit into the result is assigned, usually resulting in a negative number.

When -fstrict-overflow (Linux) or /Qstrict-overflow (Windows) is in effect, the compiler assumes that integer operations can never overflow . This can provide better optimizations. However, if overflow does occur, the resulting behavior is undefined.

If your program relies on integer overflow to work, specify -fno-strict-overflow (Linux) or /Qstrict-overflow- (Windows). This permits overflow but may produce less optimized code.

NOTE:

This option only applies to host compilation. When offloading is enabled, it does not impact device-specific compilation.

IDE Equivalent

None

Alternate Options

None

Example

The following shows an example of using this option::

ifx /Qstrict-overflow- rnflow.f90