GNU Compiler Collection - Structure

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 executable binary.

Each of the language compilers is a separate program that inputs source code and outputs machine code. All have a common internal structure. A per-language front end parses the source code in that language and produces an abstract syntax tree ("tree" for short).

These are, if necessary, converted to the middle-end's input representation, called GENERIC form; the middle-end then gradually transforms the program towards its final form. Compiler optimizations and static code analysis techniques (such as FORTIFY_SOURCE, a compiler directive that attempts to discover some buffer overflows) are applied to the code. These work on multiple representations, mostly the architecture-independent GIMPLE representation and the architecture-dependent RTL representation. Finally, machine code is produced using architecture-specific pattern matching originally based on an algorithm of Jack Davidson and Chris Fraser.

GCC is written primarily in C except for parts of the Ada front end. The distribution includes the standard libraries for Ada, C++, and Java whose code is mostly written in those languages. On some platforms, the distribution also includes a low-level runtime library, libgcc, written in a combination of machine-independent C and processor-specific machine code, designed primarily to handle arithmetic operations that the target processor cannot perform directly.

In May 2010, the GCC steering committee decided to allow use of a C++ compiler to compile GCC. The compiler will be written in C plus a subset of features from C++. In particular, this was decided so that GCC's developers could use the "destructors" and "generics" features of C++.

In August 2012, the GCC steering committee announced that GCC now uses C++ as its implementation language. This means that to build GCC from sources, a C++ compiler is required that understands C++ 2003. For more details on the rationale and specific changes, please refer to the C++ conversion page.

Read more about this topic:  GNU Compiler Collection

Famous quotes containing the word structure:

    If rightly made, a boat would be a sort of amphibious animal, a creature of two elements, related by one half its structure to some swift and shapely fish, and by the other to some strong-winged and graceful bird.
    Henry David Thoreau (1817–1862)

    Women over fifty already form one of the largest groups in the population structure of the western world. As long as they like themselves, they will not be an oppressed minority. In order to like themselves they must reject trivialization by others of who and what they are. A grown woman should not have to masquerade as a girl in order to remain in the land of the living.
    Germaine Greer (b. 1939)

    Vashtar: So it’s finished. A structure to house one man and the greatest treasure of all time.
    Senta: And a structure that will last for all time.
    Vashtar: Only history will tell that.
    Senta: Sire, will he not be remembered?
    Vashtar: Yes, he’ll be remembered. The pyramid’ll keep his memory alive. In that he built better than he knew.
    William Faulkner (1897–1962)