FIX: Unexpected Statement Reached with Loop Optimization

ID: Q75624


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0, 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


      I  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 query words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00

Keywords :
Version : :5.0,5.1
Platform :
Issue type :


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