Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GNU Compiler Collection
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Free and open-source compiler for various programming languages}} {{Primary sources|date=January 2022}} {{Use mdy dates|date=March 2015}} {{Infobox software | name = GNU Compiler Collection | logo = [[File:GNU Compiler Collection logo.svg|100px]] | logo caption = | screenshot = GCC 10.2 GNU Compiler Collection self-compilation.png | caption = Screenshot of GCC 10.2 compiling its own source code | collapsible = | author = [[Richard Stallman]] | developer = [[GNU Project]] | released = {{Start date and age|1987|03|22}}<ref name="release-history">{{cite web|url=https://gnu.org/software/gcc/releases.html|title=GCC Releases|publisher=GNU Project|access-date=July 24, 2020|archive-date=June 4, 2023|archive-url=https://web.archive.org/web/20230604113400/https://www.gnu.org/software/gcc/releases.html|url-status=live}}</ref> | discontinued = | latest release version = {{wikidata|property|preferred|references|edit|Q178940|P348|P548=Q2804309}} | latest release date = {{wikidata|qualifier|preferred|single|Q178940|P348|P548=Q2804309|P577}} | latest preview version = {{wikidata|property|preferred|references|edit|Q178940|P348|P548=Q51930650}} | latest preview date = {{wikidata|qualifier|preferred|single|Q178940|P348|P548=Q51930650|P577}} | programming language = [[C (programming language)|C]], [[C++]]<ref>{{Cite web|title=GCC Coding Conventions - GNU Project|url=https://gcc.gnu.org/codingconventions.html|access-date=2022-02-07|website=gcc.gnu.org|archive-date=May 28, 2023|archive-url=https://web.archive.org/web/20230528012107/https://gcc.gnu.org/codingconventions.html|url-status=live}}</ref> | operating system = [[Cross-platform]] | platform = [[GNU]] and many others | size = ~15 million [[Source lines of code|LOC]]<ref name="loc">{{cite web|url=https://www.youtube.com/watch?v=QXwxBM4sbYM| archive-url=https://ghostarchive.org/varchive/youtube/20211107/QXwxBM4sbYM| archive-date=2021-11-07 | url-status=live|title=Cutting Edge Toolchain (Latest Features in GCC/GLIBC)|author=Víctor Rodríguez|date=2019-10-01|website=youtube.com|publisher=Linux Foundation|access-date=2021-01-19}}{{cbignore}}</ref> | language = English | genre = [[Compiler]] | license = [[GNU General Public License|GPLv3+]] with GCC Runtime Library Exception<ref>{{cite web|url=https://gnu.org/licenses/gcc-exception-3.1|title=GCC Runtime Library Exception|access-date=July 24, 2020|archive-date=March 31, 2023|archive-url=https://web.archive.org/web/20230331220440/https://www.gnu.org/licenses/gcc-exception-3.1|url-status=live}}</ref> | alexa = | website = {{URL|https://gcc.gnu.org}} }} The '''GNU Compiler Collection''' ('''GCC''') is a collection of [[compiler]]s from the [[GNU Project]] that support various [[programming language]]s, [[Computer architecture|hardware architectures]], and [[operating system]]s. The [[Free Software Foundation]] (FSF) distributes GCC as [[free software]] under the [[GNU General Public License]] (GNU GPL). GCC is a key component of the [[GNU toolchain]] which is used for most projects related to [[GNU]] and the [[Linux kernel]]. With roughly 15 million lines of code in 2019, GCC is one of the largest free programs in existence.<ref name="loc"/> It has played an important role in the growth of [[free software]], as both a tool and an example. When it was first released in 1987 by [[Richard Stallman]], GCC 1.0 was named the '''GNU C Compiler''' since it only handled the [[C (programming language)|C programming language]].<ref name="release-history" /> It was extended to compile [[C++]] in December of that year. [[Compiler#Front end|Front ends]] were later developed for [[Objective-C]], [[Objective-C++]], [[Fortran]], [[Ada (programming language)|Ada]], [[Go (programming language)|Go]], [[D (programming language)|D]], [[Modula-2]], [[Rust (programming language)|Rust]] and [[COBOL]] among others.<ref>{{cite web|url=https://gcc.gnu.org/frontends.html|title=Programming Languages Supported by GCC|access-date=2014-06-23|publisher=GNU Project|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/frontends.html|url-status=live}}</ref> The [[OpenMP]] and [[OpenACC]] specifications are also supported in the C and C++ compilers.<ref name="gcc6">{{Cite web|url=https://gcc.gnu.org/gcc-6/changes.html|title=GCC 6 Release Series — Changes, New Features, and Fixes - GNU Project|website=gcc.gnu.org|access-date=September 19, 2016|archive-date=September 22, 2016|archive-url=https://web.archive.org/web/20160922161533/http://gcc.gnu.org/gcc-6/changes.html|url-status=live}}</ref><ref name=":2">{{Cite web|url=https://gcc.gnu.org/wiki/OpenACC|title=OpenACC - GCC Wiki|website=gcc.gnu.org|access-date=September 19, 2016|archive-date=April 1, 2015|archive-url=https://web.archive.org/web/20150401174332/https://gcc.gnu.org/wiki/OpenACC|url-status=live}}</ref> As well as being the official compiler of the [[GNU operating system]], GCC has been adopted as the standard compiler by many other modern [[Unix-like]] computer [[operating system]]s, including most [[Linux]] distributions. Most [[Berkeley Software Distribution|BSD]] family operating systems also switched to GCC shortly after its release, although since then, [[FreeBSD]] and [[MacOS|Apple macOS]] have moved to the [[Clang]] compiler,<ref>{{Cite web|url=https://llvm.org/Users.html|title=The LLVM Compiler Infrastructure Project|website=llvm.org|access-date=September 24, 2021|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185909/https://llvm.org/Users.html|url-status=live}}</ref> largely due to licensing reasons.<ref>{{Cite web|title=Apple's GPLv3 purge|url=http://meta.ath0.com/2012/02/05/apples-great-gpl-purge/|access-date=2021-01-12|website=meta.ath0.com|date=February 5, 2012|language=en-us|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185910/http://meta.ath0.com/2012/02/05/apples-great-gpl-purge/|url-status=live}}</ref><ref>{{Cite web|last=Linnemann|first=Reid|date=June 20, 2012|title=Why Clang|url=https://lists.freebsd.org/pipermail/freebsd-questions/2012-June/242495.html|access-date=2021-01-12|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185910/https://lists.freebsd.org/pipermail/freebsd-questions/2012-June/242495.html|url-status=live}}</ref><ref>{{Cite web|date=2007-10-11|title=August 29, 2007: FreeBSD Foundation Newsletter, August 29, 2007|url=http://www.freebsdfoundation.org/press/2007Aug-newsletter.shtml#Letter|access-date=2021-01-12|archive-url=https://web.archive.org/web/20071011023649/http://www.freebsdfoundation.org/press/2007Aug-newsletter.shtml#Letter|archive-date=October 11, 2007}}</ref> GCC can also compile code for [[Microsoft Windows|Windows]], [[Android (operating system)|Android]], [[iOS]], [[Solaris (operating system)|Solaris]], [[HP-UX]], [[IBM AIX|AIX]] and [[DOS]].<ref>{{Cite web|title=Installing GCC: Binaries - GNU Project - Free Software Foundation (FSF)|url=https://gcc.gnu.org/install/binaries.html|access-date=2021-01-12|website=gcc.gnu.org|archive-date=January 5, 2021|archive-url=https://web.archive.org/web/20210105200706/https://gcc.gnu.org/install/binaries.html|url-status=live}}</ref> GCC has been [[porting|ported]] to more platforms and [[instruction set architecture]]s than any other compiler, and is widely deployed as a tool in the development of both free and [[proprietary software]]. GCC is also available for many [[embedded system]]s, including [[ARM architecture family|ARM]]-based and [[Power ISA]]-based chips. == History == In late 1983, in an effort to [[Bootstrapping (compilers)|bootstrap]] the [[GNU]] operating system, [[Richard Stallman]] asked [[Andrew S. Tanenbaum]], the author of the [[Amsterdam Compiler Kit]] (also known as the ''[[Vrije Universiteit Amsterdam|Free University]]'' ''Compiler Kit''), for permission to use that software for GNU. When Tanenbaum advised him that the compiler was not free, and that only the university was free, Stallman decided to work on a different compiler.<ref>{{cite book |last=von Hagen |first=William |date=2006 |title=The Definitive Guide to GCC |edition=2nd |series=Definitive Guides |publisher=Apress |isbn=978-1-4302-0219-6 |page=XXVII |quote=So he wrote to VUCK's author asking if GNU could use it. Evidently, VUCK's developer was uncooperative, responding that the university was free but that the compiler was not. |url=https://books.google.com/books?id=wQ6r3UTivJgC |access-date=September 25, 2020 |archive-date=April 5, 2024 |archive-url=https://web.archive.org/web/20240405040135/https://books.google.com/books?id=wQ6r3UTivJgC |url-status=live }}</ref> His initial plan was to rewrite an existing compiler from [[Lawrence Livermore National Laboratory]] from [[Pastel (programming language)|Pastel]] to C with some help from [[Leonard H. Tower Jr.|Len Tower]] and others.<ref name=LLLCompiler>{{cite web | last = Stallman | first = Richard | title = About the GNU Project | publisher = The GNU Project | date = September 20, 2011 | url = https://www.gnu.org/gnu/thegnuproject.html | access-date = October 9, 2011 | archive-date = August 9, 2019 | archive-url = https://web.archive.org/web/20190809050636/http://www.gnu.org/gnu/thegnuproject.html | url-status = live }}</ref><ref>{{cite journal | editor-last = Puzo | editor-first = Jerome E. | title = Gnu's Zoo | journal = GNU's Bulletin | volume = 1 | issue = 1 | date = February 1986 | publisher = Free Software Foundation | url = https://www.gnu.org/bulletins/bull1.txt | access-date = 2007-08-11 | archive-date = June 23, 2015 | archive-url = https://web.archive.org/web/20150623180723/http://www.gnu.org/bulletins/bull1.txt | url-status = live }}</ref> Stallman wrote a new C front end for the Livermore compiler, but then realized that it required megabytes of stack space, an impossibility on a [[Motorola 68000|68000]] Unix system with only 64 KB, and concluded he would have to write a new compiler from scratch.<ref name=LLLCompiler /> None of the Pastel compiler code ended up in GCC, though Stallman did use the C front end he had written.<ref name=LLLCompiler /><ref name=":6">{{cite book |last=von Hagen |first=William |date=2006 |title=The Definitive Guide to GCC |edition=2nd |series=Definitive Guides |publisher=Apress |isbn=978-1-4302-0219-6 |page=XXVII |url=https://books.google.com/books?id=wQ6r3UTivJgC |access-date=September 25, 2020 |archive-date=April 5, 2024 |archive-url=https://web.archive.org/web/20240405040135/https://books.google.com/books?id=wQ6r3UTivJgC |url-status=live }}</ref> GCC was first released March 22, 1987, available by [[File Transfer Protocol|FTP]] from [[Massachusetts Institute of Technology|MIT]].<ref>{{cite newsgroup | title = GNU C compiler beta test release | author = Richard M. Stallman (forwarded by Leonard H. Tower Jr.) | date = March 22, 1987 | newsgroup = comp.lang.c | url = https://groups.google.com/group/comp.lang.misc/msg/32eda22392c20f98 | access-date = October 9, 2011 | archive-date = June 2, 2013 | archive-url = https://web.archive.org/web/20130602041632/http://groups.google.com/group/comp.lang.misc/msg/32eda22392c20f98 | url-status = live }}</ref> Stallman was listed as the author but cited others for their contributions, including Tower for "parts of the parser, RTL generator, RTL definitions, and of the Vax machine description", Jack Davidson and [[Christopher W. Fraser]] for the idea of using [[Register transfer language|RTL]] as an intermediate language, and Paul Rubin for writing most of the preprocessor.<ref name=GccContributors>{{citation | last = Stallman | first = Richard M. | title = Using and Porting the GNU Compiler Collection (GCC) | chapter-url = https://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_23.html | publisher = Free Software Foundation, Inc. | date = June 22, 2001 | orig-year = First published 1988 | chapter = Contributors to GNU CC | page = 7 | access-date = June 18, 2015 | postscript = . | archive-date = January 18, 2023 | archive-url = https://web.archive.org/web/20230118185814/https://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_23.html | url-status = live }}</ref> Described as the "first free software hit" by [[Peter H. Salus]], the GNU compiler arrived just at the time when [[Sun Microsystems]] was unbundling its development tools from [[SunOS|its operating system]], selling them separately at a higher combined price than the previous bundle, which led many of Sun's users to buy or download GCC instead of the vendor's tools.<ref name="penguin">{{cite book |first=Peter H. |last=Salus |author-link=Peter H. Salus |title=The Daemon, the Gnu and the Penguin |chapter=Chapter 10. SUN and gcc |chapter-url=http://www.groklaw.net/article.php?story=20050525231654621 |publisher=[[Groklaw]] |year=2005 |access-date=September 14, 2015 |archive-date=June 20, 2022 |archive-url=https://web.archive.org/web/20220620020435/http://www.groklaw.net/article.php?story=20050525231654621 |url-status=live }}</ref> While Stallman considered [[GNU Emacs]] as his main project, by 1990 GCC supported thirteen computer architectures, was outperforming several vendor compilers, and was used commercially by several companies.<ref>{{cite news|last=Garfinkel|first=Simson L.|author-link=Simson Garfinkel|date=6 August 1990|title=Get ready for GNU software|page=102|newspaper=Computerworld|url=https://books.google.com/books?id=mZ0kj6qvsvYC&pg=PT101|access-date=}}</ref> === EGCS fork{{Anchor|EGCS Fork}} === As GCC was licensed under the GPL, programmers wanting to work in other directions—particularly those writing interfaces for languages other than C—were free to develop their own [[Fork (software development)|fork]] of the compiler, provided they meet the GPL's terms, including its requirements to distribute [[source code]]. Multiple forks proved inefficient and unwieldy, however, and the difficulty in getting work accepted by the official GCC project was greatly frustrating for many, as the project favored stability over new features.<ref name="egcs">{{citation | last = Henkel-Wallace | first = David | title = A new compiler project to merge the existing GCC forks | url = https://gcc.gnu.org/news/announcement.html | date = August 15, 1997 | access-date = May 25, 2012 | postscript = . | archive-date = January 18, 2023 | archive-url = https://web.archive.org/web/20230118185814/https://gcc.gnu.org/news/announcement.html | url-status = live }}</ref> The FSF kept such close control on what was added to the official version of GCC 2.x (developed since 1992) that GCC was used as one example of the "cathedral" development model in [[Eric S. Raymond]]'s essay ''[[The Cathedral and the Bazaar]]''. In 1997, a group of developers formed the ''Experimental/Enhanced GNU Compiler System{{Citation needed|date=April 2025}} (EGCS)'' to merge several experimental forks into a single project.<ref name="egcs" /><ref name=":6" /> The basis of the merger was a development snapshot of GCC (taken around the 2.7.2 and later followed up to 2.8.1 release). Mergers included g77 (Fortran), PGCC ([[P5 (microarchitecture)|P5]] [[Pentium]]-optimized GCC),<ref name=":6" /> many C++ improvements, and many new architectures and [[operating system]] variants.<ref>{{Cite web|title=The Short History of GCC development|url=http://www.softpanorama.org/People/Stallman/history_of_gcc_development.shtml|access-date=2021-01-24|website=www.softpanorama.org|archive-date=November 9, 2022|archive-url=https://web.archive.org/web/20221109211504/https://softpanorama.org/People/Stallman/history_of_gcc_development.shtml|url-status=live}}</ref> While both projects followed each other's changes closely, EGCS development proved considerably more vigorous, 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. With the release of GCC 2.95 in July 1999 the two projects were once again united.<ref>{{Cite web|title=History - GCC Wiki|url=https://gcc.gnu.org/wiki/History#Reunification|access-date=2020-09-28|website=gcc.gnu.org|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/wiki/History#Reunification|url-status=live}}</ref><ref name=":6" /> GCC has since been maintained by a varied group of programmers from around the world under the direction of a steering committee.<ref name=":0">{{Cite web|url=https://gcc.gnu.org/steering.html|title=GCC steering committee - GNU Project|website=gcc.gnu.org|access-date=July 25, 2016|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/steering.html|url-status=live}}</ref> GCC 3 (2002) removed a front-end for [[CHILL]] due to a lack of maintenance.<ref>{{cite web|title=PATCH] Remove chill|url=https://gcc.gnu.org/ml/gcc-patches/2002-04/msg00887.html|access-date=July 29, 2010|website=gcc.gnu.org|archive-date=October 20, 2016|archive-url=https://web.archive.org/web/20161020222510/https://gcc.gnu.org/ml/gcc-patches/2002-04/msg00887.html|url-status=live}}</ref> Before version 4.0 the Fortran front end was <code>g77</code>, which only supported [[FORTRAN 77]], but later was dropped in favor of the new [[GNU Fortran]] front end that supports [[Fortran 95]] and large parts of [[Fortran 2003]] and [[Fortran 2008]] as well.<ref name="gcc_wiki_f2003">{{cite web|title=Chart of Fortran 2003 Features supported by GNU Fortran|url=https://gcc.gnu.org/wiki/Fortran2003Status|access-date=2009-06-25|publisher=[[GNU]]|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/wiki/Fortran2003Status|url-status=live}}</ref><ref name="gcc_wiki_f2008">{{cite web|title=Chart of Fortran 2008 Features supported by GNU Fortran|url=https://gcc.gnu.org/wiki/Fortran2008Status|access-date=2009-06-25|publisher=[[GNU]]|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/wiki/Fortran2008Status|url-status=live}}</ref> As of version 4.8, GCC is implemented in C++.<ref>{{Cite web|url=https://gcc.gnu.org/gcc-4.8/changes.html|title=GCC 4.8 Release Series — Changes, New Features, and Fixes - GNU Project|website=gcc.gnu.org|access-date=February 17, 2015|archive-date=December 8, 2015|archive-url=https://web.archive.org/web/20151208064435/https://gcc.gnu.org/gcc-4.8/changes.html|url-status=live}}</ref> Support for [[Cilk Plus]] existed from GCC 5 to GCC 7.<ref>{{Cite web|url=https://gcc.gnu.org/gcc-5/changes.html#c-family|title=GCC 5 Release Series — Changes, New Features, and Fixes|website=gcc.gnu.org|access-date=January 13, 2022|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/gcc-5/changes.html#c-family|url-status=live}}</ref><ref>{{Cite web|url=https://gcc.gnu.org/gcc-8/changes.html|title=GCC 8 Release Series — Changes, New Features, and Fixes|website=gcc.gnu.org|access-date=January 13, 2022|archive-date=November 29, 2018|archive-url=https://web.archive.org/web/20181129002653/http://gcc.gnu.org/gcc-8/changes.html|url-status=live}}</ref> GCC has been [[porting|ported]] to a wide variety of [[instruction set architecture]]s, and is widely deployed as a tool in the development of both free and [[proprietary software]]. GCC is also available for many [[embedded system]]s, including [[Symbian]] (called ''gcce''),<ref>{{cite web|url=http://www.inf.u-szeged.hu/symbian-gcc/|title=Symbian GCC Improvement Project|access-date=2007-11-08|archive-date=August 1, 2014|archive-url=https://web.archive.org/web/20140801121616/http://www.inf.u-szeged.hu/symbian-gcc/|url-status=live}}</ref> [[ARM architecture family|ARM]]-based, and [[Power ISA]]-based chips.<ref name="Linux Board Support Packages">{{cite web|last=|first=|date=|title=Linux Board Support Packages|url=http://www.freescale.com/webapp/sps/site/overview.jsp?code=CW_BSP&fsrch=1|url-status=dead|archive-url=https://web.archive.org/web/20110607140609/http://www.freescale.com/webapp/sps/site/overview.jsp?code=CW_BSP&fsrch=1|archive-date=2011-06-07|access-date=2021-01-24|website=}}</ref> The compiler can target a wide variety of platforms, including [[video game console]]s such as the [[PlayStation 2]],<ref name=":3">{{cite web|url=http://ps2stuff.playstation2-linux.com/gcc_build.html |title=setting up gcc as a cross-compiler |work=ps2stuff |date=2002-06-08 |access-date=2008-12-12 |url-status=dead |archive-url=https://web.archive.org/web/20081211044658/http://ps2stuff.playstation2-linux.com/gcc_build.html |archive-date=December 11, 2008 }}</ref> Cell SPE of PlayStation 3,<ref name=":4">{{Cite web|url=https://gcc.gnu.org/wiki/CompileFarm|title=CompileFarm - GCC Wiki|website=gcc.gnu.org|access-date=September 19, 2016|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/wiki/CompileFarm|url-status=live}}</ref> and [[Dreamcast]].<ref name=":5">{{cite web |url=http://www.ngine.de/gccguide.html |title=sh4 g++ guide |archive-url=https://web.archive.org/web/20021220025554/http://www.ngine.de/gccguide.html |archive-date=2002-12-20 |access-date=2008-12-12 }}</ref> It has been ported to more kinds of [[central processing unit|processors]] and operating systems than any other compiler.<ref name=":1">{{cite web|last=|first=|date=|title=Linux Information Project|url=http://www.linfo.org/gcc.html|access-date=2010-04-27|website=|publisher=LINFO|quote=The GCC has been ported to (i.e., modified to run on) more than 60 platforms, which is more than for any other compiler.|archive-date=January 3, 2023|archive-url=https://web.archive.org/web/20230103063841/http://www.linfo.org/gcc.html|url-status=live}}</ref>{{Self-published inline|date=January 2021}}{{Better source needed|date=January 2021}} == Supported languages == {{As of|alt=As of the 15.1 release| 2023|04|post=,}} GCC includes front ends for [[C (programming language)|C]] (<code>gcc</code>), [[C++]] (<code>g++</code>), [[Objective-C]], [[Objective-C#Objective-C++|Objective-C++]], [[Fortran]] (<code>[[gfortran]]</code>), [[Ada (programming language)|Ada]] ([[GNAT]]), [[Go (programming language)|Go]] (<code>gccgo</code>), [[D (programming language)|D]] (<code>gdc</code>, since 9.1),<ref>{{cite web | url=https://gcc.gnu.org/gcc-9/changes.html#d | title=GCC 9 Release Series — Changes, New Features, and Fixes - GNU Project | access-date=May 7, 2019 | archive-date=February 19, 2022 | archive-url=https://web.archive.org/web/20220219120525/https://gcc.gnu.org/gcc-9/changes.html#d | url-status=live }}</ref><ref>{{Cite web|title=The D Language Front-End Finally Merged Into GCC 9 - Phoronix|url=https://phoronix.com/scan.php?page=news_item&px=GCC-9-Merges-D-Language|access-date=2021-01-19|website=phoronix.com|archive-date=May 17, 2022|archive-url=https://web.archive.org/web/20220517184343/https://www.phoronix.com/scan.php?page=news_item&px=GCC-9-Merges-D-Language|url-status=live}}</ref> [[Modula-2]] (<code>gm2</code>, since 13.1),<ref>{{cite web | url=https://gcc.gnu.org/gcc-13/changes.html#modula2 | title=GCC 13 Release Series — Changes, New Features, and Fixes - GNU Project | access-date=June 23, 2023 | archive-date=May 26, 2023 | archive-url=https://web.archive.org/web/20230526084642/http://gcc.gnu.org/gcc-13/changes.html#modula2 | url-status=live }}</ref><ref>{{Cite web |url=https://www.theregister.com/2022/12/16/gcc_13_will_support_modula2/ |title=GCC 13 to support Modula-2: Follow-up to Pascal lives on in FOSS form |date=2022-12-16 |access-date=2022-12-19 |last=Proven |first=Liam |archive-date=December 19, 2022 |archive-url=https://web.archive.org/web/20221219080641/https://www.theregister.com/2022/12/16/gcc_13_will_support_modula2/ |url-status=live }}</ref> [[Rust (programming language)|Rust]] (<code>gccrs</code>, since 15.1) and [[COBOL]] (<code>gcobol</code>, since 15.1) programming languages,<ref name=":7">{{cite web|url=https://gcc.gnu.org/frontends.html|title=GCC Front Ends|publisher=gnu.org|access-date=November 25, 2011|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/frontends.html|url-status=live}}</ref> with the [[OpenMP]] and [[OpenACC]] parallel language extensions being supported since GCC 5.1.<ref name=":2" /><ref>{{Cite web|url=https://gcc.gnu.org/gcc-5/changes.html|title=GCC 5 Release Series — Changes, New Features, and Fixes - GNU Project|website=gcc.gnu.org|access-date=April 23, 2015|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/gcc-5/changes.html|url-status=live}}</ref> Versions prior to GCC 7 also supported [[Java (programming language)|Java]] (<code>[[GNU Compiler for Java|gcj]]</code>), allowing compilation of Java to native machine code.<ref>{{cite web|title=GCC 7 Release Series|url=https://gcc.gnu.org/gcc-7/changes.html#java|access-date=March 20, 2018|publisher=gnu.org|archive-date=September 2, 2020|archive-url=https://web.archive.org/web/20200902223230/https://gcc.gnu.org/gcc-7/changes.html#java|url-status=live}}</ref> Third-party front ends exist for many languages, such as [[ALGOL 68]],<ref>{{cite web |last1=E. Marchesi |first1=Jose |title= GCC Wiki: Algol 68 Front-End |url=https://gcc.gnu.org/wiki/Algol68FrontEnd |website=gcc.gnu.org}}</ref> [[Pascal (programming language)|Pascal]] (<code>[[GNU Pascal|gpc]]</code>), [[Mercury (programming language)|Mercury]], [[Modula-3]], [[VHDL]] (<code>GHDL</code>) and [[PL/I]].<ref name=":7" /> A few experimental branches exist to support additional languages, such as the GCC [[Unified Parallel C|UPC]] compiler for [[Unified Parallel C]].<ref>{{cite web|url=http://www.gccupc.org/|title=GCC UPC (GCC Unified Parallel C)|publisher=Intrepid Technology, Inc.|date=2006-02-20|access-date=2009-03-11|archive-date=February 11, 2010|archive-url=https://web.archive.org/web/20100211142352/http://www.gccupc.org/|url-status=dead}}</ref><ref>{{Cite web|last=Spengler|first=Brad|date=12 January 2021|title=Open Source Security, Inc. Announces Funding of GCC Front-End for Rust|url=https://opensrcsec.com/open_source_security_announces_rust_gcc_funding|access-date=|website=|archive-date=April 25, 2021|archive-url=https://web.archive.org/web/20210425170408/https://opensrcsec.com/open_source_security_announces_rust_gcc_funding|url-status=live}}</ref>{{Better source needed|date=January 2021}} Regarding language version support for C++ and C, since GCC 11.1 the default target is ''gnu++17'', a superset of [[C++17]], and ''gnu11'', a superset of [[C11 (C standard revision)|C11]], with strict standard support also available. GCC also provides experimental support for [[C++20]] and [[C++23]].<ref>{{Cite web|title=C++ Standards Support in GCC|url=https://gcc.gnu.org/projects/cxx-status.html|access-date=May 17, 2021|archive-date=April 20, 2022|archive-url=https://web.archive.org/web/20220420114133/https://gcc.gnu.org/projects/cxx-status.html|url-status=live}}</ref> == Design == [[File:GCC Translation Diagram.jpg|thumb|400x400px|Overview of GCC's extended compilation pipeline, including specialized programs like the [[preprocessor]], [[Assembly language|assembler]] and [[Linker (computing)|linker]].]] [[File:Compiler design.svg|thumb|400x400px|GCC follows the 3-stage architecture typical of multi-language and multi-CPU [[compiler]]s. All [[Abstract syntax tree|program trees]] are converted to a common abstract representation at the "middle end", allowing [[Program optimization|code optimization]] and [[binary code]] generation facilities to be shared by all languages.]] GCC's external interface follows [[Unix]] conventions. Users invoke a language-specific driver program (<code>gcc</code> for C, <code>g++</code> for C++, etc.), which interprets [[Command-line argument|command arguments]], calls the actual compiler, runs the [[Assembly language assembler|assembler]] on the output, and then optionally runs the [[Linker (computing)|linker]] to produce a complete [[executable]] binary. Each of the language compilers is a separate program that reads source code and outputs [[machine code]]. All have a common internal structure. A per-language front end [[parsing|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 optimization]]s and [[static code analysis]] techniques (such as FORTIFY_SOURCE,<ref>{{cite web |url=http://fedoraproject.org/wiki/Security/Features |title=Security Features: Compile Time Buffer Checks (FORTIFY_SOURCE) |publisher=fedoraproject.org |access-date=2009-03-11 |archive-date=January 7, 2007 |archive-url=https://web.archive.org/web/20070107153447/http://fedoraproject.org/wiki/Security/Features |url-status=live }}</ref> a compiler directive that attempts to discover some [[buffer overflow]]s) are applied to the code. These work on multiple representations, mostly the architecture-independent GIMPLE representation and the architecture-dependent [[register transfer language|RTL]] representation. Finally, [[machine code]] is produced using architecture-specific [[pattern matching]] originally based on an algorithm of Jack Davidson and Chris Fraser. GCC was written primarily in [[C (programming language)|C]] except for parts of the [[Ada (programming language)|Ada]] front end. The distribution includes the standard libraries for Ada and [[C++]] whose code is mostly written in those languages.<ref>{{cite web |title=languages used to make GCC |url=http://www.ohloh.net/projects/gcc/analyses/latest |url-status=dead |archive-url=https://web.archive.org/web/20080527213819/http://www.ohloh.net/projects/gcc/analyses/latest |archive-date=May 27, 2008 |access-date=14 September 2008}}</ref>{{Update inline|date=January 2023|reason=The first time the reference was used is 2008. It seems it hasn't been updated for a long time. (A reference to the Java compiler was removed in 2021, but the rest of the paragraph hasn't been changed at least since 2013.)}} 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.<ref>{{cite web|url=https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html|title=GCC Internals|publisher=GCC.org|access-date=March 1, 2010|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html|url-status=live}}</ref> GCC uses many additional tools in its build, many of which are installed by default by many Unix and Linux distributions (but which, normally, aren't present in Windows installations), including [[Perl]],{{Explain|reason=|date=January 2021}} [[Flex lexical analyser|Flex]], [[GNU bison|Bison]], and other common tools. In addition, it currently requires three additional libraries to be present in order to build: [[GNU Multi-Precision Library|GMP]], [[Multiple Precision Complex|MPC]], and [[MPFR]].<ref>{{Cite web|title=Prerequisites for GCC - GNU Project|url=https://gcc.gnu.org/install/prerequisites.html|access-date=2021-09-05|website=gcc.gnu.org|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/install/prerequisites.html|url-status=live}}</ref> In May 2010, the GCC steering committee decided to allow use of a [[C++]] compiler to compile GCC.<ref name="gcc-c++">{{cite news | title = GCC allows C++ – to some degree | url = http://www.h-online.com/open/news/item/GCC-allows-C-to-some-degree-1012611.html | publisher = [[Heinz Heise|The H]] | date = June 1, 2010 | access-date = June 9, 2010 | archive-date = September 26, 2022 | archive-url = https://web.archive.org/web/20220926160308/http://www.h-online.com/open/news/item/GCC-allows-C-to-some-degree-1012611.html | url-status = live }}</ref> The compiler was intended to be written mostly in C plus a subset of features from C++. In particular, this was decided so that GCC's developers could use the [[Destructor (computer science)|destructors]] and [[Generic programming|generics]] features of C++.<ref>{{Cite web|url=https://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00518.html|title=Re: Efforts to attract more users?|website=lists.gnu.org|access-date=September 24, 2021|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185909/https://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00518.html|url-status=live}}</ref> In August 2012, the GCC steering committee announced that GCC now uses C++ as its implementation language.<ref>{{cite web|title=GCC 4.8 Release Series: Changes, New Features, and Fixes|url=https://gcc.gnu.org/gcc-4.8/changes.html|access-date=October 4, 2013|archive-date=December 8, 2015|archive-url=https://web.archive.org/web/20151208064435/https://gcc.gnu.org/gcc-4.8/changes.html|url-status=live}}</ref> This means that to build GCC from sources, a C++ compiler is required that understands [[C++03|ISO/IEC C++03]] standard. On May 18, 2020, GCC moved away from [[C++03|ISO/IEC C++03]] standard to [[C++11|ISO/IEC C++11]] standard (i.e. needed to compile, bootstrap, the compiler itself; by default it however compiles later versions of C++).<ref>{{cite web|title=bootstrap: Update requirement to C++11.|website=[[GitHub]]|url=https://github.com/gcc-mirror/gcc/commit/5329b59a2e13dabbe2038af0fe2e3cf5fc7f98ed|access-date=May 18, 2020|archive-date=September 29, 2022|archive-url=https://web.archive.org/web/20220929120518/https://github.com/gcc-mirror/gcc/commit/5329b59a2e13dabbe2038af0fe2e3cf5fc7f98ed|url-status=live}}</ref> === Front ends === [[File:Xxx Scanner and parser example for C.gif|thumb|right|300px|Front ends consist of [[Preprocessor|preprocessing]], [[lexical analysis]], [[Parsing|syntactic analysis]] (parsing) and semantic analysis. The goals of compiler front ends are to either accept or reject candidate programs according to the language grammar and semantics, identify errors and handle valid program representations to later compiler stages. This example shows the lexer and parser steps performed for a simple program written in [[C (programming language)|C]].]] Each [[front end (compiler)|front end]] uses a parser to produce the [[abstract syntax tree]] of a given [[source file]]. Due to the syntax tree abstraction, source files of any of the different supported languages can be processed by the same [[back end (Compiler)|back end]]. GCC started out using [[LALR parser]]s generated with [[GNU Bison|Bison]], but gradually switched to hand-written [[Recursive descent parser|recursive-descent parsers]] for C++ in 2004,<ref>{{Cite web|url=https://gcc.gnu.org/gcc-3.4/changes.html|title=GCC 3.4 Release Series — Changes, New Features, and Fixes - GNU Project|website=gcc.gnu.org|access-date=July 25, 2016|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/gcc-3.4/changes.html|url-status=live}}</ref> and for C and Objective-C in 2006.<ref>{{Cite web|url=https://gcc.gnu.org/gcc-4.1/changes.html|title=GCC 4.1 Release Series — Changes, New Features, and Fixes - GNU Project|website=gcc.gnu.org|access-date=July 25, 2016|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/gcc-4.1/changes.html|url-status=live}}</ref> As of 2021 all front ends use hand-written recursive-descent parsers. Until GCC 4.0, the tree representation of the program was not fully independent of the processor being targeted. The meaning of a tree was somewhat different for different language front ends, and front ends could provide their own tree codes. This was simplified with the introduction of GENERIC and GIMPLE, two new forms of language-independent trees that were introduced with the advent of GCC 4.0. GENERIC is more complex, based on the GCC 3.x Java front end's intermediate representation. GIMPLE is a simplified GENERIC, in which various constructs are ''[[lowering (computer science)|lowered]]'' to multiple GIMPLE instructions. The [[C (Programming Language)|C]], [[C++]], and [[Java (programming language)|Java]] front ends produce GENERIC directly in the front end. Other front ends instead have different intermediate representations after parsing and convert these to GENERIC. In either case, the so-called "gimplifier" then converts this more complex form into the simpler [[static single-assignment form|SSA]]-based GIMPLE form that is the common language for a large number of language- and architecture-independent global (function scope) optimizations. === GENERIC and GIMPLE === ''GENERIC'' is an [[intermediate representation]] language used as a "middle end" while compiling source code into [[executable|executable binaries]]. A subset, called ''GIMPLE'', is targeted by all the front ends of GCC. The middle stage of GCC does all of the code analysis and [[optimizing compiler|optimization]], working independently of both the compiled language and the target architecture, starting from the GENERIC<ref>{{Cite web|url=https://gcc.gnu.org/onlinedocs/gccint/GENERIC.html|title=GENERIC (GNU Compiler Collection (GCC) Internals)|website=gcc.gnu.org|access-date=July 25, 2016|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/onlinedocs/gccint/GENERIC.html|url-status=live}}</ref> representation and expanding it to [[register transfer language]] (RTL). The GENERIC representation contains only the subset of the imperative [[computer programming|programming]] constructs optimized by the middle end. In transforming the source code to GIMPLE,<ref>{{Cite web|url=https://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html|title=GIMPLE (GNU Compiler Collection (GCC) Internals)|website=gcc.gnu.org|access-date=July 25, 2016|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html|url-status=live}}</ref> complex [[Expression (programming)|expressions]] are split into a [[three-address code]] using [[temporary variable]]s. This representation was inspired by the SIMPLE representation proposed in the McCAT compiler<ref>{{cite web |url=http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html |title=McCAT |access-date=2017-09-14 |url-status=bot: unknown |archive-url=https://web.archive.org/web/20040812030043/http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html |archive-date=August 12, 2004 |df=mdy-all }}</ref> by Laurie J. Hendren<ref>{{Cite web|url=http://www.sable.mcgill.ca/~hendren/|title=Laurie Hendren's Home Page|website=www.sable.mcgill.ca|access-date=July 20, 2009|archive-date=September 27, 2022|archive-url=https://web.archive.org/web/20220927074148/http://www.sable.mcgill.ca/~hendren/|url-status=live}}</ref> for simplifying the analysis and [[Optimization (computer science)|optimization]] of [[Imperative programming|imperative programs]]. === Optimization === Optimization can occur during any phase of compilation; however, the bulk of optimizations are performed after the syntax and [[Semantic analysis (compilers)|semantic analysis]] of the front end and before the [[Code generation (compiler)|code generation]] of the back end; thus a common, though somewhat self-contradictory, name for this part of the compiler is the "middle end." 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. The [[Register transfer language|RTL]] optimizations are of less importance with the addition of global SSA-based optimizations on [[GIMPLE]] trees,<ref>{{cite web|url=http://www.redhat.com/magazine/002dec04/features/gcc/|title=From Source to Binary: The Inner Workings of GCC|last=Novillo|first=Diego|work=[[Red Hat#Opensource.com|Red Hat Magazine]]|date=December 2004|url-status=dead|archive-url=https://web.archive.org/web/20090401215553/http://www.redhat.com/magazine/002dec04/features/gcc/|archive-date=April 1, 2009|df=mdy-all}}</ref> as RTL optimizations have a much more limited scope, and have less high-level information. Some of these optimizations performed at this level include [[dead-code elimination]], [[partial-redundancy elimination]], [[global value numbering]], [[sparse conditional constant propagation]], and [[scalar replacement of aggregates]]. Array dependence based optimizations such as [[automatic vectorization]] and [[automatic parallelization]] are also performed. [[Profile-guided optimization]] is also possible.<ref>{{Cite web|url=https://gcc.gnu.org/install/build.html#TOC4|title=Installing GCC: Building - GNU Project|website=gcc.gnu.org|access-date=July 25, 2016|archive-date=August 22, 2023|archive-url=https://web.archive.org/web/20230822141635/http://gcc.gnu.org/install/build.html#TOC4|url-status=live}}</ref> === C++ Standard Library (libstdc++) === The GCC project includes an implementation of the [[C++ Standard Library]] called libstdc++,<ref>{{cite web|url=https://gcc.gnu.org/onlinedocs/libstdc++|title=The GNU C++ Library|publisher=GNU Project|accessdate=2021-02-21|archive-date=December 25, 2022|archive-url=https://web.archive.org/web/20221225041607/https://gcc.gnu.org/onlinedocs/libstdc++/|url-status=live}}</ref> licensed under the GPLv3 License with an exception to link non-GPL applications when sources are built with GCC.<ref>{{cite web|url=https://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html|title=License|publisher=GNU Project|accessdate=2021-02-21|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html|url-status=live}}</ref> === Other features === Some features of GCC include: ; Link-time optimization : [[Link-time optimization]] optimizes across object file boundaries to directly improve the linked binary. Link-time optimization relies on an intermediate file containing the serialization of some ''Gimple'' representation included in the object file.{{Citation needed|date=January 2016}} The file is generated alongside the object file during source compilation. Each source compilation generates a separate object file and link-time helper file. When the object files are linked, the compiler is executed again and uses the helper files to optimize code across the separately compiled object files. ; Plugins : [[Plug-in (computing)|Plugins]] extend the GCC compiler directly.<ref>{{cite web |title= Plugins |url= https://gcc.gnu.org/onlinedocs/gccint/Plugins.html |work= GCC online documentation |access-date= July 8, 2013 |archive-date= April 30, 2013 |archive-url= https://web.archive.org/web/20130430223330/http://gcc.gnu.org/onlinedocs/gccint/Plugins.html |url-status= live }}</ref> Plugins allow a stock compiler to be tailored to specific needs by external code loaded as plugins. For example, plugins can add, replace, or even remove middle-end passes operating on ''Gimple'' representations.<ref>{{cite web|last=Starynkevitch|first=Basile|title=GCC plugins thru the MELT example|url=http://gcc-melt.org/gcc-plugin-MELT-LinuxCollabSummit2014.pdf |archive-url=https://web.archive.org/web/20140413124801/http://gcc-melt.org/gcc-plugin-MELT-LinuxCollabSummit2014.pdf |archive-date=2014-04-13 |url-status=live|access-date=2014-04-10}}</ref> Several GCC plugins have already been published, notably: :* The Python plugin, which links against libpython, and allows one to invoke arbitrary Python scripts from inside the compiler. The aim is to allow GCC plugins to be written in Python. :* The MELT plugin provides a high-level [[Lisp (programming language)|Lisp]]-like language to extend GCC.<ref>{{cite web|title=About GCC MELT|url=http://gcc-melt.org/|access-date=July 8, 2013|archive-url= https://archive.today/20130704015544/http://gcc-melt.org/|archive-date=July 4, 2013|url-status=live}}</ref> : The support of plugins was once a contentious issue in 2007.<ref>{{cite web |title=GCC unplugged [LWN.net] |url=https://lwn.net/Articles/259157/ |website=lwn.net |access-date=March 28, 2021 |archive-date=November 9, 2020 |archive-url=https://web.archive.org/web/20201109001410/https://lwn.net/Articles/259157/ |url-status=live }}</ref> ; C++ [[Software transactional memory|transactional memory]] : The C++ language has an active proposal for transactional memory. It can be enabled in GCC 6 and newer when compiling with <code>-fgnu-tm</code>.<ref name="gcc6"/><ref>{{Cite web|url=https://gcc.gnu.org/wiki/TransactionalMemory|title=TransactionalMemory - GCC Wiki|website=gcc.gnu.org|access-date=September 19, 2016|archive-date=August 19, 2016|archive-url=https://web.archive.org/web/20160819055121/http://gcc.gnu.org/wiki/TransactionalMemory|url-status=live}}</ref> ; Unicode identifiers : Although the C++ language requires support for non-ASCII [[Unicode characters]] in [[Identifier (computer languages)|identifiers]], the feature has only been supported since GCC 10. As with the existing handling of string literals, the source file is assumed to be encoded in [[UTF-8]]. The feature is optional in C, but has been made available too since this change.<ref>{{Cite web|url=https://gcc.gnu.org/legacy-ml/gcc-patches/2020-01/msg01667.html|title=Lewis Hyatt - [PATCH] wwwdocs: Document support for extended identifiers added to GCC|website=gcc.gnu.org|access-date=2020-03-27|archive-date=March 27, 2020|archive-url=https://web.archive.org/web/20200327153559/https://gcc.gnu.org/legacy-ml/gcc-patches/2020-01/msg01667.html|url-status=live}}</ref><ref>{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3146.html|title=Recommendations for extended identifier characters for C and C++|website=www.open-std.org|access-date=2020-03-27|archive-date=September 30, 2020|archive-url=https://web.archive.org/web/20200930152408/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3146.html|url-status=live}}</ref> ; C extensions : GNU C extends the C programming language with several non-standard-features, including [[nested function]]s.<ref>{{Cite web|title=C Extensions (Using the GNU Compiler Collection (GCC))|url=https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html|access-date=2022-01-12|website=gcc.gnu.org|archive-date=January 12, 2022|archive-url=https://web.archive.org/web/20220112203037/https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html|url-status=live}}</ref> == Architectures == [[File:GCC DJGPP Windows.png|thumb|249x249px|GCC compiling [["Hello, World!" program|Hello World]] on [[Microsoft Windows|Windows]]]] The primary supported (and best tested) processor families are 64- and 32-bit ARM<!-- arch64 and arm-->, 64- and 32-bit [[x86 64]] and [[x86]]<!-- aka e.g. i686 --> and 64-bit [[PowerPC]] and [[SPARC]].<ref>{{Cite web |date=2022-10-26 |title=GCC 12 Release Criteria |url=https://gcc.gnu.org/gcc-12/criteria.html |access-date=2023-01-27 |website=gcc.gnu.org |archive-date=January 27, 2023 |archive-url=https://web.archive.org/web/20230127213916/https://gcc.gnu.org/gcc-12/criteria.html |url-status=live }}</ref> <!-- Notably absent from primary list is e.g. RISC-V and MIPS has been moved to secondary, but the latter has been tested for a long time, and both may actually work well, not sure. Nor sure what to read into OS support, known to work for e.g. Windows (i686-pc-cygwin, i686-mingw32 also 64-bit?): https://gcc.gnu.org/gcc-12/criteria.html The primary platforms are: aarch64-none-linux-gnu arm-linux-gnueabi i586-unknown-freebsd i686-pc-linux-gnu powerpc64-unknown-linux-gnu powerpc64le-unknown-linux-gnu sparc-sun-solaris2.11 x86_64-pc-linux-gnu The secondary platforms are: aarch64-elf i686-apple-darwin i686-pc-cygwin i686-mingw32 powerpc-ibm-aix7.1.0.0 s390x-linux-gnu mips64-linux-gnu --> GCC target processor families as of version 11.1 include:<ref>{{Cite web|title=Option Summary (Using the GNU Compiler Collection (GCC))|url=https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Option-Summary.html#Option-Summary|access-date=2020-08-21|website=gcc.gnu.org|archive-date=January 18, 2023|archive-url=https://web.archive.org/web/20230118185814/https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Option-Summary.html#Option-Summary|url-status=live}}</ref> {{div col|colwidth=15em|small=no}} * [[AArch64]] * [[DEC Alpha|Alpha]] * [[ARM architecture family|ARM]] * [[Atmel AVR|AVR]] * [[Blackfin]] * [[eBPF]] * [[Adapteva#Products|Epiphany]] (GCC 4.8) * [[Hitachi H8|H8/300]] * [[HC12]] * [[IA-32]] (32-bit [[x86]]) * [[IA-64]] (Intel Itanium) * [[MIPS architecture|MIPS]] * [[Motorola 68000 series]] * [[MSP430]] * [[Nvidia GPU]] * [[Nvidia PTX]] * [[PA-RISC]] * [[PDP-11]] * [[PowerPC]] * [[R8C]] / [[M16C]] / [[M32C]] * [[RISC-V]] * [[SPARC]] * [[SuperH]] * [[System/390]] / [[z/Architecture]] * [[VAX]] * [[x86-64]] {{Refend}} Lesser-known target processors supported in the standard release have included: {{div col|colwidth=15em|small=no}} * [[68HC11]] * [[A29K]] * [[C6x]] * [[CR16]] * [[D30V]] * [[DSP16xx]] * [[ETRAX CRIS]] * [[Fujitsu FR|FR-30]] * [[FR-V]] * [[IBM ROMP]] * [[Intel i960]] * [[IP2000]] * [[M32R]] * [[MCORE]] * [[MIL-STD-1750A]] * [[MMIX]] * [[MN10200]] * [[MN10300]] * [[Motorola 88000]] * [[NS320xx|NS32K]] * [[RL78]] * [[Stormy16]] * [[V850]] * [[Xtensa]] {{Refend}} Additional processors have been supported by GCC versions maintained separately from the FSF version: {{div col|colwidth=15em|small=no}} * [[Cortus APS3]] * [[ARC (processor)|ARC]] * [[AVR32]] * [[C166]] and [[C167]] * [[D10V]] * [[EISC]] * [[eSi-RISC]] * [[Hexagon (processor)|Hexagon]]<ref>{{Cite web |url=https://www.codeaurora.org/xwiki/bin/Hexagon/ |title=Hexagon Project Wiki |url-status=dead |access-date=May 19, 2011 |archive-url=https://web.archive.org/web/20120323192748/https://www.codeaurora.org/xwiki/bin/Hexagon/ |archive-date=March 23, 2012}}</ref> * [[LatticeMico32]] * [[LatticeMico8]] * [[MeP]] * [[MicroBlaze]] * [[Motorola 6809]] * [[MSP430]] * [[NEC SX architecture]]<ref>{{Cite web|url=https://code.google.com/archive/p/sx-gcc|title=Google Code Archive - Long-term storage for Google Code Project Hosting.|website=code.google.com|access-date=September 24, 2021|archive-date=September 25, 2022|archive-url=https://web.archive.org/web/20220925035202/https://code.google.com/archive/p/sx-gcc|url-status=live}}</ref> * [[Nios II]] and [[Nios embedded processor|Nios]] * [[OpenRISC]] * [[PDP-10]] * [[PIC30#PIC24 and dsPIC 16-bit microcontrollers|PIC24/dsPIC]] * [[PIC30#PIC32 32-bit microcontrollers|PIC32]] * [[Parallax Propeller|Propeller]] * [[HP Saturn|Saturn]] (HP48XGCC) * [[System/370]] * TIGCC ([[m68k]] variant) * [[TMS9900]] * [[TriCore]] * [[Z8000]] * [[ZPU (microprocessor)|ZPU]] {{Refend}} The [[GNU Compiler for Java|GCJ]] Java compiler can target either a native machine language architecture or the [[Java virtual machine]]'s [[Java bytecode]].<ref>{{cite web|url=https://gcc.gnu.org/java/|title=The GNU Compiler for the Java Programming Language|access-date=2010-04-22|url-status=dead|archive-url=https://web.archive.org/web/20070509055923/http://gcc.gnu.org/java/|archive-date=May 9, 2007|df=mdy-all}}</ref> When [[retargetable compiler|retargeting]] GCC to a new platform, [[bootstrapping (compilers)|bootstrapping]] is often used. Motorola 68000, Zilog Z80, and other processors are also targeted in the GCC versions developed for various Texas Instruments, Hewlett Packard, Sharp, and Casio programmable graphing calculators.<ref>graphing calculators#programming</ref> == License == GCC is licensed under the [[GNU General Public License]] version 3.<ref>{{Cite web|url=https://gcc.gnu.org/onlinedocs/gcc/Copying.html#Copying|title=Using the GNU Compiler Collection|website=gnu.org|access-date=2019-11-05|archive-date=November 16, 2023|archive-url=https://web.archive.org/web/20231116021350/https://gcc.gnu.org/onlinedocs/gcc/Copying.html#Copying|url-status=live}}</ref> The ''GCC runtime exception'' permits compilation of proprietary programs (in addition to free software) with GCC headers and runtime libraries. This does not impact the license terms of GCC source code.<ref>{{cite web|publisher=FSF|title=GCC Runtime Exception|url=https://www.gnu.org/licenses/gcc-exception|access-date=2014-04-10|archive-date=April 16, 2014|archive-url=https://web.archive.org/web/20140416192813/https://www.gnu.org/licenses/gcc-exception|url-status=live}}</ref> == See also == {{Portal|Free and open-source software|Computer programming}} * [[List of compilers]] * [[MinGW]] * [[LLVM]]/[[Clang]] == References == {{Reflist}} == Further reading == * ''[https://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/ Using the GNU Compiler Collection (GCC)]'', Free Software Foundation, 2008. * ''[https://gcc.gnu.org/onlinedocs/gccint/ GNU Compiler Collection (GCC) Internals]'', Free Software Foundation, 2008. * ''[https://archive.today/20121205072412/http://www.network-theory.co.uk/gcc/intro/ An Introduction to GCC]'', Network Theory Ltd., 2004 (Revised August 2005). {{ISBN|0-9541617-9-3}}. * Arthur Griffith, ''GCC: The Complete Reference''. McGraw Hill / Osborne, 2002. {{ISBN|0-07-222405-3}}. == External links == {{Commons}} {{Wikibooks|GNU C Compiler Internals}} === Official === * {{official website}} * [https://gcc.gnu.org/releases.html GCC Release Timeline] * [https://gcc.gnu.org/develop.html#timeline GCC Development Plan] === Other === * [http://www.cse.iitb.ac.in/grc/ Collection of GCC 4.0.2 architecture and internals documents] at I.I.T. Bombay * {{cite news |date=March 2, 2006 |title=New GCC Heavy on Optimization |publisher= internetnews.com |last= Kerner |first=Sean Michael |url = http://www.internetnews.com/dev-news/article.php/3588926 |postscript=none}} * {{cite news |date=April 22, 2005 |title=Open Source GCC 4.0: Older, Faster |publisher=internetnews.com |last=Kerner |first=Sean Michael |url=http://www.internetnews.com/dev-news/article.php/3499881 |postscript=none |access-date=October 21, 2006 |archive-date=September 17, 2006 |archive-url=https://web.archive.org/web/20060917233745/http://www.internetnews.com/dev-news/article.php/3499881 |url-status=dead }} * [https://web.archive.org/web/20090401215553/http://www.redhat.com/magazine/002dec04/features/gcc/ From Source to Binary: The Inner Workings of GCC], by Diego Novillo, ''[[Red Hat#Opensource.com|Red Hat Magazine]]'', December 2004 * [http://gcc.gnu.org/pub/gcc/summit/2003/GENERIC%20and%20GIMPLE.pdf A 2003 paper on GENERIC and GIMPLE] * [https://web.archive.org/web/20171022105307/http://www.toad.com/gnu/cygnus/index.html Marketing Cygnus Support], an essay covering GCC development for the 1990s, with 30 monthly reports for in the "Inside Cygnus Engineering" section near the end * [http://oldhome.schmorp.de/egcs.html EGCS 1.0 announcement] * [https://gcc.gnu.org/egcs-1.0/features.html EGCS 1.0 features list] * [http://linuxmafia.com/faq/Licensing_and_Law/forking.html Fear of Forking], an essay by Rick Moen recording seven well-known forks, including the GCC/EGCS one {{GNU}} {{FOSS}} {{Authority control}} [[Category:1987 software]] [[Category:C (programming language) compilers]] [[Category:C++ compilers]] [[Category:Compilers]] [[Category:Cross-platform free software]] [[Category:Fortran compilers]] [[Category:Free and open source compilers]] [[Category:GNU Project software|Compiler Collection]] [[Category:Java development tools]] [[Category:Pascal (programming language) compilers]] [[Category:Software that was rewritten in C++]] [[Category:Free software programmed in C++]] [[Category:Software using the GNU General Public License]] [[Category:Unix programming tools]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:As of
(
edit
)
Template:Authority control
(
edit
)
Template:Better source needed
(
edit
)
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite news
(
edit
)
Template:Cite newsgroup
(
edit
)
Template:Cite web
(
edit
)
Template:Commons
(
edit
)
Template:Div col
(
edit
)
Template:Explain
(
edit
)
Template:FOSS
(
edit
)
Template:GNU
(
edit
)
Template:ISBN
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main other
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Primary sources
(
edit
)
Template:Refend
(
edit
)
Template:Reflist
(
edit
)
Template:Self-published inline
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Template other
(
edit
)
Template:Update inline
(
edit
)
Template:Use mdy dates
(
edit
)
Template:Wikibooks
(
edit
)