BUG: F1001: Code.c, Line 428, Arrays of StructuresLast reviewed: July 24, 1995Article ID: Q86070 |
The information in this article applies to:
SYMPTOMSUsing the Microsoft FORTRAN version 5.1 compiler with the /MW or /G2 option to compile code that contains an array of structures in an output statement may generate the following error:
fatal error F1001: Internal Compiler Error (compiler file '@(#)code.c:1.31', line 428)To generate the error, the array must be indexed using INTEGER*1 variables and the elements of the structure must not have been assigned values.
CAUSEThis is an optimization problem with common sub-expression elimination; compiling with /Odc and /MW generates the error but compiling with /Odtl and /MW does not. Note that the /MW option automatically invokes the /G2 option.
RESOLUTIONThe following are several different solutions to this problem:
STATUSMicrosoft has confirmed this to be a problem in FORTRAN version 5.1. This is not a problem with FORTRAN PowerStation.
MORE INFORMATIONThe following code reproduces the problem. This code must be compiled as a QuickWin program (FL /MW Sample.FOR)
Sample Code 1C Compile options needed: /MW
STRUCTURE /MyStruct/ INTEGER*2 IntNum REAL*4 RealNum END STRUCTURE RECORD /MyStruct/ MyRec(1) INTEGER*1 i i = 1 ! Initialize subscript index WRITE (*,*) MyRec(i).IntNum ! Write variable to the screen WRITE (*,*) MyRec(i).RealNum ENDThis code, compiled as a QuickWin program (FL /MW Sample.FOR), does not generate the error:
Sample Code 2C Compile options needed: /MW
STRUCTURE /MyStruct/ INTEGER*2 IntNum REAL*4 RealNum END STRUCTURE RECORD /MyStruct/ MyRec(1) INTEGER*1 i i = 1 ! Initialize subscript index MyRec(i).IntNum = 123 ! Initialize structure members MyRec(i).RealNum = 3.1415927 WRITE (*,*) MyRec(i).IntNum ! Write variable to the screen WRITE (*,*) MyRec(i).RealNum END |
Additional reference words: 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |