简体   繁体   English

是什么原因导致“左但未输入” GCC编译器错误?

[英]What causes the “left but not entered” GCC compiler error?

We recently ran into the following compiler error that repeated at different locations throughout our build: 我们最近遇到了以下编译器错误,该错误在我们的构建中的不同位置重复出现:

line-map.c: file "<a source_file name>" left but not entered

The source file was different at different points in the build. 源文件在构建中的不同点有所不同。 After some time, the compiler finally threw the following error: 一段时间后,编译器最终抛出以下错误:

<header file>: In function `<function name that is not present within the given header file>':
<same header file>:-117020: internal compiler error: in final_scan_insn, at final.c:1790

After a lot of investigation we found that this error was being caused by some #defines in a different header file: 经过大量调查,我们发现此错误是由不同头文件中的一些#define引起的:

#define GEOGRAPHIC_LOC_TYPE_CGI            0
#define GEOGRAPHIC_LOC_TYPE_SAI            1
#define GEOGRAPHIC_LOC_TYPE_RAI            2
#define GEOGRAPHIC_LOC_TYPE_TAI          128
#define GEOGRAPHIC_LOC_TYPE_ECGI         129
#define GEOGRAPHIC_LOC_TYPE_TAI_AND_ECGI 130

We moved these #defines from the header file in which they currently existed into the .c file, which was the only location in which they were currently being used. 我们将这些#defines从它们当前存在的头文件中移到了.c文件中,.c文件是当前使用它们的唯一位置。 Then, we didn't see the compiler error anymore. 然后,我们再也看不到编译器错误。

Could anyone explain what the above compiler errors mean and why this fix worked? 任何人都可以解释上述编译器错误的含义以及为什么此修复程序有效吗?

Thanks, Ryan 谢谢,瑞安

When you get an ICE (Internal Compiler Error), it means the internals of GCC are messed up. 当您收到ICE(内部编译器错误)时,表明GCC的内部混乱。 Not because of your code, but because of a bug inside GCC code, which is detected by an assert . 不是因为您的代码,而是因为GCC代码中的错误(由assert检出)。

The changes in your code that avoid the bug are probably not meaningful. 避免该错误的代码更改可能没有意义。

The next steps are: 下一步是:

  • Update to the latest GCC (4.4.2), to check whether the ICE was fixed. 更新到最新的GCC(4.4.2),以检查ICE是否已修复。
  • If it wasn't, reduce your code the minimal code producing an ICE 如果不是这样,则将代码减少为产生ICE的最少代码
  • Create a Bug Report for that ICE. 为该ICE创建一个错误报告

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM