SDCC nightly build with no GBDK patches:
sdcc -v
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/r4k/r5k/r6k/sm83/tlcs90/ez80/z80n/r800/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02/f8/f8l TD- 4.6.0 #16555 (Linux)
Getting the following compiler error:
sdcc_genconstprop_1402_compiler_error.c:10: error 9: FATAL Compiler Internal Error in file 'SDCCgenconstprop.cc' line number '1402' : code generator internal error
Building with:
sdcc -msm83 -c sdcc_genconstprop_1402_compiler_error.c
sdcc -mz80 -c sdcc_genconstprop_1402_compiler_error.c
sdcc -mmos6502 -c sdcc_genconstprop_1402_compiler_error.c
Minimal example to reproduce:
unsigned char loadedCharacters[10];
void my_func_1(unsigned char a);
inline void my_func2(unsigned int a) {
if (a < 256) {
my_func_1((unsigned char)a);
} else {
my_func_1((unsigned char)a);
}
}
void my_func3(void){
my_func2((unsigned int)loadedCharacters[1]);
}
Apparently, the call to computeDataFlow in line 3923 of SDCCopt.c optimizes out an IFX iCode resulting in an unreachable basic block. Much later, that block is the eliminated, but OP_USES for an iTemp still references an iCode in that basic block.
Fixed in the next branch in [r16574].
Related
Commit: [r16574]
Thank you!
Unfortunately, the fix caused a regression in diagnostics: [bugs:#4001].
Related
Bugs: #4001
The change has been reverted in trunk (where next had been merged to after SDCC 4.6.0 RC1). I'll try to come up with a better fix in the next branch.
Last edit: Philipp Klaus Krause 2026-06-06
Thanks for the update. We'll keep an eye on this and make a new build once there is a new version to test with.
any news on this, Philipp?
No. I didn't find time for it around the SDCC 4.6.0 release. There have been bugs that I considered more important (since they resulted in bad code being generated), or that were easier to fix, and I've been busy. I hope I find time to look into this one on the weekend, or sometime next week.
Fixed in [r16698].
Related
Commit: [r16698]
Looks good on our end, thank you!
Was the following line accidentally left in the fix? Toxa noticed It appears to output icode information to files (<name>.dumpcustom0) in some cases</name>
No. Fixed in [r16705].
Related
Commit: [r16705]
Fixed in [r16698].
Edit: this is an unintentional duplicate of the message on the original bugfix from a week ago.
Related
Commit: [r16698]
Last edit: Philipp Klaus Krause 3 days ago
Thanks! I see it in [r16705]
Related
Commit: [r16705]