ID Number: Q73508
6.00a 6.00ax | 6.00a
MS-DOS | OS/2
buglist6.00a buglist6.00ax fixlist7.00
Summary:
The Microsoft C Compiler versions 6.0a and 6.0ax produce the following
internal compiler error when the sample program below is compiled with
the _fastcall calling convention (/Gr):
file.c(21) : fatal error C1001: Internal Compiler Error
(compiler file '@(#)grammar.c:1.138', line 164)
Contact Microsoft Product Support Services
The error occurs with all optimizations except /Od, /Oi, and /Op in
all memory models.
The following workarounds may be used to eliminate this error:
1. Compile without using the register calling convention.
-or-
2. Force the particular function displaying the problem to use either
the C (_cdecl) or Pascal (_pascal) calling convention.
-or-
3. Compile with all optimizations turned off by using the /Od compile
switch.
-or-
4. Simplify the complex expression by using temporary variables to
store intermediate values.
Microsoft has confirmed this to be a problem in C versions 6.0a and
6.0ax. This problem was corrected in C/C++ version 7.0.
Sample Code
-----------
/* Compile options needed : /Gr
*/
#include <math.h>
double visc_td (double temperature, double density)
{
double b00 = 5.01938e-1;
double b01 = 2.35622e-1;
double b02 = -2.74637e-1;
double b03 = 1.45831e-1;
double Tstar = 647.27;
double RHOstar = 317.763;
double A, B, tr, dr;
tr = Tstar / temperature;
dr = density / RHOstar;
A = tr - 1;
B = dr - 1;
return (exp (dr*(b00 + B*(b01 + B*(b02 + B*b03))))
* 1e-6 / sqrt (tr));
}