FIX: Unexpected Statement Reached with Loop Optimization

Last reviewed: September 16, 1997
Article ID: Q75624
5.00 5.10 | 5.00 5.10
MS-DOS    | OS/2
kbtool kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, versions 5.0 and 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0 and 5.1

SYMPTOMS

Program execution incorrectly reaches executable statements when loop optimization is enabled.

STATUS

Microsoft has confirmed this to be a problem in the products listed above. The problem was corrected in FORTRAN PowerStation, version 1.0.

MORE INFORMATION

In the following program, line number 116 is executed, when it should never be reached:

Sample code

      INTEGER*2 LOOP/5/

      WRITE (*,'(1x,I4)') LOOP

110 IF (LOOP .LE. 0) GOTO 120

C WRITE (*,'(1x,I4)') LOOP

      LOOP = LOOP - 1
      GOTO 110

116 write (*,'(1x,A,I4)') 'Beyond loop',loop

120 write (*,'(1x,I4)') loop

      end

RESOLUTION

To alleviate this problem, suppress loop optimization with the /Od or /Odct compiler options.


Additional reference words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00
KBCategory: kbtool kbfixlist kbbuglist
KBSubCategory: FLIss
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 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.