FIX: Combining -4Yb with -Ox May Cause Invalid Run-Time Errors

Last reviewed: September 18, 1997
Article ID: Q110002
1.00 1.00a | 1.00
MS-DOS     | WINDOWS NT
kbtool kbfixlist

The information in this article applies to:

  • Microsoft FORTRAN PowerStation for MS-DOS, version 1.0 and 1.0a
  • Microsoft FORTRAN PowerStation 32 for Windows NT, version 1.0

SYMPTOMS

On some rare boundary cases, using optimizations (-Ox) with extended error handling ($DEBUG or -4Yb) can cause invalid run-time errors to be output, such as:

   run-time error F6096: $DEBUG
   - array subscript expression out of range

RESOLUTION

If you have determined that a run-time error such as the above is not correct for the code indicated, you can prevent your program from terminating with the error. To do this, place a $NODEBUG metacommand before the line of code that is being flagged, and place a $DEBUG metacommand after it.

STATUS

Microsoft has confirmed this to be a problem in FORTRAN PowerStation 32 for Windows NT and MS-DOS, version 1.0 and 1.0A. This problem was corrected in FORTRAN PowerStation 32, version 4.0.

MORE INFORMATION

The sample below illustrates the problem:

Sample Code

c Compile options required: -Ox -4Yb c

      CHARACTER CA(512),CB(512),CC(512)
      OPEN(7,FILE='N117.TMP',FORM='UNFORMATTED',RECL=128,
     +     ACCESS='DIRECT')
      DO 10 I=1,512
        CA(I)=CHAR(48)
10 CONTINUE
      DO 20 I=1,16
        WRITE(7,REC=I) (CA(J),J=(I-1)*32+1,(I-1)*32+32)
c The F6096 error incorrectly occurs on the following line.
        WRITE(7,REC=16+I) (CA(J),J=(16-I)*32+32,(16-I)*32+1,-1)
20 CONTINUE
      DO 30 I=1,16
        IE1=(16-I)*32+32
        IE2=(16-I)*32+1
        READ(7,REC=I+16) (CC(J),J=IE1,IE2,-1)
30 CONTINUE
      IE=1
      DO 40 I=1,512
        IF(CA(I).NE.CB(I).OR.CA(I).NE.CC(I)) IE=0
40 CONTINUE
      END


Additional reference words: 1.00
KBCategory: kbtool kbbuglist kbfixlist
KBSubcategory: FL32Iss
Keywords : FL32Iss kbbuglist kbfixlist kbtool
Version : 1.00 1.00a | 1.00
Platform : MS-DOS NT WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.