Apparently, there is an issue in peephole optimization that results in out-of-range relative jumps.
Such an issue can have multiple potential underlying causes: Bugs in instruction size estimation and broken peephole rules that increase code size or at least increase code size between a relative jump and its target.
I can reproduce the issue on my Debian GNU/Linux testing system:
Compile the r3ka regression tests ("make test-ucr3ka") with "--max-allocs-per-node 10" added to SDCCFLASG in ports/ucr3ka/spec.mk. Then gcc-torture-execute-pr78720.c fails to compile:
gen/ucr3ka/gcc-torture-execute-pr78720/gcc-torture-execute-pr78720.asm:381: Error: <a> machine specific addressing or addressing mode error
That wrong asm line contains
jr NZ, 00101$
P.S.: While I reproduced the issue when compiling for r3ka, and could not using the same test when compiling for z80, it is likely that the underlying issue also affects z80 (and other z80-reltaed ports), as they share most of the peephole optimizer infrastructure. I guess it would just take a different code sample to trigger on z80.
Diff: