struct s
{
char x[5];
};
struct s g();
void f(void)
{
g();
}
Compiling with sdcc test.c -mz80 outputs this :
test.c:10: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '1688' : Symbol in register, but no register assigned.
Contact Author with source code
Symbol iTemp0 at ic 2.
Caught signal 11: SIGSEGV
Tested on commit 11672.
With r12391
Related
Wiki: z80
Basically the same problem happens for all z80-related ports and for stm8.
For mcs51, hc08 and s08 it looks to me as if incorrect code is generated.
For pdk13, pdk14 and pdk15, the generated code looks correct, unless --stack-auto is used.
Last edit: Philipp Klaus Krause 2021-05-19
As of [r12392], there is some progress: The exact scenario of the bug report now works for z80 and related ports: A caller that calls a function returning struct, and not using the returned value.
In particular, the following still don't work:
There has been substantial progress on struct return values in mid-2022. Basically, it should just work. If there are remaining issues for some corner cases, they get their own bug reports.