FIX: FORTRAN 5.0 Loop Optimization, Subroutine, & Array ProblemLast reviewed: September 11, 1997Article ID: Q59422 |
|
5.00 | 5.00
MS-DOS | OS/2
kbtool kbfixlist kbbuglist
The information in this article applies to:
SYMPTOMSIn FORTRAN version 5.0, the loop optimizer does not correctly optimize the subroutine MOVE in the code below, producing incorrect output.
RESOLUTIONCompiling with /Od or /Odt resolves the problem.
STATUSMicrosoft 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 reference words: bad bogus wrong invalid buglist5.00 fixlist5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |