FIX: F6099 Integer Overflow with /4I2 and /4Yb

ID: Q87884


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.01, 4.1, 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, 5.1


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 

Additional query words: 4.00 4.10 5.00 5.10 buglist5.10 fixlist1.00

Keywords :
Version : :4.0,4.01,4.1,5.0,5.1
Platform :
Issue type :


Last Reviewed: November 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.