The mcs51 port sometimes generates invalid asm, which is then patched by peephole rule 130. Codegen should not generate invalid asm in the first place, SDCC should work with --no-peep (which if it works, like it does for other ports, is a good tool for debugging and bug workarounds).
The bug was originally found in the fuzzing branch; it looks like all problematic asm comes from either genRet or genCall codegen.
As of [r16568], the main issue is fixed in the next branch, the number of asm lines in generated in regression tests affected by this bug is down by 93%.
Related
Commit: [r16568]
Remaining part fixed in [r16569].
Related
Commit: [r16569]
Maybe it is wise to drop this rule.
I agree. Though that change should only go into trunk after the 4.6.0 release, while IMO, this fix could be picked to trunk if we do an RC2.
Last edit: Philipp Klaus Krause 2026-06-01