FIX: C1001: main.c, Line 826 or 831 From Optimization

ID: Q100538

7.00 | 1.00 MS-DOS | WINDOWS kbtool kbfixlist kbbuglist

The information in this article applies to:

SYMPTOMS

An attempt to compile the code example provided below with the /f- and /Oi compiler options specified fails and Microsoft C/C++ generates one of the following messages. For Microsoft C/C++ version 8.0:

   fatal error C1001: internal compiler error
   (compiler file '@(#)main.c:1.27', line 831)

For Microsoft C/C++ version 7.0:

   fatal error C1001: INTERNAL COMPILER ERROR
   (compiler file '@(#)main.c:1.27', line 826)

RESOLUTION

There are three methods to work around this problem, as follows:

STATUS

Microsoft has confirmed this to be a problem in C/C++ versions 7.0 and 8.0 for MS-DOS. This problem was corrected in C/C++ version 8.0c for MS-DOS, included with Visual C++ for Windows version 1.5.

MORE INFORMATION

The following code example demonstrates this error. You can work around this problem by removing the comment from the #pragma optimize statements in the code below.

Sample Code

/*
 * Compile options needed: /f- /Oi
 */ 

// #pragma optimize("", off);

double func(const double x, double &dt) {
   double y = 0.0;

   if (x == 0.0)
      dt = 1.0;
   else
      _asm  f2xm1
   return y;
}

// #pragma optimize("", on);

Additional reference words: 7.00 1.00 KBCategory: kbtool kbfixlist kbbuglist KBSubcategory: CPPIss
Keywords          : kb16bitonly kbCompiler kbCPPonly kbVC kbbuglist kbfixlist
Version           : 7.00   | 1.00
Platform          : MS-DOS WINDOWS
Solution Type     : kbfix

Last Reviewed: September 20, 1997