GCC
By the GNU Project
GCC (the GNU Compiler Collection) is a free, open-source suite of compilers originally created for the C programming language and since extended to support C++, Fortran, Ada, Go, and other languages. It translates source code into native…
Definition
GCC (the GNU Compiler Collection) is a free, open-source suite of compilers originally created for the C programming language and since extended to support C++, Fortran, Ada, Go, and other languages. It translates source code into native machine code for a very wide range of processor architectures and operating systems, and has served as the default system compiler for most Linux distributions and many embedded platforms for decades.
Overview
GCC began as the compiler for the GNU operating system project, created to provide a fully free-software alternative to the proprietary Unix compilers of the era. Its scope grew from a C-only compiler into a genuine compiler collection, adding frontends for C++, Objective-C, Fortran, Ada, Go, and D, while sharing a common backend responsible for optimization and code generation across all of them. That growth is why the project is named a 'collection' rather than a single-language compiler. Mechanically, GCC is organized into per-language frontends that parse source into a shared intermediate representation (GIMPLE and later RTL), which the shared backend then optimizes and lowers into machine code for the target architecture. This separation is what lets a single GCC installation support dozens of source languages and hundreds of target processors—from x86 and ARM to microcontroller architectures—without each language frontend needing its own optimizer or code generator, since new architecture support is added once in the backend and becomes available to every frontend language. GCC's closest counterpart is Clang/LLVM, which emerged partly as a response to GCC's historically monolithic, less modular internal architecture; LLVM was designed from the start with reusable libraries and clearer intermediate representations that external tools can hook into, whereas GCC's internals were for a long time harder for third-party tooling to consume. In recent years GCC has narrowed that gap with better diagnostics and some modularization, but Clang remains generally preferred where tooling integration matters more than raw platform breadth. In practice, GCC remains the default or a primary compiler on most Linux distributions, is heavily used for embedded and cross-compilation targets via toolchains like `arm-none-eabi-gcc`, and underlies build systems for the Linux kernel itself, which has historically required GCC-specific extensions (though Clang compatibility has since improved). Developers invoke it directly as `gcc` or `g++`, or indirectly through build systems like Make, CMake, and Autotools, and distribution package maintainers rely on it to rebuild enormous volumes of existing open-source software consistently. The trade-offs against newer alternatives include somewhat less friendly diagnostic messages compared to Clang, historically slower compile times on some workloads, and a codebase that is harder to extend with custom plugins than LLVM's library-based design. For projects prioritizing precise, colorized error messages or static-analysis tooling built on a compiler library, Clang is often chosen instead, while GCC remains preferred for its unmatched breadth of target architecture support and its decades-long track record on Unix-like systems.
Key Features
- Compiles C, C++, Fortran, Ada, Go, and other languages to native code
- Supports an unusually wide range of target processor architectures
- Uses a shared GIMPLE/RTL intermediate representation across language frontends
- Serves as the default toolchain on most Linux distributions
- Provides extensive cross-compilation support for embedded targets
- Includes aggressive optimization passes such as link-time optimization
- Distributed as free software under the GNU General Public License
- Integrates with standard Unix build tooling like Make and Autotools