BUG: C1001: Internal Compiler Error, File main.cID: Q115524
|
The use of time optimization on a source file containing an inline assembly
jump to code outside the assembly block may generate an internal compiler
error, as demonstrated in the sample code below:
Under C/C++, version 7.0, the following error is generated:
With the C/C++ compiler version 8.0, a similar error is generated:test.c(15) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file '@(#)main.c:1.27', line 826) Contact Microsoft Product Support Services
C/C++, version 8.0c, generates the same error, except with a different line number:test.c(15) : fatal error C1001: internal compiler error (compiler file '@(#)main.c:1.27', line 831)
test.c(15) : fatal error C1001: internal compiler error (compiler file '@(#)main.c:1.27', line 841)
There are two workarounds to this problem:
#pragma optimize("",off)
void bad_function(void)
{
/* ... */
}
#pragma optimize("",on)
Microsoft has confirmed this to be a bug in the products listed above.
We are researching the problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
This problem does not occur using C/C++, version 8.0, included with
Visual C++, 32-bit Edition, version 1.0.
The following sample code can be used to demonstrate this problem:
/* Compile options needed: /c /Ot
*/
int validate_Float( float nf )
{
__asm
{
finit
fld nf
ftst
fnstsw ax
finit
and ax, 0x0400
jz point
}
return 0;
point:
return 1;
}
void main()
{
float f = 1;
validate_Float( f );
}
Additional query words: 1.00 1.50 7.00 8.00 8.00c
Keywords : kb16bitonly
Version :
Platform :
Issue type :
Last Reviewed: July 26, 1999