Looks like the problem is triggered by a right shift of a value by itself. The bug can be reproduced by running the s08-stack-auto regression tests (currently in sdcc-next branch, in trunk after 4.3.0). Reproducing might require enabling the test (I'll disable it for s08-stack-auto for now, referencing this bug ticket: [r14124]).
Diff:
Related
Commit: [r14124]
test pass in current trunk