0% found this document useful (0 votes)
61 views

GCC - 1

Uploaded by

Parth9
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

GCC - 1

Uploaded by

Parth9
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

What is GCC??

 A set of compilers produced for various


programming languages under the GNU
Project.
 A standard compiler for modern Unix-like
computer operating systems, including Linux,
the BSD family.
 GCC has been ported widely deployed as
a tool in commercial, proprietary and close
source software development environments.
GNU COMPILER COLLECTION

 Developed by :- GNU
 Latest release :- 4.3.0 (5 March
2008)
 OS :- Cross-platform
 Genre :- Compiler
 License :- GNU, General Public
License.
 Website :- http://gcc.gnu.org
HISTORY

 GCC was started by Richard Stallman in 1985.


 Earlier GCC was GNU C compiler. .
 Rewritten in C by Len Tower and
Stallman,and released in 1987.
 A compiler for the GNU Project, in order to
have a compiler available that was free
software.
 Its development was supervised by the Free
Software Foundation.
LANGUAGES SUPPORTED

 The standard compiler release 4.2


includes front ends for: C, C++(G++),
Java(GCJ)…many more…!

 GFortran front end that supports


Fortran 95.

 A front end for CHILL was included.


GCC -STRUCTURE
GCC's external interface is generally standard
for a Unix compiler.
Users invoke a driver program named ‘gcc’,
which interprets command arguments, decides
which language compilers to use for each input
file.

STRUCTURE

FRONT END MIDDLE END BACK END


FRONT-END
 The part of the compiler that is language specific
is called the front end.
 Frontends vary internally, having to produce trees that can be
 A per-language front end parses the source code
handled by the backend. The parsers are hand-coded
in that descent
recursive language (C,C++,Java) and produces an
parsers.
abstract syntax tree (“C tree" ), and a back end
converts these trees to GCC's Register Transfer
Language (RTL).
MIDDLE-END
 This part is not language dependent.
 New forms of language independent trees were
introduced in 2005.
The behavior
Parsing of thedone
is now GCC back
by end is partly specified
converting thesebylanguage
preprocessor macros and functions specific to a target
dependent trees
architecture, for (“Ctotrees”)into
instance Generic
define the endianness, trees
word
which are
size, and language
calling independent
conventions in this middle trees.
end.
 Compiler optimizations & static code analysis
techniques is performed.The so called
“Gimplifier”Simplifies
BACK-END
9

 After having SSA-


based optimizations
on Gimple trees.
RTL optimizations is
done which changes
the abstract
registers into real
machine registers
(i.e.machine
code).During the
Reloading Phase,
 While Reloading the
code into the
OPTIMIZATION
 Optimization on trees does not generally fit
into what most compiler developers would
consider a front end task, as it is not language
dependent and does not involve parsing.
 These optimizations include dead code
elimination, partial redundancy elimination,
global value numbering, sparse conditional
constant propagation.
 Array dependence based optimizations such as
automatic vectorization are currently being
developed.
DEBUGGING GCC PROGRAMS
 The primary tool for debugging GCC code is the
GNU Debugger (gdb).

 Among more specialized tools are Val grind for


finding memory errors and leaks.

 The GNU Profiler can be used to find out how


much time is spent in which routines, and how
often they are called; this requires compiling
programs with special profiling options
APPLICATIONS
 GCC is compiler of choice for developing

software ,required to execute on a wide


Variety of hardware. By using GCC,if the code
compiles on one, chances are high that it
compiles on all.
 GCC is maintained by a varied group of
programmers,used for various kind of
processors and operating systems.
 GCC is used in popular embedded platforms.
CONFESSIONS
This is the compilation work done in
Accordance with………

http://gcc.gnu.org/

 Richard M. Stallman :: Using and


Porting the GNU Compiler Collection,
Free Software Foundation.

 Richard M. Stallman :: Using Gcc: The


Gnu Compiler Collection Reference,
Free Software Foundation.
Thanking You all…

Submitted by: Special Thanks to:


Shiv nandan Upadhyay
Parth Joshi Miss Archana Mam.
Manish Jain Faculty,OST
Prashant Yadav GIT.
Anshul Bansal
Harshit Vijay 03/22/10
03/22/10

You might also like