BUG: F1001: Code.c, Line 428, Arrays of Structures (86070)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 5.1
This article was previously published under Q86070 SYMPTOMS
Using 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.
CAUSE
This 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.
RESOLUTION
The following are several different solutions to this problem:
- Compile with /Odtl to suppress optimization for common sub-expression
elimination.
-or-
- Avoid the use of INTEGER*1 variables as array subscripts.
-or-
- Initialize the member(s) of the structure prior to its use in an output
statement. Sample code #2 demonstrates this last solution.
-or-
- Eliminate /MW from the command line. When compiling a QuickWin program,
/MW (without a number it defaults to /MW1) is placing calls to the
YIELDQQ() function before going into DO-loops. However, the programmer
can manually insert these calls; therefore, compiling without a /MW
switch is equivalent to to /MW0 [no YIELDQQ() call inserted] and the
problem is eliminated because the /G2 option is not invoked.
STATUS
Microsoft has confirmed this to be a problem in FORTRAN version 5.1.
This is not a problem with FORTRAN PowerStation.
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | KB86070 |
---|
|