๐ŸŒ
GitHub
github.com โ€บ gcc-mirror โ€บ gcc
GitHub - gcc-mirror/gcc
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details.
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%
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)
๐ŸŒ
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.
Discussions

Guide to GCC source?
I found the repo a bit off-putting Hence LLVM! I'm mostly interested in codegen, e.g., what register allocation algorithms are implemented. GCC's register allocators are called IRA and LRA. If you search on the page you link you'll see those modules. IRA is the main one and it does have some high-level documentation. https://github.com/gcc-mirror/gcc/blob/efcd941e86b507d77e90a1b13f621e036eacdb45/gcc/ira.c#L21-L363 More on reddit.com
๐ŸŒ r/Compilers
5
17
February 8, 2021
Where can I find the source code of C language itself?
If you are interested in looking through a C compiler codebase, I highly recommend LCC: https://github.com/drh/lcc GCC and Clang are (overly) complex for what they provide. If you would like more of a guide through it, there is also a book counterpart to the codebase: https://drh.github.io/lcc/ Finally, the compiler itself is the easy part, emitting x86/x86_64 instructions is where it starts to get very complex. For this reason, I really recommend Q3VM ( https://github.com/jnz/q3vm ). It is a single file VM (originally written for Quake III) which interprets fantasy but greatly simplified instructions from a slightly modified LCC compiler (also part of the project). This might be very useful to learn from. Finally, if you want to see an entire toolchain built from scratch (including standard C library), you might be interested in my GCC based megadrive compiler build scripts: https://github.com/osen/mdcc More on reddit.com
๐ŸŒ r/C_Programming
18
7
July 29, 2021
Where to start reading GCC source??
Start here: https://gcc.gnu.org/onlinedocs/gccint/ More on reddit.com
๐ŸŒ r/gcc
4
5
October 13, 2017
GCC will now need C++ to build
This isn't a surprise announcement; development has been heading that way for a while. And as complex as the C standard has become, it's a necessary thing to deal with that complexity. Still, there's a part of me that still admires the elegance of a c-based, c-compiler like pcc. Yes, I know pcc is basically dead and isn't feature complete. I'm just getting wistful for a time of a simpler C compiler... a time that clearly doesn't exist any more. More on reddit.com
๐ŸŒ r/programming
283
375
August 15, 2012
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

๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ GNU_Compiler_Collection
GNU Compiler Collection - Wikipedia
3 weeks ago - 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 (FSF) distributes GCC as free software under the GNU General ...
๐ŸŒ
YouTube
youtube.com โ€บ ants are everywhere
Let's read the GCC source code - YouTube
In this live stream, I start looking at the source for the GNU Compiler Collection, better known as GCC.
Published ย  February 14, 2023
Views ย  2K
Find elsewhere
๐ŸŒ
GNU
ftp.gnu.org โ€บ gnu โ€บ gcc
Index of /gnu/gcc
Index of /gnu/gcc ยท Apache/2.4.52 (Trisquel_GNU/Linux) Server at ftp.gnu.org Port 443
๐ŸŒ
Narkive
gcc.gcc.gnu.narkive.com โ€บ q2CaPOAd โ€บ understanding-source
Understanding gcc source
Post by Hari I am trying to understand the source code of Gcc because I want to learn its control flow . I am basically concentrating on the order in which Gcc compiler consults its different source files like toplev.c ,expr.c ..e.t.c. Please see the gcc documentation that comes with the gcc sources.
๐ŸŒ
Quora
quora.com โ€บ How-could-something-as-big-and-complex-as-the-GCC-source-code-be-maintained
How could something as big and complex as the GCC source code be maintained? - Quora
Answer (1 of 3): You use a source control system. You keep the parts in the source control system and it tracks what you have changed so that you donโ€™t have to. Thatโ€™s another part of Vladislav Zorovโ€™s answer. After you have abstracted something. You have turned GCC into many small parts.
๐ŸŒ
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 ...
๐ŸŒ
Internet Archive
archive.org โ€บ software
gcc-12.2.0 source code : GNU Project : Free Download, Borrow, and Streaming : Internet Archive
August 19, 2022 - 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...
๐ŸŒ
Pepas
leopard-adc.pepas.com โ€บ documentation โ€บ DeveloperTools โ€บ gcc-4.2.1 โ€บ gcc โ€บ Source-Code.html
Source Code - Using the GNU Compiler Collection (GCC)
The source code for released versions of Apple's GCC is available at `http://www.opensource.apple.com/darwinsource/', in `.tar.gz' format.
๐ŸŒ
Linux From Scratch
linuxfromscratch.org โ€บ blfs โ€บ view โ€บ svn โ€บ general โ€บ gcc.html
GCC-15.2.0
The GCC package contains the GNU Compiler Collection. This page describes the installation of compilers for the following languages: C, C++, Fortran, Objective C, Objective C++, Go, and Modula2.
๐ŸŒ
Quora
quora.com โ€บ How-can-I-view-the-source-code-for-a-C-compiler
How to view the source code for a C compiler - Quora
Answer (1 of 6): What about to try some open source one. Do not start with the big ones like gcc.gnu.org Git - gcc.git/summary or llvm/llvm-project. These are too big to comprehend on first try. You may try something more easy like IanHarvey/pcc or davidgiven/ack.
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ cpp โ€บ config-mingw
Using GCC with MinGW
November 3, 2021 - When you make changes here, VS Code writes them to a file called c_cpp_properties.json in the .vscode folder. Here, we've changed the Configuration name to GCC, set the Compiler path dropdown to the g++ compiler, and the IntelliSense mode to match the compiler (gcc-x64).
๐ŸŒ
GitHub
gist.github.com โ€บ yosoufe โ€บ ad45f45c10fe08abecbf53000d0d199f
Compile and install gcc-9.3.0 ยท GitHub
Compile and install gcc-9.3.0. GitHub Gist: instantly share code, notes, and snippets.
๐ŸŒ
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
However, we usually compile each of the source files separately into object file, and link them together in the later stage. In this case, changes in one file does not require re-compilation of the other files. > g++ -c file1.cpp > g++ -c file2.cpp > g++ -o myprog.exe file1.o file2.o ยท To compile and link C/C++ program into a shared library (".dll" in Windows, ".so" in Unixes), use -shared option. Read "Java Native Interface" for example. GCC compiles a C/C++ program into executable in 4 steps as shown in the above diagram.
๐ŸŒ
Medium
medium.com โ€บ @darrenjs โ€บ building-gcc-from-source-dcc368a3bb70
Building GCC from source. Step by step guide on building GCC 9 | by Darren Smith | Medium
June 2, 2019 - GCCโ€™s build system has a helpful feature for building these dependencies. If the source code for a dependency is placed within the GCC source code folder, it will be automatically discovered and compiled during the main build of GCC.
๐ŸŒ
LinuxQuestions.org
linuxquestions.org โ€บ questions โ€บ programming-9 โ€บ gcc-v1-0-open-source-588177
GCC v1.0 open source
Hello, Can you anyone help me to get GCC v1.0 open source? I would like to understand about compilers. Please let me know. Thanks in advance. Thanks,