Compiling the following code using SDCC 4.4.0 results in a "FATAL Compiler Internal Error":
unsigned char foo(void) { return 0; } // Return type must be an unsigned char to reproduce bug
int func(float a) { return a; } // Argument type must be a float/double
void main(void)
{
func(foo() + 0); // Summand literal must be 0 or a floating point (e.g. 1.0)
}
The console prompts used and output displayed were:
sdcc.exe -c -o "main.rel" "../main.c"
../main.c:6: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCopt.c' line number '312' : 0
Contact Author with source code
make: *** [main.rel] Error 1
Error code 2
Please note that the issue does not occur with SDCC 4.3.0.
I can reproduce the issue using current trunk on my Debian GNU/Linux testing system. --nogenconstprop is a workaround.
Fixed in [r14739]. There is another, related issue that is not yet fixed: [bugs:#3718].
Related
Bugs:
#3718Commit: [r14739]
Last edit: Philipp Klaus Krause 2024-03-23