Accessing the stack is extremly inefficient in sdcc. This currently is sdcc's worst code quality problem for many ports. The problem can be seen in the attahced files:
stackhell.c, a minimal example.
stackhell2.c, which illustrates how bad the problem can become when using local aggregates.
device/lib/sdcc-mullong.c illustrates a real-world case, where sdcc generates approx. 700 bytes for Z80 vs. spprox 250 bytes for non-free HITECH-C and approx. 450 bytes for free z88dk. The situation is similar with other ports (unless compiling the function as not reentrant).
Log in to post a comment.