Portable C Compiler
AT&T Bell Laboratories | |
---|---|
Initial release | 1979 |
Stable release | 1.1.0
/ December 10, 2014 |
Written in | BSD License |
Website | web |
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 in the mid-1970s,[1] based in part on ideas proposed by Alan Snyder in 1973,[2][3] and "distributed as the C compiler by Bell Labs... with the blessing of Dennis Ritchie."[4]
Being 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 debuted in
Features
Key features of pcc are its
The first C compiler, written by Dennis Ritchie, 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 generated. In contrast, Johnson's pccm was based on a yacc-generated parser 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.
Later versions of PCC, known within Bell Labs as "QCC" and "RCC," supported other target architecture models.[citation needed]
The language that PCC implements is an extended version of K&R C that Bjarne Stroustrup has called "Classic C", incorporating the void
return type (for functions that don't return any value), enumerations and structure assignment.[4]
Current version
A new version of pcc, based on the original by Steve Johnson, is maintained[
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. <...> [I]t is also quite simple to port...
— Anders Magnusson[7]
This new version was added to the NetBSD pkgsrc and OpenBSD source trees in September 2007,[8] and later into the main NetBSD source tree.[9] There had been some speculation that it might eventually be used to supplant the GNU C Compiler on BSD-based operating systems,[10] though FreeBSD[11][12] and NetBSD[13] are both looking to Clang as a potential replacement, and Theo de Raadt of OpenBSD asserts that pcc is not ready yet to be a gcc replacement, and the disposal of gcc is not top priority.[14] On December 29, 2009, pcc became capable of building a functional x86 OpenBSD kernel image.[15]
pcc version 1.0 was released on 1 April 2011.[16] As of this release, the compiler supports x86 and x86-64 processor architectures and runs on NetBSD, OpenBSD, FreeBSD, various Linux distributions, and Microsoft Windows.[17] Further development, including support for more architectures, and
PCC was removed from the OpenBSD
The latest version of pcc, namely 1.1.0, was released on 10 December 2014.[21]
See also
- Amsterdam Compiler Kit
- Clang
- Open Watcom
References
- S2CID 14390804.
- ^ Snyder, A. (1975). "A Portable Compiler for the Language C". Master's Thesis. MIT, Cambridge, Mass. Archived from the original on 2006-09-05. Retrieved 2006-07-19.
- ISBN 0-03-061743-X.
- ^ a b Stroustrup, Bjarne (2002). Sibling rivalry: C and C++ (PDF) (Report). AT&T Labs.
- ^ 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. 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.
- ^ a b "pcc history". pcc - portable c compiler. 2010-06-21. Retrieved 2012-06-26.
- ^ Erdely, Mike (2007-09-15). "BSD Licensed PCC Compiler Imported". OpenBSD Journal. Retrieved 2011-12-17.
- ^ Moerbeek, Otto (2007-09-15). "CVS: cvs.openbsd.org: src". openbsd-cvs (Mailing list).
- ^ Brownlee, David (2007-09-20). "CVS commit: src/dist/pcc". source-changes (Mailing list).
- ^ "GCC Compiler Finally Supplanted by PCC?". /. 2007-09-17.
- Phoronix. Archivedfrom the original on 10 April 2015. Retrieved 23 April 2015.
- ^ Brooks, Davis (5 November 2012). "HEADS UP: Clang now the default on x86" (Mailing list). Retrieved 23 April 2015.
- ^ Joerg, Sonnenberger (17 October 2013). "Importing LLVM/Clang" (Mailing list). Retrieved 23 April 2015.
- ^ Matzan, Jem (2007-10-15). "More on OpenBSD's new compiler". The Jem Report. Archived from the original on 2012-01-04. Retrieved 2011-12-17.
But that's never really been the agenda, see. Some people think we hate GNU code. But the thing is we hate large code, and buggy code that upstream does not maintain. That's the real problem… gcc gets about 5-6% slower every release, has new bugs, generates crappy code, and drives us nuts. This is just an attempt to see if something better can show up.
- ^ de Weerd, Paul (2009-12-29). "Call for testing: pcc and the OpenBSD kernel". OpenBSD Journal. Retrieved 2011-12-17.
- ^ Magnusson, Anders (2011-04-01). "1.0 Release". Portable C Compiler. Retrieved 2011-12-17.
- ^ "BSD Fund: pcc fund". bsdfund.org. 2011-04-01. Archived from the original on 2009-01-05. Retrieved 2012-06-26.
- ^ Paul Irofti (2012-04-12). "CVS: cvs.openbsd.org: src".
- ^ Peter Hessler (2012-06-18). "Re: Story behind PCC's removal?".
- ^ Miod Vallat (2013-07-31). "Compilers in OpenBSD".
- ^ Magnusson, Anders (2014-12-10). "1.1.0 Release". Portable C Compiler. Retrieved 2022-04-22.