Microsoft KB Archive/74898

= FIX: Duplicate Lines Incorrectly Removed by Optimizer =

Article ID: 74898

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1

-



This article was previously published under Q74898



SYMPTOMS
The sample code below produces correct output when optimization is disabled, but not with default optimization. The optimizer incorrectly removes the two lines noted below.

The expected output is:   100         1         244           8 The output with default optimization is:   0           0         244           8



STATUS
Microsoft has confirmed this to be a bug in the products listed above. This problem was corrected in FORTRAN PowerStation, version 1.0.



MORE INFORMATION
The following code can be used to demonstrate the problem.

Sample Code
INTEGER*2 IBBYTE(2),MINVAL,MAXVAL,IVAL CHARACTER*1 CBYTE(4)

MINVAL=100 MAXVAL=100 MINVAL=MIN(MINVAL,500) MAXVAL=MAX(MAXVAL,500) IBBYTE(1)=MOD(REAL(MINVAL),256.0) !this line is optimized out IBBYTE(2)=MINVAL/56               !this line is optimized out CBYTE(1)=CHAR(IBBYTE(1)) CBYTE(2)=CHAR(IBBYTE(2)) IBBYTE(1)=MOD(REAL(MAXVAL),256.0) IBBYTE(2)=MAXVAL/56 CBYTE(3)=CHAR(IBBYTE(1)) CBYTE(4)=CHAR(IBBYTE(2)) WRITE(*,*) (ICHAR(CBYTE(N)),N=1,4) STOP END

Additional query words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00

Keywords: kbfix KB74898

-

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

© Microsoft Corporation. All rights reserved.