Microsoft KB Archive/73392

= FIX: Optimization Problem, $STORAGE:2 and Multiplication =

Article ID: 73392

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1

-



This article was previously published under Q73392



SYMPTOMS
The sample code below produces the output: 6    0 instead of the expected output 6    1280



RESOLUTION
Use one of the following to work around the problem in the sample code:


 * 1) Disable optimization by compiling with /Od -or-


 * 1) Delete $storage:2 so that the default $storage:4 is used -or-


 * 1) Assign the result of (iy - 1) in line 10 to a temporary variable and use the temporary variable in line 20.



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 sample code can be used to demonstrate the problem.

Sample code
$storage:2 call subs(6, 1) end

subroutine subs(iy, ipage) integer bx, dx, tmp 10    bx = (ipage - 1) * 256 20    dx = (iy - 1) * 256 write (*, *) iy, dx      return end

Additional query words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00

Keywords: kbfix KB73392

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.