๐ŸŒ
GNU
gcc.gnu.org
GCC, the GNU Compiler Collection - GNU Project
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Objective-C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, and Algol 68 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system.
Installing GCC
The latest version of this document is always available at https://gcc.gnu.org/install/. It refers to the current development sources, instructions for specific released versions are included with the sources.
GCC mirror sites
Include the URL of the gcc.gnu.org mirror area, the country/city where the mirror is located, and a contact e-mail address (and name if appropriate).
GCC Releases
GCC releases may be downloaded from our mirror sites. Important: these are source releases, so will be of little use if you do not already have a C++ compiler installed. As one option, there are pre-compiled binaries.
Downloading GCC
The source distribution includes the Ada, C, C++, Objective-C, COBOL (GCC 15 and later), D (GCC 9 and later), Fortran, Go, Modula-2 (GCC 13 and later) and Algol 68 (GCC 16 and later, experimental) compilers, as well as runtime libraries for C++, Objective-C, COBOL, Fortran and Algol 68.
optimizing compiler produced by the GNU Project, key component of the GNU tool-chain and standard compiler for most projects related to GNU and the Linux kernel.
GCC_10.2_GNU_Compiler_Collection_self-compilation.png
gcc 11 1 0 compiling chicken screenshot
The GNU Compiler Collection (GCC) (formerly GNU C Compiler) is a collection of compilers from the GNU Project that support various programming languages, hardware architectures, and operating systems. The Free Software Foundation โ€ฆ Wikipedia
Factsheet
Original author Richard Stallman
Developer GNU Project
Initial release March 22, 1987; 38 years ago (1987-03-22)
Factsheet
Original author Richard Stallman
Developer GNU Project
Initial release March 22, 1987; 38 years ago (1987-03-22)
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ GNU_Compiler_Collection
GNU Compiler Collection - Wikipedia
3 weeks ago - Users invoke a language-specific driver program (gcc for C, g++ for C++, etc.), which interprets command arguments, calls the actual compiler, runs the assembler on the output, and then optionally runs the linker to produce a complete executable binary. Each of the language compilers is a separate program that reads source code and outputs machine code.
๐ŸŒ
GNU
gcc.gnu.org โ€บ install โ€บ download.html
Downloading GCC - GNU Project
The source distribution includes the Ada, C, C++, Objective-C, COBOL (GCC 15 and later), D (GCC 9 and later), Fortran, Go, Modula-2 (GCC 13 and later) and Algol 68 (GCC 16 and later, experimental) compilers, as well as runtime libraries for C++, Objective-C, COBOL, Fortran and Algol 68.
๐ŸŒ
GitHub
github.com โ€บ gcc-mirror โ€บ gcc
GitHub - gcc-mirror/gcc
The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs.
Starred by 10.7K users
Forked by 4.7K users
Languages ย  C++ 30.1% | C 29.3% | Ada 14.0% | D 5.9% | Go 5.3% | HTML 3.6%
๐ŸŒ
Opensource.com
opensource.com โ€บ article โ€บ 22 โ€บ 5 โ€บ gnu-c-compiler
A programmer's guide to GNU C Compiler | Opensource.com
Compilation: During this stage, the compiler converts pre-processed source code into assembly code for a specific CPU architecture. The resulting assembly file is named with a .s extension, such as hellogcc.s in this example.
๐ŸŒ
Wikihow
wikihow.com โ€บ computers and electronics โ€บ software โ€บ programming โ€บ c programming languages โ€บ how to compile a c program using the gnu compiler (gcc)
How to Compile a C Program Using the GNU Compiler (GCC)
September 27, 2006 - Type gcc --version and press Enter to verify your installation. ... Go to the directory that contains your source code. Use the cd command to change to the directory in which you've saved the source code you want to compile.
๐ŸŒ
NTU
www3.ntu.edu.sg โ€บ home โ€บ ehchua โ€บ programming โ€บ cpp โ€บ gcc_make.html
GCC and Make - A Tutorial on how to compile, link and build C/C++ applications
-std=c++2a, or -std=gnu++2a (C++2a with GNU extensions), experimental. GNU Toolchain, including GCC, is included in all Unixes. It is the standard compiler for most Unix-like operating systems. Open a Terminal, and enter "gcc --version". If gcc is not installed, the system will prompt you to ...
Find elsewhere
๐ŸŒ
GitHub
github.com โ€บ topics โ€บ gcc-compiler
gcc-compiler ยท GitHub Topics ยท GitHub
c-plus-plus json neon x64 clang cpp11 simd json-parser avx2 json-pointer arm64 aarch64 avx512 gcc-compiler sse42 risc-v vs2019 clang-cl loongarch64 loongarch ... GCC patched to build illumos, including the patches from Codesourcery/Sun Microsystems used in the 3.4.3 and 4.3.3 shipped with Solaris
๐ŸŒ
GitHub
github.com โ€บ vegesm โ€บ first-cc-gcc
GitHub - vegesm/first-cc-gcc: The first C compiler made to work under modern GCC
A port of the earliest C compiler to modern GCC. The compiler outputs PDP-11 assembly code that can be compiled and run on a PDP-11 emulator (check out c72 if you want x86 code that runs on current Linux).
Starred by 166 users
Forked by 9 users
Languages ย  C 77.4% | Assembly 20.3% | Shell 1.7% | Makefile 0.6%
๐ŸŒ
GitHub
github.com โ€บ anthropics โ€บ claudes-c-compiler
GitHub - anthropics/claudes-c-compiler: Claude Opus 4.6 wrote a dependency-free C compiler in Rust, with backends targeting x86 (64- and 32-bit), ARM, and RISC-V, capable of compiling a booting Linux kernel.
Tests are run by compiling main.c with ccc, executing the resulting binary, and comparing stdout and the exit code against the expected files. ... src/ Compiler source code (Rust) frontend/ C source -> typed AST (preprocessor, lexer, parser, sema) ir/ Target-independent SSA IR (lowering, mem2reg) passes/ SSA optimization passes (15 passes + shared loop analysis) backend/ IR -> assembly -> machine code -> ELF (4 architectures) common/ Shared types, symbol table, diagnostics driver/ CLI parsing, pipeline orchestration include/ Bundled C headers (x86 SIMD: SSE through AVX-512, AES-NI, FMA, SHA, BMI2; ARM NEON) tests/ Compiler tests (each test is a directory with main.c and expected output) ideas/ Future work proposals and improvement notes
Starred by 2.4K users
Forked by 178 users
Languages ย  Rust 96.2% | C 3.8%
๐ŸŒ
Wikibooks
en.wikibooks.org โ€บ wiki โ€บ GNU_C_Compiler_Internals
GNU C Compiler Internals - Wikibooks, open books for an open world
GCC 3.0 which is considered modern history for the C++ compiler was released on June 18, 2001. Additional branches were created later on. As of now, the active development branches are GCC 3.4 with a latest release on November 30, 2005, and GCC 4.0 released last time on September 28, 2005. GCC 4.1 was released on Feb 28 2006. GCC 4.2 is the development branch of GCC. The source code repository is available online.
๐ŸŒ
SourceForge
sourceforge.net โ€บ projects โ€บ gcc-win64
gcc-win64 download | SourceForge.net
Download gcc-win64 for free. x64 build of GCC for Windows. x64 C/C++ compiler for Windows using (unofficial build): - gmp - mpfr - mpc - isl - cloog - mingw-w64 - gcc - seh You need at least core2 command set support to run this application. Note that every version with bundled gdb needs at ...
Top answer
1 of 2
12

The .md (machine description) files of GCC source contain stuff to generate assembly. GCC contains several specialized C/C++ code generators (and some of them translates the .md files into code emitting assembly).

GCC is a very complex program. The documentation of GCC MELT (an obsolete project) contains several interesting links and slides, notably refering to the Indian GCC Resource Center

Most of the optimizations in GCC happens in the middle-end (which is mostly independent of source language or target system), notably with many passes working on the Gimple representations.

The GCC repo is an SVN repository.

See also this answer, notably the pictures inside it.

2 of 2
5

The actual source code for GCC is most accessible from here:

https://gcc.gnu.org/svn.html

The software is accessible via SVN (subversion), a source code control system. This would be installed on many versions of Linux/UNIX, but if not on your platform, you can install the svn kit and then fetch the source using the following command:

svn checkout svn://gcc.gnu.org/svn/gcc/trunk SomeLocalDir

GCC is complex and would take significant experience to understand the nature of how the application actually compiles to different architectures.

In a nutshell, GCC has three major components - front-end, middle and back-end processing. The front-end processor has the component of the language parsing to understand the syntax of languages (like C, C++, Objective-C, etc). The front-end deconstructs the code to a portable construct which is then passed to the back-end for compilation to the target environment.

The middle part performs code analysis and optimisation, attempting to prioritise the code to generate the best possible output at the end of the full process. Technically, optimisation can occur at any part of the process as patterns are discovered during analysis.

The back-end processor compiles the code to a tree-style output format (not actually final executable code). Based on what the expected output is designed to be, the "pseudo-code" is optimised for using registers, bit-sizes, endian-ness, and so on. The final code is then generated during the assembly phase, which converts the back-end code into machine executable instructions.

It's important to note that the compiler has many options to deal with output formats so you can create output to many classes of architecture, usually out of the box. For cross-compiling and target compiler options, try checking out this link:

https://gcc.gnu.org/install/configure.html

๐ŸŒ
Red Hat
docs.redhat.com โ€บ en โ€บ documentation โ€บ red_hat_enterprise_linux โ€บ 7 โ€บ html โ€บ developer_guide โ€บ gcc-compiling-code
Chapter 15. Building Code with GCC | Developer Guide | Red Hat Enterprise Linux | 7 | Red Hat Documentation
Source code written in the C or C++ language, present as plain text files. The files typically use extensions such as .c, .cc, .cpp, .h, .hpp, .i, .inc. For a complete list of supported extensions and their interpretation, see the gcc manual pages: ... Copy to Clipboard Copied!
๐ŸŒ
RapidTables
rapidtables.com โ€บ code โ€บ linux โ€บ gcc.html
GCC C compiler
GCC is a short of GNU Compiler Collection, a C compiler for Linux. gcc syntax ยท gcc options ยท gcc examples ยท gcc code generator ยท $ gcc [options] [source files] [object files] [-o output file] GCC main options: Compile file1.c and file2.c and link to output file execfile: $ gcc file1.c file2.c -o execfile ยท
๐ŸŒ
Ubuntu
documentation.ubuntu.com โ€บ ubuntu-for-developers โ€บ tutorials โ€บ gcc-use
Develop with GCC on Ubuntu - Ubuntu for Developers
October 24, 2025 - gcc can compile source code in many programming languages, including C, C++, and Assembly. The compiler guesses the language based on the file extension (for example, .c, .cpp, or .s).
๐ŸŒ
Internet Archive
archive.org โ€บ software
gcc-12.2.0 source code : GNU Project : Free Download, Borrow, and Streaming : Internet Archive
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,...). GCC...
๐ŸŒ
Wikibooks
en.wikibooks.org โ€บ wiki โ€บ GNU_C_Compiler_Internals โ€บ GNU_C_Compiler_Architecture
GNU C Compiler Internals/GNU C Compiler Architecture - Wikibooks, open books for an open world
It is a driver program that invokes the appropriate compilation programs depending on the language of the source file. For a C source file they are the preprocessor and compiler cc1, the assembler as, and the linker collect2. The first and the third programs come with a GCC distribution, the ...
๐ŸŒ
ScienceDirect
sciencedirect.com โ€บ topics โ€บ computer-science โ€บ gcc-compiler
Gcc Compiler - an overview | ScienceDirect Topics
The GNU Compiler Collection (GCC) is widely recognized as an open-source set of compilers supporting multiple programming languages, including C, C++, Objective-C, Ada, Fortran, and Java, and functions as a cross-compiler for numerous architectures such as x86, x86-64, ARM, and RISC-V. 2 GCC ...