FIX: F1001: regMD.c:1.8, Line 338; REAL Arg, /FPc, /FPa (73570)



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 Q73570

SYMPTOMS

Compiling a program with the /FPc, /FPa, or /FPc87 option that uses a real formal argument and another numeric formal argument to index an array in an assignment statement may cause the compiler to issue the error:
filename(line#) : fatal error F1001: Internal Compiler Error
(compiler file '@(#)regMD.c:1.8', line 338)
Contact Microsoft Technical Support

RESOLUTION

One solution is to assign the real formal argument to a temporary variable and to use the temporary variable as the array index. The error also does not occur is the program is compiled with both /4Yb and /Od.

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 program will cause the F1001 compiler error:

Sample code

       SUBROUTINE Test(RealArgument,Argument)

      INTEGER ArrayVariable (2,1)
      REAL RealArgument
      INTEGER Argument

c  In the following line, the order of the arguments is not
c  significant.  The compiler will also fail if another variable is
c  assigned to ArrayVariable but will not fail if ArrayVariable is
c  used in a CALL statement.

      ArrayVariable( Argument, RealArgument) = 0

      END
				
The following program illustrates the suggested workaround:

Sample code

       SUBROUTINE Test(RealArgument,Argument)

        INTEGER ArrayVariable (2,1)
        REAL RealArgument
        INTEGER Argument

        TemporaryVariable = RealArgument
        ArrayVariable( Argument, TemporaryVariable) = 0

      END
				

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