Internals of GCC

This week we listened to a podcast with Morgan Deters, which talked about the internals of one of the most famous compilers, GCC (GNU Compiler Collection), which in fact contains several compilers, and other components as we are going to discuss later.
The first thing to note is that GCC is in fact a set of different tools chained smartly together by a “Driver” program that identifies the input, and provide the needed linker, and compiler flags to successfully add all libraries, code, assemblies, and specifications needed to generate a final object program output; also it contains several language-specific frontends to optimally handle C, C++, Java, and other languages.
What I think is most interesting about GCC, is that it has a three level structure that provides a robust way of handling different scenarios through a set of modules. The front-end receives the code, and through language-specific extensions prepares the code to be passes to the middleware, it “de-objectizes” the code for example, easing the creating of a “gcc--“ that can be deployed in other architectures then. The middleware creates a tree-like structure that represents the entire logic oh the program but “extracting” all language-specific implementations, translating everything to an internal common language representation. The final phase translates this common language to specific architecture instructions that can be interpreted natively, but first it detects certain flaws, or caveats that can be improved in the code, reordering the code instructions, adding or deleting loops, and sometimes even replacing known code snippets for well-known equivalent ones known to run faster or better in certain scenarios.
What I liked about this podcast is that the host, and guest have a very good English dictions that eases understating the topic, also the conversations seems well structured and can be followed without much problems, however, at the end of the program it seems like the conversation easily gets confusing as they start commenting about the source tree structure, and what files are important, something that cannot be pictured easily if we are not familiar with the actual codebase of the project, which would be helpful.

0 comentarios:

Publicar un comentario

 
Copyright © Compilers Blogger Theme by BloggerThemes & newwpthemes Sponsored by Internet Entrepreneur