Visual Studio 2015 Update 1 中 C++ 的内部编译器错误

Internal Compiler Error with C++ in Visual Studio 2015 Update 1

我更新到 Visual Studio 2015 Update 1,但现在每当我为 64 位编译发布配置时,我都会收到以下错误,一切都适用于 32 位 and/or 调试版本。

fatal error C1001: An internal error has occurred in the compiler.
  (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 246)
   To work around this problem, try simplifying or changing the program near the locations listed above.
  Please choose the Technical Support command on the Visual C++
   Help menu, or open the Technical Support help file for more information
    link!InvokeCompilerPass()+0x2d4bd
    link!DllGetC2Telemetry()+0xae663

错误不是发生在我的每个项目上,而是发生在某些项目上。

简化指定位置是不可能的,编译器崩溃的位置通常只是一个非常简单的一行函数,而且更改此代码会导致在不同位置出现相同的错误。据我猜测,它必须对优化和内联做一些事情。但是更改优化选项也无济于事。

任何人都可以指出如何找到真正有问题的代码或一些编译器选项以避免此错误的方向吗?

我不想相信更新被破坏了。

尝试将项目优化设置为禁用 (/Od),它可能会解决问题。

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box.
  2. Click the C/C++ folder.
  3. Click the Optimization property page.
  4. Modify the Optimization property.

来源:https://msdn.microsoft.com/en-us/library/aafb762y.aspx

希望我的回答能支持您的问题。

在 Release|x64 中重新编译 JSON 库。 Config 设置为最大速度 (/O2),但 General 使用 "No Whole Program Optimization"。 从 "No Whole Program Optimization" 更改为使用 Link 时间代码生成(我相信标志是 /LTCG)构建成功。

我们在升级到 MSVC 2015 update 1 后在我们的一个项目中遇到了 C1001。

通过 trial-and-error,我们已将 ClCompile/AssemblerOutput 属性 确定为本案的罪魁祸首。删除此 属性 不再导致 C1001

来源:https://trac.osgeo.org/mapguide/ticket/2580

2016 年 4 月 6 日更新:我尝试使用 MSVC 2015 Update 2 构建同一个项目,但未删除 ClCompile/AssemblerOutput 属性,并且在构建此项目时我不再获得 C1001。我认为更新 2 修复了它。

我在将公司的代码库从 VC10 转换为 VC14 时也遇到了这个问题。在我们的案例中,问题发生在目标 x64 和 SEH (/EHa) 被启用的同时,同时汇编器输出被打开。当在编译代码中调用流插入运算符(即 std::cout::operator<<)时,错误似乎发生在我们的例子中。

在我们的例子中,动态链接 CRT 而不是静态链接(即 /MT 而不是 /MD)似乎可以在不禁用汇编器输出的情况下解决该问题。这不是我在静态链接 CRT 中发现的第一个问题(例如,在 MFC 中调整 CPane windows 大小时,它也会导致光标丢失)。

这是向 Microsoft (https://connect.microsoft.com/VisualStudio/feedback/details/2216490/compiler-crashes-at-string-stream-insertion-operator) 报告的,但两个半月后,他们似乎甚至都没有看过它...

编辑: 根据 Micrsoft 的说法,VS2015 Update 2 已经解决了这个问题。它在我们的代码库上测试为固定。