GCC : GNU compilers collection Alberto Bustamante Reyes (  www.albertobustamante.com  ) Author:
Brief introduction Compiler system developed by GNU Project
Distributed by FSF under GPL License
Written in C / C++
Default compiler for Unix and Mac OS X
Also ported to Windows (MinGW)
Brief introduction Originally developed for C language
Several front-ends added to support different languages: C / C++  (gcc / g++)
Java  (gcj)
Objective-C / Objective-C++  (gobjc / gobjc++ )
Fortran  (gfortran)
Structure Generic compiler: Front end
Back end GCC compiler: Front end
Middle end
Back end
Structure GCC Compiler (before 2005) Source code AST RTL RTL Object code FRONT END BACK END
Structure GCC Compiler (before 2005) Source code AST RTL RTL Object code FRONT END BACK END
Structure GCC Compiler (before 2005) Source code AST RTL RTL Object code FRONT END BACK END SSA Tree project: OPTIMIZATIONS
Structure GCC Compiler (after 2005) Source code AST GENERIC GIMPLE RTL FRONT END
Structure GCC Compiler (after 2005) Source code AST GENERIC GIMPLE RTL FRONT END Language dependent Language independent
Structure GCC Compiler (after 2005) Source code AST GENERIC GIMPLE RTL FRONT END Language dependent Language independent MIDDLE END
Structure: GENERIC & GIMPLE Why two kinds of trees? GIMPLE is a simplified subset of GENERIC GIMPLE GENERIC
Structure: GENERIC & GIMPLE GENERIC -> (Gimplifier) -> GIMPLE GIMPLIFIER if (foo ( a + b, c)) c = b ++ / a end if return c t1 = a +b t2 = foo (t1, c) If (t2 != 0 ) <L1, L2>  L1: t3 = b b = b + 1 c = t3 / a goto L3 L2: L3: return c
Structure: GENERIC & GIMPLE Developed by SSA Tree Project
SSA Developed by IBM in 1980

GCC, GNU compiler collection