FIX: C1001 Fatal Error in File Main.c, Line 413 for /O1 or /O2 (150884)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
This article was previously published under Q150884 SYMPTOMS
Using /O1 (minimize size) or /O2 (maximize speed) causes a C1001 error
in a try block with the following error message:
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file '\school.tp3\test\c10\src\P2\main.c', line 413)
Additionally, C++ exception handling must be enabled (/GX). If the warning
level is set to 4 (/W4), C4702 (unreachable code) warnings are issued
before the C1001 fatal error.
CAUSE
The cause of the problem is having both /Og (global optimizations) and
inline function expansion /Ob1 (Only __inline) or /Ob2 (Any Suitable)
compiling. /O1 and /O2 are both compound switches, including /Og and /Ob1.
RESOLUTION
Disable either global optimizations (/Og-) or inline function expansion
(/Ob1- or /Ob2-). Please see the More Information section below.
STATUS
Microsoft has confirmed this to be bug in the Microsoft products listed at
the beginning of this article. This bug was corrected in Visual C++ 32-bit
Edition version 4.2.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCompiler kbCPPonly kbfix KB150884 |
---|
|