Compiling with code-size constraints

Mayur Naik, Jens Palsberg
2004 ACM Transactions on Embedded Computing Systems  
Most compilers ignore the problems of limited code space in embedded systems. Designers of embedded software often have no better alternative than to manually reduce the size of the source code or even the compiled code. Besides being tedious and error prone, such optimization results in obfuscated code that is difficult to maintain and reuse. In this paper, we present a step towards code-size-aware compilation. We phrase register allocation and code generation as an integer linear programming
more » ... roblem where the upper bound on the code size can simply be expressed as an additional constraint. The resulting compiler, when applied to six commercial microcontroller programs, generates code nearly as compact as carefully crafted code.
doi:10.1145/972627.972635 fatcat:doog5jv4y5dn3arubc3ewokeaa