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 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. 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