FIX: F6099 Integer Overflow with /4I2 and /4Yb (87884)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 4.0
  • Microsoft FORTRAN Compiler for MS-DOS 4.01
  • Microsoft FORTRAN Compiler for MS-DOS 4.1
  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 4.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1

This article was previously published under Q87884

SYMPTOMS

Programs compiled with the metacommands $STORAGE:2 (or the /4I2 option) and $DEBUG (or the /4Yb option) in Microsoft FORTRAN version 4.0, 4.01, 4.1, 5.0 or 5.1 under MS-DOS or version 4.1, 5.0 and 5.1 under OS/2 may incorrectly generate the following error:
Run-Time Error F6099: $DEBUG
INTEGER overflow

CAUSE

The code must contain an assignment to an array where the array index is greater than 32768. The $STORAGE:2 (/4I2 option) and $DEBUG metacommands (/4Yb option) cause the compiler to generate incorrect assembly code leading to a jump to the overflow error output routine.

RESOLUTION

To avoid this error, compile without either the $STORAGE:2 (/4I2 option) or the $DEBUG metacommand (/4Yb option).

STATUS

Microsoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.01, 4.1, 5.0 and 5.1. This problem was corrected in FORTRAN PowerStation, version 1.0.

MORE INFORMATION

The following code reproduces the problem:

Sample Code

$debug
$storage:2

      integer*4 i
      integer*1 ar(32768)

      i=32768
      ar(i)=1
      end
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:kbfix KB87884