Compiling Three-Address Code for C Programs
John F. Reiser · Bell System Technical Journal · 1981
This paper describes a post processor that improves the assembly-language code generated by the portable C compiler. The novel ability to change a sequence of two-address instructions into an equivalent three-address instruction distinguishes this particular code improver from other “peephole” improvers. The combined compiler-improver generates good three-address code for the Digital Equipment Corporation vax-11®computer without requiring extensive changes in the compiler itself, which was designed to accommodate machine architectures with at most two addresses per instruction. For typical programs the improver reduces the number of bytes in the instruction stream by 10 to 23 percent. This paper emphasizes the technique used to transform two-address code to three-address code.