FIX: Incorrect Results from Alternate Returns and $STORAGE:2 (77557)
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 Q77557 SYMPTOMS
Microsoft FORTRAN code that uses alternate RETURNS and is compiled with
$STORAGE:2 metacommand in the called subprogram and $STORAGE:4 (the
default) in the calling routine may not return to the correct alternate
return label number. This will cause incorrect results.
CAUSE
When the $STORAGE:2 metacommand is in the separately compiled subroutine
with the alternate return, the AX register is correctly initialized with
the return code but the DX register is not correctly initialized (zeroed),
resulting in incorrect operation of the calling program. There is a CWD
(convert to double word using DX:AX) missing in the generated code for the
called subprogram. The calling routine acts on the fact that DX is not zero
and branches to the next executable statement and not the correct alternate
return label.
STATUS
Microsoft has confirmed this to be a problem in the products listed above.
This problem was corrected in FORTRAN PowerStation.
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | KB77557 |
---|
|