Microsoft KB Archive/116440

From BetaArchive Wiki

FIX: C4713: Internal Compiler Error, grammar.c, line 168

Q116440

1.50 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.5 ---------------------------------------------------------------------- SYMPTOMS ======== Compiling the sample code shown below with /Oe and /Oi optimizations causes the compiler to generate one of the following error messages: warning C4713: Scroll: internal compiler error; restarting ( compiler file '@(#) grammar.c:1.147', line 168 ) CAUSES ====== If both /Oe (global register allocation) and /Oi (intrinsic function generation) are used, and the compiler finds an expression too complicated for this optimization, the compiler fails to generate the optimized code. However, the compiler is able to detect the problem at a point where it can restart the code-generation process and not optimize the function where the error was detected. This is just a warning; the resulting code should be correct. RESOLUTION ========== To eliminate the warning message, do one of the following: - Turn on the fast compiler option, /f. -or- - Turn off one of the options, /Oe or /Oi, or turn off both options. This also can be done using #pragma optimize(). See the sample code in the "MORE INFORMATION" section, below. -or- - Simplify the complex expression. For example, assign part of the expression to a temporary variable, then use the temporary variable in its place in the expression. 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 2.0. MORE INFORMATION ================ You can use the following sample code to demonstrate this problem: Sample Code ----------- /* Compile options needed: /Oe /Oi */ #include short NRow, NCol, BRow; short ScrnMem[80]; /* Uncomment this line to work around the problem */ /* #pragma optimize( "ei", off ) */ void Scroll(short nlines) { if ( nlines != 0 ) memset(&ScrnMem[NRow*NCol], 0, (NRow- BRow)*NCol*sizeof(ScrnMem[0])); } /* Uncomment this line to work around the problem */ /* #pragma optimize( " ", on ) */ Additional reference words: 1.50 8.00c KBCategory: kbtool kbfixlist kbbuglist KBSubcategory: CLIss

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


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