BUG: Endless Loop in Code Containing Graphics & Compiled -Ox

Last reviewed: July 12, 1995
Article ID: Q104776
The information in this article applies to:
  • Microsoft FORTRAN PowerStation for MS-DOS, version 1.0 and 1.0a

SYMPTOMS

A program may execute in an infinite loop if it was compiled with full optimization (-Ox) and contains a do loop calling some of the graphics routines [such as POLYGON_W()].

CAUSE

Some of the graphics functions (such as POLYGON_W) prevent optimized code from recognizing the end condition for the loop.

STATUS

Microsoft has confirmed this to be a problem in FORTRAN PowerStation for MS-DOS, version 1.0 and 1.0a.

This problems does not apply to FORTRAN PowerStation 32.

RESOLUTION

Compile the program with no optimization (this is the default).

Sample Code

c Compile options needed:    -Ox
c The following program will output in an infinite loop:

      include 'fgraph.fi'
      include 'fgraph.fd'
      INTEGER*2  status, npts

      RECORD     / wxycoord /  wxyarr(3)

      status = setvideomode(18)
      do it=1,2
         write (*,'(i4\)') it
         wxyarr(1).wx = 43.d0
         wxyarr(1).wy = 85.d0
         wxyarr(2).wx = 50.d0
         wxyarr(2).wy = 71.d0
         wxyarr(3).wx = 45.d0
         wxyarr(3).wy = 85.d0
         npts = 3
         status = POLYGON_W($GBORDER, wxyarr, npts)
      enddo
      END


Additional reference words: 1.00
KBCategory: kbprg kbbuglist kbcode
KBSubcategory: FORTLngIss


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: July 12, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.