Please Enter Your Search Term Below:
 Websearch   Directory   Dictionary   FactBook 
  Wikipedia: GNU Compiler Collection

Wikipedia: GNU Compiler Collection
GNU Compiler Collection
From Wikipedia, the free encyclopedia.

GCC is the GNU Compiler Collection. Originally, it stood for GNU C Compiler, but it now handles many different programming languages besides C.

GCC is a GPL-licensed compiler distributed by the Free Software Foundation, and a key enabling technology for the Open Source Software (OSS) and Free software movements. Originally written by Richard Stallman in 1987, GCC is now maintained by a varied group of programmers from around the world. It has been ported to more kinds of processors and operating systems than any other compiler.

In 1997, a group of developers dissatisfied with the slow pace and closed nature of official GCC development formed a project called EGCS (Experimental/Enhanced GNU Compiler System) which merged several experimental forks into a single project forked from GCC. EGCS development subsequently proved sufficiently more vital than GCC development that EGCS was eventually "blessed" as the official version of GCC in April 1999.

GCC has been adopted as the main compiler used to build and develop for a number of systems, including GNU/Linux, the BSDss, Mac OS X, NeXTSTEP, and BeOS.


As of version 3.2, the standard compiler release includes front ends for:

A front end for CHILL was previously included, but has been dropped due to lack of maintenance. Pascal, Modula-2, Modula-3, Mercury and Objective-C++ frontends also exist.


GCC target processors (as of version 3.2) include:

Lesser-known target processors supported in the standard release have included A29K, ARC, AVR, C4x, CRIS, D30V, DSP16xx, FR-30, FR-V, Intel i960, IP2000, M32R, 68HC11, MCORE, MMIX, MN10200, MN10300, NS32K, ROMP, Stormy16, V850, Xtensa. Additional processors, such as the D10V and Z8000, have been supported by GCC versions maintained separately from the FSF version.


GCC's internal structure is generally standard for a Unix compiler. Users invoke a driver program named "gcc", which interprets command arguments, decides which language compilers to use for each input file, runs the assembler on their output, and then possibly runs the linker to produce a complete program.

Each of the language compilers is a separate program that takes in source code and produces assembly language. All have a common internal structure; a per-language front end that parses the languages and produces an abstract syntax tree ("tree" for short), and a back end that converts the trees to GCC's Register Transfer Language, runs various compiler optimizations, then produces assembly language using architecture-specific pattern matching originally based on an algorithm of Jack Davidson and Chris Fraser.

Nearly all of GCC is written in C, although much of the Ada frontend is in Ada.

Front ends

Frontends may vary internally, being required only to produce trees that can be handled by the backend. Most of the parsers having been built using a YACC-type grammar specification, but some are based on recursive descent.

The tree representation of a program is more-or-less independent of the processor being targeted. However, the meaning of a tree is somewhat different for different language front-ends, and front-ends can provide their own tree codes. They are implemented as C language unions.

Back end

The behavior of the GCC back end is partly specified by preprocessor macros and functions specific to a target architecture, for instance to define the enddianness, word size, and calling conventions. The front part of the back end uses these to help decide RTL generation, so although GCC's RTL is nominally processor-independent, the initial sequence of abstract instructions is already adapted to the target.

The exact set of GCC optimizations varies from release to release as it develops, but includes the standard algorithms, such as jump optimization, jump threading, common subexpression elimination, instruction scheduling, and so forth.

A "reloading" phase changes abstract (pseudo-) registers into real machine registers, using data collected from the patterns describing the target's instruction set. This is a somewhat complicated phase, because it must account for the vagaries of all of GCC's targets.

The final phase is somewhat anticlimactic, since the patterns to match were generally chosen during reloading, and so the assembly code is simply built by running substitutions of registers and addresses into the strings specifying the instructions.


External links


From Wikipedia, the free encyclopedia. 
Modified by Geona