## BUG: Internal Compiler Error, C1001, MSC2.CPP, line 1011

Q114532

The information in this article applies to:

- The C/C++ Compiler (CL.EXE), included with:
  - Microsoft Visual C++, versions 1.5, 1.51, 1.52

## SYMPTOMS

When using the /Ol switch (enable loop optimizations) and compiling a module that contains several large loops, or that contains several layers of nested loops, version 8.0c of the Microsoft C/C++ compiler may generate the following error message:

>        file.c(xxx) : fatal error C1001: internal compiler error
>                    (compiler file 'msc2.cpp', line 1011)

## RESOLUTION

There are two workarounds for this error message:

1. Compile using the fast compiler. Use of the fast compiler can be forced by using the /f compiler switch.
-or-
2. Do not compile with loop optimizations enabled. This can be done either at the module level by removing the /Ol option from the compiler command line, or at the function level by using #pragma optimize directives. The syntax of the #pragma optimize directive is as follows:

              #pragma optimize( "l", off ) // Disable loop optimizations
              // Function that contains the code causing the problem.
              // This can be determined by the line number given in the
              // C1001 error message.

              #pragma optimize( "l", on ) // Enable loop optimizations

## STATUS

Microsoft has confirmed this to be a problem with the C/C++ compiler version 8.0c. We are researching the problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: 1.50 8.00c

Keywords : kb16bitonly
Issue type : kbbug
Technology : kbVCsearch kbAudDeveloper kbCVCComp

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