FIX: Duplicate Lines Incorrectly Removed by Optimizer

Last reviewed: September 16, 1997
Article ID: Q74898
5.00 5.10 | 5.00 5.10
MS-DOS    | OS/2
kbtool kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, versions 5.0 and 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0 and 5.1

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 reference words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00
KBCategory: kbtool kbfixlist kbbuglist
KBSubCategory: FLIss
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.