Microsoft KB Archive/100538

From BetaArchive Wiki

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


7.00 | 1.00 MS-DOS | WINDOWS kbtool kbfixlist kbbuglist ---------------------------------------------------------------------- The information in this article applies to: - The Microsoft C/C++ Compiler (CL.EXE), included with: - Microsoft C/C++ for MS-DOS, versions 7.0 - Microsoft Visual C++ for Windows, version 1.0 ---------------------------------------------------------------------- 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: - Edit the compiler command line to remove the /Oi option switch. - Use #pragma optimize to disable optimizations from the function that causes the problem. The code example below demonstrates the appropriate pragma. - Compile the application with the fast compiler (specify /f on the compiler command line) instead of the optimizing compiler (specify /f- on the compiler command line). 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
Issue type :
Technology : kbVCsearch kbAudDeveloper kbCVCComp

Last Reviewed: May 5, 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.