FIX: Application Evaluates Array Expression Incorrectly (33309)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 4.0
- Microsoft FORTRAN Compiler for MS-DOS 4.01
- Microsoft FORTRAN Compiler for MS-DOS 4.1
- Microsoft FORTRAN Compiler for MS-DOS 5.0
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 4.1
- Microsoft FORTRAN compiler for OS/2 5.0
- Microsoft FORTRAN compiler for OS/2 5.1
This article was previously published under Q33309 SYMPTOMS
An application that assigns an expression to an array element produces
incorrect results.
CAUSE
The application uses the READ statement to enter the array element index.
The optimizer in the code generator performs common subexpression
elimination and generates incorrect code for the array expression.
RESOLUTION
To work around this problem, perform one of the following two steps:
- Specify the -Odlt compiler option switch to disable the common
subexpression elimination optimization.
- Store the array index in a temporary variable and specify the
variable as the array index in the expression.
STATUS
Microsoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.01,
4.1, 5.0, and 5.1 for MS-DOS and 4.1, 5.0, and 5.1 for OS/2. This problem
was corrected in FORTRAN PowerStation, version 1.0.
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbfix KB33309 |
---|
|