FIX: C4713: Internal Compiler Error, reg86.c, Line 2934

Last reviewed: September 18, 1997
Article ID: Q113259
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 or /Ox:

   warning C4713: func: internal compiler error; restarting
      (compiler file '@(#)reg86.c:1.26', line 2934)

The internal compiler error is triggered by using the global register allocation optimization (/Oe). Note that global register allocation is included with the /Ox compiler option.

RESOLUTION

The C4713 message is just a warning. The compiler realizes a problem has occurred due to the global register allocation optimization and restarts the compile without the optimization.

There are two ways to eliminate this warning message:

  • Use the fast compiler option (/f) instead of the optimizing compiler.

    -or-

  • Disable global register allocation optimization by either not using /Oe or /Ox, or use #pragma optimize to disable optimization during the function where the error occurs. The example below shows how to do this.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed above. This problem was corrected in Visual C++ version 1.5.

Sample Code

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

#include <ctype.h>

typedef struct _table
    {
    char * pcItem1;
    char * pcItem2;
    char * pcItem3;
    int nItem4;
    } * PTABLE;

static int nStatic;

// Uncomment for workaround:
// #pragma optimize ("e", off)

int func (PTABLE ptParam)
{
    for (;;)
    {
     if (nStatic == '/')
     {
         ptParam->nItem4 = 2;
         ptParam->pcItem3 = ptParam->pcItem2;
         return 7;
     }

     if (nStatic == '\\')
     {
         nStatic = (++(ptParam->pcItem2) < ptParam->pcItem1
          ? *ptParam->pcItem2
          : -1);
     }
    }
}

// Uncomment for workaround:
// #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.