We're happily using sdcc in a project of ours in which we're very close to the code space limits of our 8051 device.

We've whipped up a script that consumes the .rst files produced during compilation to test whether lcall/ljmp intructions could be replaced by acall/ajmp, and have found many candidates for this size optimization.

Does sdcc attempt to perform this kind of optimization? If not, would it be possible or interesting to add it?