If you can't read please download the document
Upload
alberto-bustamante-reyes
View
1.976
Download
2
Embed Size (px)
Citation preview
2. Brief introduction
3. Distributed by FSF under GPL License 4. Written in C / C++ 5. Default compiler for Unix and Mac OS X 6. Also ported to Windows (MinGW) 7. Brief introduction
8. Several front-ends added to support different languages:
10. Objective-C / Objective-C++(gobjc / gobjc++ ) 11. Fortran(gfortran) 12. Structure
15. Back end 16. Structure
Source code AST RTL RTL Object code FRONT END BACK END 17. Structure
Source code AST RTL RTL Object code FRONT END BACK END 18. Structure
Source code AST RTL RTL Object code FRONT END BACK END SSA Tree project: OPTIMIZATIONS 19. Structure
Source code AST GENERIC GIMPLE RTL FRONT END 20. Structure
Source code AST GENERIC GIMPLE RTL FRONT END Language dependent Language independent 21. Structure
Source code AST GENERIC GIMPLE RTL FRONT END Language dependent Language independent MIDDLE END 22. Structure: GENERIC & GIMPLE
GIMPLE GENERIC 23. Structure: GENERIC & 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: t3 = b b = b + 1 c = t3 / a goto L3 L2: L3: return c 24. Structure: GENERIC & GIMPLE
25. SSA
27. Example: y := 1 y := 2 x := y y1 := 1 y2 := 2 x1 := y2 28. Structure: Middle end GIMPLETree SSA OptimizerRTL 29. Structure:Middle end
y := 1 y := 2 x := y y1 := 1 y2 := 2 x1 := y2 30. Structure:Middle end
if (some_condition) { // some code y = x + 4; }else { // other code } z = x + 4; if (some_condition) { // some code y = x + 4; t = y; }else { // other code t = x + 4; } z = t; 32. Structure:Middle end
34. Global value numbering w := 3 x := 3 y := x + 4 z := w + 4 w := 3 x := w y := w + 4 z := y 35. Structure:Middle end
37. Global value numbering 38. Sparse conditional constant propagation 39. Structure:Middle end
41. Global value numbering 42. Sparse conditional constant propagation 43. Scalar replacement of aggregates 44. Structure: RTL
45. Processor dependent 46. Looks like Lisp S-expressions: (set:SI (reg:SI 140) (plus:SI (reg:SI 138) (reg:SI 139))) 47. Structure: summary Source code AST GENERIC GIMPLETree SSA Optimizer RTL Optimized RTLObject code FRONT END MIDDLE END BACK END 48. Advantages of using GCC
50. One of the most popular compilers 51. Lots of test cases (users)
52. Free!! 53. More information available at
54. GCC Wiki :http://gcc.gnu.org/wiki 55. SSA Tree Project:http://gcc.gnu.org/projects/tree-ssa/ 56. GNU :http://www.gnu.org 57. Free Software Foundation :http://www.fsf.org 58. MinGW:http://www.mingw.org 59. The End Thanks for watching 60. GCC : GNU compilers collection Alberto Bustamante Reyes (www.albertobustamante.com) Author: