Regarding:
https://sourceforge.net/p/sdcc/discussion/1865/thread/91a6e4eb/#d0f6
An inlined nop instruction is preventing the peepholer from applying optimizations because
z80MightRead() does not have a "nop" case. Since "nop" is not recognized the function returns TRUE meaning "nop" might read all registers.
The fix is applied to sdcc/src/z80/peep.c in function "z80MightRead()":
if(ISINST(pl->line, "ccf"))
return FALSE;
if(ISINST(pl->line, "nop"))
return FALSE;
The case for "ccf" is there but the case for "nop" is new.
Fixed in revision [r9441]. Particularly useful for the Rabbit, since SDCC generates nop in Rabbit code.
Philipp
Last edit: Maarten Brock 2016-01-04