I was making a game for the gameboy using the GBDK(which uses sdcc) and I ran into this error:
error 9: FATAL Compiler Internal Error in file '/Users/sdcc-builder/build/sdcc-build/orig/sdcc/src/z80/gen.c' line number '1870' : Symbol in register, but no register assigned.
Contact Author with source code
Symbol iTemp46 at ic 73.
Caught signal 11: SIGSEGV
My code uses a few structs 1 array and I tried to take away any syntax sugar but to no avail. If you want to see the source let me know.
In which version of sdcc did you see the error? Does it still happen with a current version of sdcc?
This looks like an error message from code generation. Most of the time, such errors can be reproduced using a source file containing only the function in which the error is triggered.
Can you reproduce the error using a file with minimal dependencies (i.e. without gbdk)?
This error only happens with the sdcc shipped with GBDK I have made been able to recreate this without the GBDK headers. If you would like I can give you my source code.
I only included stdio.h
I have narrowed it down to where it gives the fatal error when iterating over an array.
So you now have a single function that reproduces the issue, and the only #include is stdio.h?
Could you show that source?
I don't know which sdcc comes with your gdbk. What is the output of sdcc --version?
Here is the source code:
According to GBDK it uses SDCC build #12539.
When I compile that source on my Debian GNU/Linux testing system via
using sdcc 4.2.14 #14011, I do not see the error.
Last edit: Philipp Klaus Krause 2023-05-02
There are struct parameters and return values in your code. That was not yet supported in sdcc #12539, so the sdcc you use must be a newer version.