FIX: DO Loop/Computed GOTO Errors with /Ox and /4YbLast reviewed: September 16, 1997Article ID: Q108461 |
1.00
WINDOWS NT
kbtool kbfixlist
The information in this article applies to:
SYMPTOMSDO loops may not function properly when compiled with both optimization for time (/Ox) and extended error handling (/4Yb or $DEBUG). A similar problem exists using computed GOTO statements.
RESOLUTIONDo not compile with /Ox and /4Yb at the same time. Use the Visual Workbench debugger to track down run-time errors that occur when using /Ox.
STATUSMicrosoft has confirmed this to be a problem in Microsoft FORTRAN PowerStation 32 for Windows NT, version 1.0. This problem was fixed in FORTRAN PowerStation, version 4.0.
MORE INFORMATIONThe following code illustrates the DO loop problem when compiling with /Ox and /4Yb:
Sample Code #1c FORTRAN Compile options needed: /Ox /4Yb ieof = 0 DO i = 1, 4 IF ( i .EQ. 4 ) ieof = 999 i1 = i + 1 WRITE (*,1000) i, i1, ieof ENDDO1000 FORMAT (3i6) END OutputExpected results:
1 2 0 2 3 0 3 4 0 4 5 999Results with -Ox -4Yb:
1 2 0 1 2 0 2 3 0 3 4 0The sample program below executes in an infinite loop when compiling with /Ox and /4Yb:
Sample Code #2c FORTRAN Compile options needed: /Ox /4Yb J = 0 1 CONTINUE WRITE(*,*) 'Label 1' WRITE(*,*) 'J = ', J J = J + 1 IF (J.EQ.2) THEN K = 1 ELSE K = 1 ENDIF WRITE(*,*) 'J = ', J GOTO(1,2), J ! Computed GOTO always branches to label 1 2 CONTINUE WRITE(*,*) 'Label 2' END |
Additional reference words: 1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |