FIX: F1001: ../../../P2/grammar.c, line 91; Optimization (68187)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1

This article was previously published under Q68187

SYMPTOMS

The code causes FORTRAN, version 5.0 to produce
fatal error F1001: Internal Compiler Error
(compiler file '../../../P2/grammar.c', line 91)
With FORTRAN 5.1, the error produced during pass 2 is:
run-time Error R6000
- Stack Overflow

RESOLUTION

The examples that we have seen are relatively large modules of code. Most of the examples have large COMMON blocks, multiple CALL statements, or DO loops. Simplifying the modules can eliminate the error. Disabling optimization with /Od or using /4Yb can also eliminate the error.

STATUS

Microsoft has confirmed this to be a bug in the products listed above. This problem was corrected in FORTRAN PowerStation for MS-DOS, version 1.0 and FORTRAN PowerStation for Windows NT, version 1.0.

MORE INFORMATION

The program below will produce the F1001 error with 5.00 and the R6000 error with 5.10. Compiling with /Od or /4Yb removes the error:

Sample Code

C Compile options needed: none

      dimension array(3,3)

      array = 1.0
      CALL invers(array)
      END

      SUBROUTINE invers(ti)
      DIMENSION ti(3,3), a(3,6)
      DATA a /1.0,2.0,3.0,
     +4.0,5.0,6.0,
     +7.0,8.0,9.0,
     +10.0,11.0,12.0,
     +13.0,14.0,15.0,
     +16.0,17.0,18.0 / 

      WRITE (*,*) 'a=',a
      I = 3
      DO 8 II=1,I
        DO 8 JJ=1,I
        KIL = JJ+I
        TI(II,JJ) = A(II,KIL)
    8   CONTINUE
      WRITE (*,*) 'ti=',ti
      END
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:kbfix KB68187