FIX: C1001: reg86.c, line 3154

Last reviewed: September 18, 1997
Article ID: Q114068
1.00 WINDOWS kbtool kbfixlist kbbuglist

The information in this article applies to:

  • The Microsoft C/C++ Compiler (CL.EXE), included with:

        - Microsoft Visual C++ for Windows, version 1.0
    

SYMPTOMS

The compiler generates the following internal compiler error message when the sample program below is compiled with /Oe and /Og or /Ox.

   fatal error C1001: internal compiler error
      (compiler file '@(#)reg86.c:1.26', line 3154)

The internal compiler error is triggered by using the global register allocation optimization (/Oe) with the global common subexpression optimization (/Og). Note that both of these optimizations are included with the /Ox compiler option.

RESOLUTION

To avoid the error, one option is to use the fast compiler (/f) instead of the optimizing compiler. Another option is to disable either the global register allocation optimization or the global common subexpression optimization. This can be done by either not using the /Oe, /Og, or /Ox options on the command line or by using #pragma optimize to disable the optimization in the source file. The comments in the sample below demonstrate using the #pragma to work around the problem. Finally, casting the unsigned int, in the sample below, to an int will also resolve the problem.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed above. This is not a problem in Visual C++, 32-bit Edition. This problem was corrected in Visual C++ version 1.5.

Sample Code

/* Compile options needed: /c /f- /Oeg
*/

void func2(char, char);

// Uncomment for work around
// #pragma optimize ("e", off)

void func(unsigned uParam, int nParam)
{
    func2 ((char)nParam, (char)(uParam - nParam));
    func2 ((char)nParam, (char)(uParam + nParam));
}

// Uncomment for work around
// #pragma optimize ("", on)


Additional reference words: 8.00 1.00
KBCategory: kbtool kbfixlist kbbuglist
KBSubcategory: CLIss
Keywords : CLIss kb16bitonly kbbuglist kbfixlist kbtool
Version : 1.00
Platform : WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.