Microsoft KB Archive/59422

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

Article ID: 59422

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.0

-



This article was previously published under Q59422



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.



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: kbbug kbfix KB59422

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.