| GNU Compiler Collection | |
|---|---|
| Developed by | GNU Project |
| Latest release | 4. A software developer is a person or organization concerned with facets of the software development process wider than design and coding a somewhat broader scope of The GNU Project is a Free software, Mass collaboration project announced in 1983 by Richard Stallman. A software release is the distribution whether public or private of an initial or new and upgraded version of a Computer software product 3. 1 / 6 June 2008 |
| OS | Cross-platform |
| Platform | GNU |
| Genre | Compiler |
| License | GNU General Public License, GNU Lesser General Public License |
| Website | http://gcc.gnu.org/ |
The GNU Compiler Collection (usually shortened to GCC) is a set of compilers produced for various programming languages by the GNU Project. Events 1508 - Maximilian I Holy Roman Emperor, is defeated in Friulia by Venetian forces; he is forced to sign a three-year 2008 ( MMVIII) is the current year in accordance with the Gregorian calendar, a Leap year that started on Tuesday of the Common An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination In computing cross-platform (also known as multi-platform) is a term used to refer to Computer software or computing methods and concepts that are implemented In Computing, a platform describes some sort of Hardware architecture or Software framework (including Application frameworks, that allows GNU ( pronounced) is a computer Operating system composed entirely of Free software. Computer software can be organized into categories based on common function type or field of use A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another A software license (or software licence in commonwealth usage is a Legal instrument governing the usage or redistribution of copyright protected software The GNU Lesser General Public License (formerly the GNU Library General Public License) or LGPL is a Free software license published by the Free Software A website (alternatively web site or Web site, a back-construction from the Proper noun World Wide Web) is a collection of Web pages A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another A programming language is an Artificial language that can be used to write programs which control the behavior of a machine particularly a Computer. The GNU Project is a Free software, Mass collaboration project announced in 1983 by Richard Stallman. GCC is a key component of the GNU toolchain. The GNU toolchain is a blanket term for a collection of Programming tools produced by the GNU Project. As well as being the official compiler of the GNU system, GCC has been adopted as the standard compiler by most other modern Unix-like computer operating systems, including Linux, the BSD family and Mac OS X. GNU ( pronounced) is a computer Operating system composed entirely of Free software. A Unix-like (sometimes shortened to *nix) Operating system is one that behaves in a manner similar to a Unix system while not necessarily conforming An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination Linux (commonly pronounced ˈlɪnəks Mac OS X (mæk oʊ ɛs tɛn is a line of computer Operating systems developed marketed and sold by Apple Inc, the latest of which is pre-loaded on all currently GCC has been ported to a wide variety of computer architectures, and is widely deployed as a tool in commercial, proprietary and closed source software development environments. See also Software portability In Computer science, porting is the process of adapting software so that an executable program can be created In Computer engineering, computer architecture is the conceptual design and fundamental operational structure of a Computer system Proprietary software is Computer software on which the producer has set restrictions on use private modification copying, or republishing. Proprietary software is Computer software on which the producer has set restrictions on use private modification copying, or republishing. GCC is also used in popular embedded platforms like Symbian[1], Playstation and Sega Dreamcast. Symbian OS is an open Operating system, designed for Mobile devices with associated libraries, User interface frameworks and The PlayStation (abbreviated PS, PSone, PS1, or informally as PSX) is a 32-bit fifth generation Video game console The is Sega 's most recent Video game console and the successor to the Sega Saturn.
Originally named the GNU C Compiler, because it only handled the C programming language, GCC 1. tags please moot on the talk page first! --> In Computing, C is a general-purpose cross-platform block structured 0 was released in 1987, and the compiler was extended to compile C++ in December of that year. C++ (" C Plus Plus " ˌsiːˌplʌsˈplʌs is a general-purpose Programming language. [2] Front ends were later developed for Fortran, Pascal, Objective C, Java, and Ada, among others. Front-end and back-end are generalized terms that refer to the initial and the end stages of a process Fortran (previously FORTRAN) is a general-purpose, procedural, imperative Programming language that is especially suited to Pascal is an influential imperative and procedural Programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small Objective-C is a reflective, object-oriented Programming language which adds Smalltalk -style messaging to C. Ada is a structured, Statically typed, imperative, and object-oriented high-level computer Programming language [3]
The Free Software Foundation (FSF) distributes GCC under the GNU General Public License (GNU GPL) and the GNU Lesser General Public License (GNU LGPL). The Free Software Foundation ( FSF) is a Non-profit corporation founded by Richard Stallman on 4 October 1985 to support the Free software movement The GNU Lesser General Public License (formerly the GNU Library General Public License) or LGPL is a Free software license published by the Free Software GCC is free software. Free software or software libre is Software that can be used studied and modified without restriction and which can be copied and redistributed in modified or unmodified
Contents |
Richard Stallman started GCC in 1985. Richard Matthew Stallman (born March 16 1953 often abbreviated " rms " is an American software freedom activist He extended an existing compiler to compile C. The compiler originally compiled Pastel, an extended, nonportable dialect of Pascal, and was written in Pastel. Pascal is an influential imperative and procedural Programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small It was rewritten in C by Len Tower and Stallman,[4] and released in 1987[5] as the compiler for the GNU Project, in order to have a compiler available that was free software. Leonard "Len" H Tower Jr (born June 17, 1949) is a hacker and activist in the Free software movement, environmentalist artist Free software or software libre is Software that can be used studied and modified without restriction and which can be copied and redistributed in modified or unmodified Its development was supervised by the Free Software Foundation. The Free Software Foundation ( FSF) is a Non-profit corporation founded by Richard Stallman on 4 October 1985 to support the Free software movement [6]
By 1991, GCC 1. x had reached a point of stability, but architectural limitations prevented many desired improvements, so the Free Software Foundation (FSF) started work on GCC 2. The Free Software Foundation ( FSF) is a Non-profit corporation founded by Richard Stallman on 4 October 1985 to support the Free software movement x. But during the mid-1990s, the FSF kept such close control on what was added to the official version of GCC 2. x that GCC was used as one example of the "cathedral" development model in Eric S. Raymond's essay The Cathedral and the Bazaar. Eric Steven Raymond (born December 4 1957 often referred to as ESR, is a Computer programmer, author and Open source software advocate The Cathedral and the Bazaar (abbreviated CatB) is an essay by Eric S
As GCC was free software, programmers wanting to work in other directions — particularly those writing interfaces for languages other than C — were free to develop their own fork of the compiler. Free software or software libre is Software that can be used studied and modified without restriction and which can be copied and redistributed in modified or unmodified tags please moot on the talk page first! --> In Computing, C is a general-purpose cross-platform block structured In Software engineering, a project fork happens when developers take a copy of Source code from one software package and start independent development Multiple forks proved inefficient and unwieldy, however, and the difficulty in getting work accepted by the official GCC project was greatly frustrating for many.
In 1997, a group of developers formed EGCS, to merge several experimental forks into a single project. Projects merged included g77 (Fortran), PGCC (Pentium-optimized GCC), many C++ improvements, and many new architectures and operating system variants. Fortran (previously FORTRAN) is a general-purpose, procedural, imperative Programming language that is especially suited to The Pentium brand refers to Intel 's single-core x86 Microprocessor based on the P5 fifth-generation Microarchitecture. C++ (" C Plus Plus " ˌsiːˌplʌsˈplʌs is a general-purpose Programming language. An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination
EGCS development proved considerably more vigorous than GCC development, so much so that the FSF officially halted development on their GCC 2. x compiler, "blessed" EGCS as the official version of GCC and appointed the EGCS project as the GCC maintainers in April 1999. Furthermore, the project explicitly adopted the "bazaar" model over the "cathedral" model. With the release of GCC 2. 95 in July 1999, the two projects were once again united.
GCC is often the compiler of choice for developing software that is required to execute on a wide variety of hardware. Differences in native compilers lead to difficulties in developing code that will compile correctly on all the compilers and build scripts that will run for all the platforms. By using GCC, the same parser is used for all platforms, so if the code compiles on one, chances are high that it compiles on all.
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. An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination [7]
The standard compiler release 4. 3 includes front ends for: C, C++ (G++), Java (GCJ), Ada (GNAT), Objective-C, Objective-C++, and Fortran (GFortran). tags please moot on the talk page first! --> In Computing, C is a general-purpose cross-platform block structured C++ (" C Plus Plus " ˌsiːˌplʌsˈplʌs is a general-purpose Programming language. The GNU Compiler for Java ( GCJ or gcj) a free-software Compiler for the Java programming language, forms part of the GNU Compiler Ada is a structured, Statically typed, imperative, and object-oriented high-level computer Programming language GNAT is a free-software Compiler for the Ada programming language which forms part of the GNU Compiler Collection. Objective-C is a reflective, object-oriented Programming language which adds Smalltalk -style messaging to C. Objective-C is a reflective, object-oriented Programming language which adds Smalltalk -style messaging to C. Fortran (previously FORTRAN) is a general-purpose, procedural, imperative Programming language that is especially suited to gfortran is the name of the GNU Fortran Compiler, which is part of the GNU Compiler Collection (GCC Also available, but not in standard are: Modula-2, Modula-3, Pascal, PL/I, D (gdc), Mercury, VHDL (GHDL). Modula-2 is a computer Programming language invented by Niklaus Wirth at ETH, around 1978 as a successor to his intermediate language Modula Modula-3 is a Programming language conceived as a successor to an upgraded version of Modula-2. Pascal is an influential imperative and procedural Programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small PL/I ("Programming Language One" ˌpiːˌɛlˈwʌn is an imperative computer Programming language designed for scientific engineering The D programming language, also known simply as D, is an object-oriented, imperative, multiparadigm System programming language Mercury is a functional logic Programming language geared towards real-world applications [8] A popular parallel language extension, OpenMP, is also supported. The OpenMP (Open Multi-Processing is an Application programming interface (API that supports multi-platform Shared memory Multiprocessing programming
The Fortran front end was g77 before version 4. 0, which only supports Fortran 77. Fortran (previously FORTRAN) is a general-purpose, procedural, imperative Programming language that is especially suited to In newer versions, g77 is dropped in favor of the new GFortran front end that supports Fortran 95. gfortran is the name of the GNU Fortran Compiler, which is part of the GNU Compiler Collection (GCC Fortran (previously FORTRAN) is a general-purpose, procedural, imperative Programming language that is especially suited to A front end for CHILL was previously included, but has been dropped owing to a lack of maintenance. In Computing, CHILL (an acronym for CCITT High Level Language) is a procedural Programming language designed for use in
A few experimental branches exist to support additional languages, such as the GCC UPC compiler[9] for Unified Parallel C
GCC target processors as of version 4. Unified Parallel C ( UPC) is an extension of the C programming language designed for High-performance computing on large-scale Parallel machines 3 include:
Lesser-known target processors supported in the standard release have included:
Additional processors have been supported by GCC versions maintained separately from the FSF version:
When retargeting GCC to a new platform, bootstrapping is often used. Alpha, originally known as Alpha AXP, was a 64-bit Reduced instruction set computer (RISC Instruction set architecture (ISA developed The ARM architecture (previously the Advanced RISC Machine, and prior to that Acorn RISC Machine) is a 32-bit RISC processor architecture The AVR is a Modified Harvard architecture 8-bit RISC single chip Microcontroller (µC which was developed by Atmel in 1996 Blackfin refers to a family of 16/32-bit Microprocessors with built-in Digital Signal Processor ( DSP) functionality which is traditionally only accompanied by The 68HC12 (6812 or HC12 for short is a 16-bit Microcontroller family from Freescale Semiconductor. H8 is the name of a large family of 8-bit and 16-bit Microcontrollers made by Renesas Technology, originating in the early 1990s within Hitachi IA-32 ( Intel Architecture 32-bit) often generically called X86 or x86-32, is the Instruction set architecture of Intel See also X86 assembly language The generic term x86 refers to the most commercially successful Instruction set architecture in the history of Personal x86-64 is a Superset of the x86 instruction set architecture. Itanium is the brand name for 64-bit Intel Microprocessors that implement the Intel Itanium architecture (formerly called IA-64) The Motorola 68000 is a 16/32-bit CISC Microprocessor core designed and marketed by Freescale Semiconductor (formerly Motorola Semiconductor MIPS (originally an acronym for Microprocessor without Interlocked Pipeline Stages) is a RISC microprocessor architecture developed by MIPS Technologies PA-RISC is a Microprocessor architecture developed by Hewlett-Packard 's Systems & VLSI Technology Operation. The PDP-11 was a series of 16-bit Minicomputers sold by Digital Equipment Corp PowerPC is a RISC Instruction set architecture created by the 1991 Apple – IBM – Motorola alliance known as AIM Cell is a Microprocessor architecture jointly developed by Sony Computer Entertainment, Toshiba, and IBM, an ESA/390 (Enterprise Systems Architecture/390 was introduced in September 1990 and is IBM 's last 31-bit -address/ 32-bit -data mainframe computing IBM System z, or earlier IBM eServer zSeries, is a brand name designated by IBM to all its Mainframe computers In 2000 IBM rebranded the existing The SuperH (or SH) is brandname of a certain Microcontroller and Microprocessor architecture SPARC (from Scalable Processor Architecture is a RISC Microprocessor Instruction set architecture originally Name "VAX" was originally an Acronym for V irtual A ddress e' X' tension, both because the VAX was seen as a 32-bit AMD 29000, often simply 29k, was a popular family of RISC -based 32-bit Microprocessors and Microcontrollers from Advanced Micro Devices ARC International plc is a developer of configurable Microprocessor technology The ETRAX CRIS is a series of CPUs designed and manufactured by Axis Communications for use in Embedded systems since 1993 The Fujitsu FR-V is a VLIW -based RISC Microprocessor, including FR-400 and FR-450 which runs Linux, and are also supported by Intel 's i960 (or 80960) was a RISC -based Microprocessor design that became popular during the early 1990s as an embedded The M32R is a 32-bit embedded RISC Microcontroller originally developed and manufactured by Renesas Technology succeeded by a FPGA -implemented The 68HC11 ( 6811 or HC11 for short is a 8-bit Microcontroller (µC family originally from Motorola now produced by Freescale Semiconductor MMIX may also refer to the year 2009, in Roman numerals. MMIX (pronounced em-mix) is a 64-bit RISC The 88000 ( m88k for short is a Microprocessor design produced by Motorola. The 320xx or NS32000 is a series of Microprocessors from National Semiconductor ("NS" "Natsemi" The ROMP or Research (Office Products Division Micro Processor chip also known in some circles as 032, was first in silicon in 1981 and was originally designed to The NEC Electronics Corporation V850 is a 32-bit embedded RISC Microcontroller originally developed and manufactured by NEC, succeeded by V850 Xtensa is a 32-bit Microprocessor core designed by Tensilica. The AVR32 is a 32-bit RISC Microprocessor architecture designed by Atmel. The Media embedded Processor (MeP is a configurable 32-bit processor design from Toshiba Semiconductor for embedded media processing applications The MicroBlaze is a soft processor core designed for Xilinx FPGAs from Xilinx. The MSP430 is a Microcontroller family from Texas Instruments. Nios II is a 32-bit embedded-processor architecture designed specifically for the Altera family of FPGA. Now considered obsolete Nios was Altera 's first configurable 16-bit embedded processor for its FPGA product-line The PDP-10 was a Mainframe computer manufactured by Digital Equipment Corporation (DEC from the late 1960s on the name stands for "Programmed Data Processor TIGCC (from " TI " and " GCC " is a software development environment which allows developers to program and compile A68K assembly, The Z8000 was a 16-bit Microprocessor introduced by ZiLOG in 1979 PIC is a family of Harvard architecture Microcontrollers made by Microchip Technology, derived from the PIC1640 originally developed by General Instrument In Software engineering, retargeting is an attribute of software development tools that have been specifically designed to generate code for more than one computing platform Bootstrapping is a term used in Computer science to describe the techniques involved in writing a Compiler (or assembler) in the target Programming
GCC's external interface is generally standard for a Unix compiler. Unix (officially trademarked as UNIX, sometimes also written as Unix with Small caps) is a computer 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. See the terminology section below for information regarding inconsistent use of the terms assembly and assembler
Each of the language compilers is a separate program that inputs source code and outputs assembly 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), and a back end converts the trees to GCC's Register Transfer Language (RTL). Front-end and back-end are generalized terms that refer to the initial and the end stages of a process In Computer science and Linguistics, parsing, or more formally syntactic analysis, is the process of analyzing a sequence of tokens to In Computer science, an abstract syntax tree (AST or just syntax tree, is a tree representation of the Syntax of some Source code Front-end and back-end are generalized terms that refer to the initial and the end stages of a process In Computer science, register transfer language (RTL is a term used to describe a kind of Intermediate representation (IR that is very close to Assembly language Compiler optimizations and static code analysis techniques (such as FORTIFY_SOURCE[10], a compiler directive which attempts to discover some buffer overflows) are applied to the code. Compiler optimization is the process of tuning the output of a Compiler to minimize or maximize some attribute of an Executable computer program Static code analysis is the analysis of computer Software that is performed without actually executing programs built from that software (analysis performed on executing In Computer security and programming, a buffer overflow, or buffer overrun, is an anomalous condition where a process attempts to Finally, assembly language is produced using architecture-specific pattern matching originally based on an algorithm of Jack Davidson and Chris Fraser. In Computer science, pattern matching is the act of checking for the presence of the constituents of a given Pattern.
Nearly all of GCC is written in C with the exception of the Ada frontend; much of the Ada frontend is written in Ada.
Frontends vary internally, having to produce trees that can be handled by the backend. The parsers are hand-coded recursive descent parsers. A recursive descent parser is a top-down parser built from a set of mutually-recursive procedures (or a non-recursive equivalent where each such Procedure
Until recently, the tree representation of the program was not fully independent of the processor being targeted. Confusingly, the meaning of a tree was somewhat different for different language front-ends, and front-ends could provide their own tree codes.
In 2005, two new forms of language-independent trees were introduced. These new tree formats are called GENERIC and GIMPLE. In the GNU Compiler Collection, GENERIC is an intermediate representation common to all the front-ends of GCC In the GNU Compiler Collection, GIMPLE is an Intermediate representation of the program in which complex expressions are split into a Three Parsing now creates temporary language-dependent trees, which are converting to GENERIC. The so-called "gimplifier" then lowers this more complex form into the simpler SSA-based GIMPLE form which is the common language for a large number of new powerful language- and architecture-independent global (function scope) optimizations. In Compiler design static single assignment form (often abbreviated as SSA form or SSA) is an Intermediate representation (IR in which every
Optimization on trees does not generally fit into what most compiler developers would consider a front end task, as it is not language dependent and does not involve parsing. GCC developers have given this part of the compiler the somewhat contradictory name the "middle end. " These optimizations include dead code elimination, partial redundancy elimination, global value numbering, sparse conditional constant propagation, and scalar replacement of aggregates. In Compiler theory, dead code elimination is a Compiler optimization that removes code that does not affect the program In Compiler theory, Partial redundancy elimination (PRE is a Compiler optimization that eliminates expressions that are redundant on some but not necessarily all Global value numbering (GVN is a Compiler optimization based on the SSA intermediate representation In Computer science, sparse conditional constant propagation is an optimization frequently applied in Compilers after conversion to Static single assignment form Array dependence based optimizations such as automatic vectorization are currently being developed.
The behavior of GCC's 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 C preprocessor ( cpp) is the Preprocessor for the C programming language. In Computing, " word " is a term for the natural unit of data used by a particular computer design In Computer science, a calling convention is a standardized method for a program to pass parameters to a function and receive a result value back from it 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 loop optimization, jump threading, common subexpression elimination, instruction scheduling, and so forth. In Compiler theory, loop optimization plays an important role in improving cache performance making effective use of parallel processing capabilities and reducing overheads In Computing, jump threading is a Compiler optimization. In this pass conditional jumps in the code that branch to identical or inverse tests are detected and can In Computer science, common subexpression elimination (CSE is a Compiler optimization that searches for instances of identical expressions (ie they all In Computer science, instruction scheduling is a Compiler optimization used to improve instruction-level parallelism which improves performance on machines with The RTL optimizations are of less importance with the recent addition of global SSA-based optimizations on GIMPLE trees[11], as RTL optimizations have a much more limited scope, and have less high-level information. In the GNU Compiler Collection, GIMPLE is an Intermediate representation of the program in which complex expressions are split into a Three
A "reloading" phase changes abstract (pseudo-) registers into real machine registers, using data collected from the patterns describing the target's instruction set. In Computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than storage An instruction set is a list of all the instructions and all their variations that a processor can execute 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, because 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.
The primary tool to debug GCC code is the GNU Debugger (gdb). The GNU Debugger, usually called just GDB, is the standard Debugger for the GNU software system Among more specialized tools are Valgrind for finding memory errors and leaks. Valgrind is a Programming tool for memory debugging, Memory leak detection and profiling. The GNU Profiler (gprof) can find out how much time is spent in which routines, and how often they are called; this requires programs to be compiled with profiling options.
"GCC 4. 2. 1 was the last release of GCC covered by version 2 of the GNU General Public License. All subsequent releases are released under GPL version 3. " [12]