Portable C Compiler

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search

The Portable C Compiler (also known as pcc or sometimes pccm - portable C compiler machine) is an early compiler for the C programming language written by Stephen C. Johnson of Bell Labs[1] in mid-1970s—based in part on ideas from earlier work by Alan Snyder in 1973.[2][3]

One of the first compilers that could easily be adapted to output code for different computer architectures, the compiler had a long life span. It shipped with BSD Unix until the release of 4.4BSD in 1994—when it was replaced by the GNU C Compiler. It was very influential in its day, so much so that at the beginning of the 1980s, the majority of C compilers were based on it.[4]



The keys to the success of pcc were its portability and improved diagnostic capabilities:

The first C compiler, written by Dennis Ritchie, had used a recursive descent parser, incorporated specific knowledge about the PDP-11, and relied on an optional machine-specific optimizer to improve the assembly-language code it had generated. In contrast, Johnson's "pcc" was based on a yacc parser generator and used a more general target machine model. Both compilers produced target-specific assembly language code, which they then assembled to produce linkable object modules.

Current version

A new version of pcc based on the original by S. C. Johnson is now maintained by Anders Magnusson. The compiler is provided under the BSD license. According to Magnusson:

…The big benefit of it (apart from that it's BSD licensed, for license geeks) is that it is fast, 5-10 times faster than gcc, while still producing reasonable code …it is also quite simple to port… [5]

This new version was added to the NetBSD pkgsrc and OpenBSD source trees in September 2007,[6] and later into the main NetBSD source tree,[7] and there has been some speculation that it might eventually be used to supplant the GNU C Compiler on BSD-based operating systems.[8] As of December 29, 2009 the PCC is capable of building functional x86 OpenBSD kernel image.[9]


  1. Johnson, S.C. (1978). "A portable compiler: theory and practice". Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles of programming languages. Tucson, Arizona.. pp. 97–104. http://doi.acm.org/10.1145/512760.512771. 
  2. Snyder, A. (1975). "A Portable Compiler for the Language C". Master’s Thesis. M.I.T., Cambridge, Mass.. http://www.lcs.mit.edu/publications/specpub.php?id=717. 
  3. Johnson, S.C. (1981). "A Tour Through the Portable C Compiler". Unix Programmer's Manual, 7th edition, Volume 2. http://citeseer.ist.psu.edu/johnson81tour.html. 
  4. Ritchie, Dennis M. (1993). "The development of the C language". The second ACM SIGPLAN conference on History of programming languages. Cambridge, Massachusetts.. pp. 201–208. http://plan9.bell-labs.com/who/dmr/chist.html. Retrieved 2008-12-30. "At the start of the decade, nearly every compiler was based on Johnson's pcc; by 1985 there were many independently-produced compiler products." 
  5. BSD Licensed PCC Compiler Imported
  6. 'CVS: cvs.openbsd.org: src' - MARC
  7. source-changes: CVS commit: src/dist/pcc
  8. Slashdot | GCC Compiler Finally Supplanted by PCC?
  9. http://undeadly.org/cgi?action=article&sid=20091228231142

See also

External links

Personal tools

Served in 0.227 secs.