CHECK_OVERFLOW Directive [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
CHECK_OVERFLOW Directive
The CHECK_OVERFLOW directive generates code that traps when an overflow
occurs in integer arithmetic.
You can use CHECK_OVERFLOW with the ON statement to make your program
branch to a trap subroutine. If this directive is not used, the ON
statement will have no effect on integer overflow errors.
Syntax
{INTEGER_2}
$CHECK_OVERFLOW {INTEGER_4} [ON ]
{INTEGER } [OFF]
INTEGER_2 turns on code generation to catch INTEGER*2 overflows.
INTEGER_4 turns on code generation to catch INTEGER*4 overflows.
INTEGER turns on code generation to catch both INTEGER*2 and
INTEGER*4 overflows.
Default INTEGER; trap code for overflows in integer
arithmetic is not generated.
For MPE V compatibility, the default is the same as
if INTEGER has been specified. Therefore, to
increase the performance of your program, specify
$CHECK_OVERFLOW INTEGER OFF to suppress the
additional code generated to perform the checking.
Location This directive can appear anywhere in your program.
Toggling/ Duration Applies to all routines subsequent to its
appearance. May be toggled.
Impact on The overhead for turning on INTEGER*2 checking is
Performance significant. Several extra instructions are
generated for each INTEGER*2 operation. The
overhead associated with INTEGER*4 checking is
insignificant.
MPE/iX 5.0 Documentation