The information in this article applies to:
SYMPTOMSAn application that multiplies an INTEGER*2 variable by an integer constant that is a power of 2 produces incorrect results. Specifying the /4I4 compiler option switch does not have any effect on the results. Compiling the code with the /4Yb option and running the application does not provide any indication of a problem. Compiling the code with the /Od option to disable optimizations and running the application does not change the behavior. CAUSEThe compiler generates incorrect code when the result of the multiplication is larger than the range of an INTEGER*2 variable (-32,768 to 32,767). RESOLUTION
To address this problem, perform one of the following steps:
STATUSMicrosoft has confirmed this to be a problem in FORTRAN version 5.0 for MS-DOS and OS/2. This problem was corrected in FORTRAN version 5.1 for MS-DOS and OS/2. MORE INFORMATION
This error occurs when the result of the multiplication is larger than
the range of an INTEGER*2 variable (-32,768 to 32,767). The compiler
generates a shift instruction (SHL) to perform a fast multiply. The
compiler does not use a four byte work space when it performs the
shift; instead, it allocates only two bytes for its work space. Under
these circumstances, significant bits can be lost or shifted into the
sign bit when magnitude of the result of the multiplication is too
large for an INTEGER*2 variable.
Sample Code
Additional query words: 5.00 buglist5.00 fixlist5.10
Keywords : |
Last Reviewed: November 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |