SlideShare a Scribd company logo
2012
Saket Kr. Pathak
Software developer
3D Graphics




GNU GCC - what just a compiler...?
A quick lookup of overview in reference of GCC that is GNU Compiler Collection.
GNU GCC - what just a compiler...?

Among all of us, we had learnt or studied about compilers and languages supported by
these compilers from last few days (*whatever days might be in multiple of 365 ... :) )
and most of us had specific paper entitled as "Compiler Design" ... or any other name
having similar sense or content of syllabus. That's really great mate, because I never got
that type of fortunate chance to study "Compiler Designing" and all. Whatever ... it's all
my interest and fortunate time that I found some thing valuable as well as sensible to
learn and study.

How many of times any one asked you in which compiler you work ... this question
belong to all studying professional and stud fellows? Even I had asked a few times, and
most of the time, I replied the answer to the question.

And my answer was, GNU GCC or VC++ as per environment matters. Today I realized
this is quite foolish answer as ... If some one asked you about the flavor of coffee (in
reference of dating friend) ... and you replied ... The coffee was good ... what a sense of
humor ... haaa haa. :)

So I realized it and studied my answer in reference of... GNU GCC compiler.
It's basically GCC, stands for GNU Compiler Collection. Originally named the GNU
C Compiler, because it only handled the C programming language, GCC 1.0 was
released in 1987, and the compiler was extended to compile C++ in December of that
year. Later on it is embed with compilers concern to languages like Objective-C,
Objective-C++, Fortran, Java, Ada, and Go etc.

Now since it's a collection of compilers so It can't be the exact answer as the question is
about the type and version of your compiler. So In reference of C++ we have a specific
name for the compiler embed within this GC Collection and that is G++, similarly in
reference of C we have a specific name as GNU C Compiler (i.e GCC). A lot of other
languages with there compiler are supported by GCC and are listed as bellow:



Seq.   Language                                Compiler
1.     C                                       gcc
2.     C++                                     g++
3.     Objective-C                             gobjc
4.     Fortran                                 gFortran
5.     Java                                    gcj
6.     Ada                                     GNAT
7.     Go                                      gccgo
8.     Pascal                                  gpc
9.     Mercury                                 Mercury
10.    PL/I                                    PL/1
11.    VHDL                                    GHDL



Saket Kr. Pathak                                                                       Page 2
GNU GCC - what just a compiler...?

Basically GNU Project has some component modules, that I found to discuss here as
some add-on, because. I thought how this big list of Compilers is going to handle within
a single GNU tool chain for all compiler logic, programming libraries and their syntax.
Then I found quite intellectual overview of GCC architecture that is basically categorized
into 3 hierarchical modules and each compiler includes the following three components:
a Front End, a Middle End, and a Back End. GCC compiles one file at a time. A source
file goes through all three components one after another. These three components are
discussed in bit details as follows:



GCC basic components
Front-End   The purpose of the front end is to read the source file, parse it, and convert it into
            the standard Abstract Syntax Tree (AST) representation. There is one front end
            for each programming language. Because of the differences in languages, the
            format of the generated ASTs is slightly different for each language. The next
            step after AST generation is the unification step in which the AST tree is
            converted into a unified form called Generic.
Middle-End The middle end part of the compiler takes control. First, the tree is converted into
            another representation called GIMPLE. In this form, each expression contains no
            more than three operands, all control flow constructs are represented as
            combinations of conditional statements and goto operators, arguments of a
            function call can only be variables. GIMPLE is a convenient representation for
            optimizing the source code. After GIMPLE, the source code is converted into the
            Static Single Assignment (SSA) representation i.e. each variable is assigned to
            only once, but can be used at the right hand side of an expression any time. GCC
            performs more than 20 different optimizations on SSA trees. The tree is converted
            back to the GIMPLE form which is then used to generate a Register-Transfer
            Language (RTL) form of a tree. RTL is a hardware-based representation that
            corresponds to abstract target architecture with an infinite number of registers. An
            RTL optimization pass optimizes the tree in the RTL form.
Back-End    Finally, a GCC back-end generates the assembly code for the target architecture
            using the RTL representation. Examples of back-ends are x86 back end, mips
            back end, etc.




Saket Kr. Pathak                                                                           Page 3
GNU GCC - what just a compiler...?

Hence from the above short-descriptions we have the overview of all the three
components.




Front-End:

Frontends vary internally, having to produce trees that can be handled by the backend.
Currently, the parsers are all hand-coded recursive descent parsers, though there is
no reason why a parser generator could not be used for new front-ends in the future
hence, version 2 of the C compiler used a bison based grammar. Here 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 usually implements one of
the production rules of the grammar, whereas GNU bison, commonly known as Bison,
is a parser generator that is part of the GNU Project. Bison reads a specification of a
context-free language, warning about any parsing ambiguities, and generates a parser
(either in C, C++, or Java) which reads sequences of tokens and decides whether the
sequence conforms to the syntax specified by the grammar.

Then as it converts the source file to abstract syntax tree which has somewhat different
meaning 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
lowered to multiple GIMPLE instructions. The C, C++ and 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.

Middle-end:

As it takes control, GENERIC that is an intermediate representation language used as a
"middle-end" while compiling source code into executable binaries. A subset, called
GIMPLE, is targeted by all the front-ends of GCC. So it’s responcible for all the code
analysis and optimization, working independently of both the compiled language and

Saket Kr. Pathak                                                                  Page 4
GNU GCC - what just a compiler...?

the target architecture, starting from the GENERIC representation and expanding it to
Register Transfer Language. The GENERIC representation contains only the subset of
the imperative programming constructs optimized by the middle-end. In transforming
the source code to GIMPLE, complex expressions are split into a three address code
using temporary variables. This representation was inspired by the SIMPLE
representation proposed in the McCAT compiler by Laurie J. Hendren for simplifying
the analysis and optimization of imperative programs.

As it performs optimization that occurs during any phase of compilation, however the
bulk of optimizations are performed after the syntax and semantic analysis of the front-
end and before the code generation of the back-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 sub-expression elimination,
instruction scheduling, and so forth. The RTL optimizations are of less importance
with the addition of global SSA-based optimizations on GIMPLE trees. 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.

Back-end:

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 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. At any moment, the
actual RTL instructions forming the program representation have to comply with the
machine description of the target architecture. At the end of compilation, valid RTL is
further reduced to a strict form in which each instruction refers to real machine
registers and real instructions from the target's instruction set. Forming strict RTL is a
very complicated task, done mostly by the register allocation first but completed only by
a separate "reloading" phase which 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.

Compatible IDEs
Integrated development environments written for GNU/Linux and some for other
operating systems support GCC. These include:
    Anjuta
    Code::Blocks
    CodeLite
    Dev-C++
    Eclipse
    geany

Saket Kr. Pathak                                                                    Page 5
GNU GCC - what just a compiler...?

       KDevelop
       Net Beans
       Qt Creator
       Xcode

Hmmm ... So please never tell any one like fool ... "I use to work on GNU GCC" ... be
specific with GNU C Compiler/G++ for C/C++ receptively. A few links I would like to
mention here, If any of you people like to read about GNU project in bit detail can
definitely enjoy your time with these all ... But I know ... you are Quite busy ... :) ...
whatever ...




References:
http://en.wikipedia.org/wiki/GNU_Project
http://en.wikipedia.org/wiki/GNU_Compiler_Collection#cite_note-8
http://gcc.gnu.org/frontends.html
http://en.wikipedia.org/wiki/GNU_Compiler_Collection
http://www.enotes.com/topic/GNU_Compiler_Collection
http://www.enotes.com/topic/GNU_Compiler_Collection#Back-end



Saket Kr. Pathak                                                                       Page 6

More Related Content

What's hot (20)

PDF
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
corehard_by
 
PPTX
C compilation process
RajKumar Rampelli
 
PPTX
Web technology slideshare
GuruAbirami2
 
PDF
Golang execution modes
Ting-Li Chou
 
PPTX
C++ compilation process
Rahul Jamwal
 
ODP
IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...
Mickael Istria
 
PPTX
Debugging With GNU Debugger GDB
kyaw thiha
 
PPTX
Gnu debugger
Gizem Çetin
 
PPT
Debugging Applications with GNU Debugger
Priyank Kapadia
 
PPT
Syncevolution: Open Source and Funambol
Funambol
 
PPTX
Advanced Debugging with GDB
David Khosid
 
PPTX
Introduction to c programming
Alpana Gupta
 
PDF
LLVM Compiler - Link Time Optimization
Vivek Pansara
 
PPTX
Introduction to C Programming by Subid Biswas
Subid Biswas
 
PDF
Turbo C Compiler Reports
Sunil Kumar R
 
PPTX
Autotools pratical training
Thierry Gayet
 
PDF
Usage of GDB
Jongseok Choi
 
PDF
GDB Rocks!
Kent Chen
 
PDF
10 reasons to be excited about go
Dvir Volk
 
PDF
Golang
Felipe Mamud
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
corehard_by
 
C compilation process
RajKumar Rampelli
 
Web technology slideshare
GuruAbirami2
 
Golang execution modes
Ting-Li Chou
 
C++ compilation process
Rahul Jamwal
 
IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...
Mickael Istria
 
Debugging With GNU Debugger GDB
kyaw thiha
 
Gnu debugger
Gizem Çetin
 
Debugging Applications with GNU Debugger
Priyank Kapadia
 
Syncevolution: Open Source and Funambol
Funambol
 
Advanced Debugging with GDB
David Khosid
 
Introduction to c programming
Alpana Gupta
 
LLVM Compiler - Link Time Optimization
Vivek Pansara
 
Introduction to C Programming by Subid Biswas
Subid Biswas
 
Turbo C Compiler Reports
Sunil Kumar R
 
Autotools pratical training
Thierry Gayet
 
Usage of GDB
Jongseok Choi
 
GDB Rocks!
Kent Chen
 
10 reasons to be excited about go
Dvir Volk
 
Golang
Felipe Mamud
 

Similar to GNU GCC - what just a compiler...? (20)

PPSX
Compilers
Jayanga V. Liyanage
 
PDF
The compilation process
Alexander Bollbach
 
PDF
Os Lattner
oscon2007
 
PDF
Declare Your Language: What is a Compiler?
Eelco Visser
 
PDF
不深不淺,帶你認識 LLVM (Found LLVM in your life)
Douglas Chen
 
PDF
How it's made: C++ compilers (GCC)
Sławomir Zborowski
 
PDF
List of programming_languages_by_type
Phoenix
 
PDF
Embedded Linux On A R M
Emanuele Bonanni
 
PPTX
Compiler Construction
Ahmed Raza
 
PPT
Classification Of Software
py7rjs
 
PPTX
Java vs .net
Tech_MX
 
PPTX
2. introduction to compiler
Saeed Parsa
 
PDF
Language translators
Aditya Sharat
 
PPTX
Unit i
vijay gupta
 
PDF
C programming part1
Gaddam Kowshik
 
PPTX
Linux Simple Introduction
JohnMihaya
 
PDF
C language in our world 2015
Juraj Michálek
 
PDF
Compiler Construction | Lecture 1 | What is a compiler?
Eelco Visser
 
PDF
Linux programming
Abhinav Upadhyay
 
PPT
From gcc to the autotools
Thierry Gayet
 
The compilation process
Alexander Bollbach
 
Os Lattner
oscon2007
 
Declare Your Language: What is a Compiler?
Eelco Visser
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
Douglas Chen
 
How it's made: C++ compilers (GCC)
Sławomir Zborowski
 
List of programming_languages_by_type
Phoenix
 
Embedded Linux On A R M
Emanuele Bonanni
 
Compiler Construction
Ahmed Raza
 
Classification Of Software
py7rjs
 
Java vs .net
Tech_MX
 
2. introduction to compiler
Saeed Parsa
 
Language translators
Aditya Sharat
 
Unit i
vijay gupta
 
C programming part1
Gaddam Kowshik
 
Linux Simple Introduction
JohnMihaya
 
C language in our world 2015
Juraj Michálek
 
Compiler Construction | Lecture 1 | What is a compiler?
Eelco Visser
 
Linux programming
Abhinav Upadhyay
 
From gcc to the autotools
Thierry Gayet
 
Ad

More from Saket Pathak (14)

DOCX
Wan Important Questions
Saket Pathak
 
DOC
Wan notes
Saket Pathak
 
DOCX
C++ lab assignment
Saket Pathak
 
DOCX
Data Structure in C (Lab Programs)
Saket Pathak
 
DOCX
A Guy and gal in STL
Saket Pathak
 
DOCX
Lab. Programs in C
Saket Pathak
 
PDF
C++ friendship
Saket Pathak
 
DOCX
C++ Template
Saket Pathak
 
DOC
Copy constructor
Saket Pathak
 
DOCX
Malloc, calloc, realloc
Saket Pathak
 
PPT
Recursion in c
Saket Pathak
 
PDF
Pointers in c
Saket Pathak
 
DOCX
C++ diamond problem
Saket Pathak
 
PPTX
Multiple inheritance in c++
Saket Pathak
 
Wan Important Questions
Saket Pathak
 
Wan notes
Saket Pathak
 
C++ lab assignment
Saket Pathak
 
Data Structure in C (Lab Programs)
Saket Pathak
 
A Guy and gal in STL
Saket Pathak
 
Lab. Programs in C
Saket Pathak
 
C++ friendship
Saket Pathak
 
C++ Template
Saket Pathak
 
Copy constructor
Saket Pathak
 
Malloc, calloc, realloc
Saket Pathak
 
Recursion in c
Saket Pathak
 
Pointers in c
Saket Pathak
 
C++ diamond problem
Saket Pathak
 
Multiple inheritance in c++
Saket Pathak
 
Ad

Recently uploaded (20)

PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Next level data operations using Power Automate magic
Andries den Haan
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 

GNU GCC - what just a compiler...?

  • 1. 2012 Saket Kr. Pathak Software developer 3D Graphics GNU GCC - what just a compiler...? A quick lookup of overview in reference of GCC that is GNU Compiler Collection.
  • 2. GNU GCC - what just a compiler...? Among all of us, we had learnt or studied about compilers and languages supported by these compilers from last few days (*whatever days might be in multiple of 365 ... :) ) and most of us had specific paper entitled as "Compiler Design" ... or any other name having similar sense or content of syllabus. That's really great mate, because I never got that type of fortunate chance to study "Compiler Designing" and all. Whatever ... it's all my interest and fortunate time that I found some thing valuable as well as sensible to learn and study. How many of times any one asked you in which compiler you work ... this question belong to all studying professional and stud fellows? Even I had asked a few times, and most of the time, I replied the answer to the question. And my answer was, GNU GCC or VC++ as per environment matters. Today I realized this is quite foolish answer as ... If some one asked you about the flavor of coffee (in reference of dating friend) ... and you replied ... The coffee was good ... what a sense of humor ... haaa haa. :) So I realized it and studied my answer in reference of... GNU GCC compiler. It's basically GCC, stands for GNU Compiler Collection. Originally named the GNU C Compiler, because it only handled the C programming language, GCC 1.0 was released in 1987, and the compiler was extended to compile C++ in December of that year. Later on it is embed with compilers concern to languages like Objective-C, Objective-C++, Fortran, Java, Ada, and Go etc. Now since it's a collection of compilers so It can't be the exact answer as the question is about the type and version of your compiler. So In reference of C++ we have a specific name for the compiler embed within this GC Collection and that is G++, similarly in reference of C we have a specific name as GNU C Compiler (i.e GCC). A lot of other languages with there compiler are supported by GCC and are listed as bellow: Seq. Language Compiler 1. C gcc 2. C++ g++ 3. Objective-C gobjc 4. Fortran gFortran 5. Java gcj 6. Ada GNAT 7. Go gccgo 8. Pascal gpc 9. Mercury Mercury 10. PL/I PL/1 11. VHDL GHDL Saket Kr. Pathak Page 2
  • 3. GNU GCC - what just a compiler...? Basically GNU Project has some component modules, that I found to discuss here as some add-on, because. I thought how this big list of Compilers is going to handle within a single GNU tool chain for all compiler logic, programming libraries and their syntax. Then I found quite intellectual overview of GCC architecture that is basically categorized into 3 hierarchical modules and each compiler includes the following three components: a Front End, a Middle End, and a Back End. GCC compiles one file at a time. A source file goes through all three components one after another. These three components are discussed in bit details as follows: GCC basic components Front-End The purpose of the front end is to read the source file, parse it, and convert it into the standard Abstract Syntax Tree (AST) representation. There is one front end for each programming language. Because of the differences in languages, the format of the generated ASTs is slightly different for each language. The next step after AST generation is the unification step in which the AST tree is converted into a unified form called Generic. Middle-End The middle end part of the compiler takes control. First, the tree is converted into another representation called GIMPLE. In this form, each expression contains no more than three operands, all control flow constructs are represented as combinations of conditional statements and goto operators, arguments of a function call can only be variables. GIMPLE is a convenient representation for optimizing the source code. After GIMPLE, the source code is converted into the Static Single Assignment (SSA) representation i.e. each variable is assigned to only once, but can be used at the right hand side of an expression any time. GCC performs more than 20 different optimizations on SSA trees. The tree is converted back to the GIMPLE form which is then used to generate a Register-Transfer Language (RTL) form of a tree. RTL is a hardware-based representation that corresponds to abstract target architecture with an infinite number of registers. An RTL optimization pass optimizes the tree in the RTL form. Back-End Finally, a GCC back-end generates the assembly code for the target architecture using the RTL representation. Examples of back-ends are x86 back end, mips back end, etc. Saket Kr. Pathak Page 3
  • 4. GNU GCC - what just a compiler...? Hence from the above short-descriptions we have the overview of all the three components. Front-End: Frontends vary internally, having to produce trees that can be handled by the backend. Currently, the parsers are all hand-coded recursive descent parsers, though there is no reason why a parser generator could not be used for new front-ends in the future hence, version 2 of the C compiler used a bison based grammar. Here 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 usually implements one of the production rules of the grammar, whereas GNU bison, commonly known as Bison, is a parser generator that is part of the GNU Project. Bison reads a specification of a context-free language, warning about any parsing ambiguities, and generates a parser (either in C, C++, or Java) which reads sequences of tokens and decides whether the sequence conforms to the syntax specified by the grammar. Then as it converts the source file to abstract syntax tree which has somewhat different meaning 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 lowered to multiple GIMPLE instructions. The C, C++ and 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. Middle-end: As it takes control, GENERIC that is an intermediate representation language used as a "middle-end" while compiling source code into executable binaries. A subset, called GIMPLE, is targeted by all the front-ends of GCC. So it’s responcible for all the code analysis and optimization, working independently of both the compiled language and Saket Kr. Pathak Page 4
  • 5. GNU GCC - what just a compiler...? the target architecture, starting from the GENERIC representation and expanding it to Register Transfer Language. The GENERIC representation contains only the subset of the imperative programming constructs optimized by the middle-end. In transforming the source code to GIMPLE, complex expressions are split into a three address code using temporary variables. This representation was inspired by the SIMPLE representation proposed in the McCAT compiler by Laurie J. Hendren for simplifying the analysis and optimization of imperative programs. As it performs optimization that occurs during any phase of compilation, however the bulk of optimizations are performed after the syntax and semantic analysis of the front- end and before the code generation of the back-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 sub-expression elimination, instruction scheduling, and so forth. The RTL optimizations are of less importance with the addition of global SSA-based optimizations on GIMPLE trees. 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. Back-end: 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 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. At any moment, the actual RTL instructions forming the program representation have to comply with the machine description of the target architecture. At the end of compilation, valid RTL is further reduced to a strict form in which each instruction refers to real machine registers and real instructions from the target's instruction set. Forming strict RTL is a very complicated task, done mostly by the register allocation first but completed only by a separate "reloading" phase which 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. Compatible IDEs Integrated development environments written for GNU/Linux and some for other operating systems support GCC. These include:  Anjuta  Code::Blocks  CodeLite  Dev-C++  Eclipse  geany Saket Kr. Pathak Page 5
  • 6. GNU GCC - what just a compiler...?  KDevelop  Net Beans  Qt Creator  Xcode Hmmm ... So please never tell any one like fool ... "I use to work on GNU GCC" ... be specific with GNU C Compiler/G++ for C/C++ receptively. A few links I would like to mention here, If any of you people like to read about GNU project in bit detail can definitely enjoy your time with these all ... But I know ... you are Quite busy ... :) ... whatever ... References: http://en.wikipedia.org/wiki/GNU_Project http://en.wikipedia.org/wiki/GNU_Compiler_Collection#cite_note-8 http://gcc.gnu.org/frontends.html http://en.wikipedia.org/wiki/GNU_Compiler_Collection http://www.enotes.com/topic/GNU_Compiler_Collection http://www.enotes.com/topic/GNU_Compiler_Collection#Back-end Saket Kr. Pathak Page 6