Professional Researcher's Encyclopaedia

Knowledge is only a click away

GNU Compiler Collection - enyclopaedia article

GNU Compiler Collection

Summary: In computing, GCC is the GNU Compiler Collection. Originally, it stood for GNU C Compiler, but it now handles many different programming languages besides C. 1 Overview 2 Languages 3 Architectures 4 S ...

read the full GNU Compiler Collection article

Buy GNU Compiler Collection related products:


Buy from Amazon.co.uk Books - Music - Classical - VHS - DVD - Video-games - Software - Electronics - Toys
Buy from Amazon.com Books - Music - Classical - VHS - DVD - Videogames - Software - Electronics - Photo - Toys
Buy from Amazon.ca Books - Music - Classical - VHS - DVD - Video-games - Software - Livres en Français
Buy from Amazon.de - - - - - - -
Buy from Amazon.fr - - - - -
Advanced Product Search (new):    uk    |     us    |     ca    |     de    |     fr

GNU Compiler Collection

     From Wikipedia, the free encyclopedia.

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

Table of contents
1 Overview
2 Languages
3 Architectures
4 Structure
5 Reference
6 See also
7 External links

Overview

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.

Languages

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.

Architectures

GCC target processors (as of version 3.2) include:

Lesser-known target processors supported in the standard release have included A29K, ARC, Atmel 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.

Structure

GCC's external interface 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 vary internally, having to produce trees that can be handled by the backend. Some parsers use a YACC-type grammar specification, and the others are hand-coded recursive descent parsers.

The tree representation of a program is more-or-less independent of the processor being targeted. However, confusingly, 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 endianness, 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.

Reference

See also

External links

link to this article with the following HTML

 
This article is from Wikipedia. This article was up-to-date as of 8 May 2004 - See live article
All text is available under the terms of the GNU Free Documentation License.

This page is part of Professional Researcher
Web site design by Dean Marshall