FIX: FORTRAN 5.0 Loop Optimization, Subroutine, & Array Problem

ID: Q59422


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, version 5.0
  • Microsoft FORTRAN for OS/2, version 5.0


SYMPTOMS

In FORTRAN version 5.0, the loop optimizer does not correctly optimize the subroutine MOVE in the code below, producing incorrect output.


RESOLUTION

Compiling with /Od or /Odt resolves the problem.


STATUS

Microsoft has confirmed this to be a problem in FORTRAN version 5.0. This problem was corrected in FORTRAN version 5.1.


MORE INFORMATION

Sample Code


       integer*2 buf(20)
      do 10 i=1,10
10    buf(i) = 9

      call move(10,buf(11),buf)

      write(*,'(10(i8))') (buf(i),i=1,20)
      end

      Subroutine move(npts, y1, y2)
      integer*2 y1(*), y2(*)
      do 10 i=1,npts
        y2(i) = y1(i)
10    continue
      return
      end 
The following is the correct output:

    0     0     0     0     0     0     0     0     0     0
    0     0     0     0     0     0     0     0     0     0 
The following is the incorrect output:

    0     0     0     0 21325 21024 28277 21549 28009  8293
    0     0     0     0     0     0     0     0     0     0 

Additional query words: bad bogus wrong invalid buglist5.00 fixlist5.10

Keywords :
Version : :5.0
Platform :
Issue type :


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