Advanced Compiler

2003 Fall, NTU CSIE

Instructor: 陳俊良(Chuen-Ling Chen)
Lecture Time: 9:00 ~ 12:00 Monday
Lecture Place: CSIE Building 309
TA: 洪資涵(Tzu-Han Hung)
Last Modified: 2004/1/10

News
Date News
2003/11/26 Past presentation data can be found at the Presentations area below.
2003/11/25 Those who have made their presentation can send me your files now. Your package should contain topic-related files such as slide and/or source code, and please zip your file and send me only file: Student_ID.zip. (If you would like to post your personal homepage, please also specify in email).
2003/10/6 Not familiar with compiler anymore? Check the Compiler Design (2003 Spring) course homepage for more teaching slides.
2003/9/26 If you want to send mails, please follow these rules.
(1) Keep [AdvComp] is your mail subject.
(2) To contact the instructor, send mail to clchen@csie.ntu.edu.tw
(3) To contact the TA, send mail to r91059@csie.ntu.edu.tw
(4) To submit homework or ask general questions, send mail to comp2@csie.ntu.edu.tw
2003/9/25 The Advanced Compiler (2003 Fall) course homepage is now on-line at http://www.csie.ntu.edu.tw/~comp2.


Instructor Materials
Date Descrpitions
2003/9/22 (week 02) (1) The lecture note on 22 September. Click.
(2) The make log of instructor. Click (zip).
(3) The modified file "genconditions.c" (for Cygwin). Click.
(4) The modified file "gensupport.c" (for Cygwin). Click.
2003/9/29 (week 03) (1) The lecture note on 29 September. Click.
(2) sed script for parsing log. Click (sed).
(3) sed script for converting tree structure into html format. Click (sed). Warning: Don't read this script with your browser.
2003/10/6 (week 04) (1) Review on bottom-up parser. Click (ppt).
2003/10/13 (week 05) (1) Experiment on the GCC parsing tree. Click (zip).
2003/10/20 (week 06) (1) Lecture notes and some modified source files. Click (zip).
2003/11/10 (week 09) (1) Lecture notes and some modified source files. Click (zip).


Presentations
Date Topic Speaker
2003/11/17 (week 10) Tree Inlining 江盈宏(Ying-Hung Jiang)
2003/11/24 (week 11) GCJ: Introduction 高孟駿
2003/11/24 (week 11) Basic Block Manipulation 陳建智
2003/12/1 (week 12) Sibling Call Optimization 高逸明(Yi-Ming Kao)
2003/12/1 (week 12) Common Subexpression Elimination 曾清旭
2003/12/8 (week 13) GCJ: libgcj 劉家瑋(Chia-Wei Liu)
2003/12/8 (week 13) Loop Optimization 張錦文
2003/12/15 (week 14) GCJ: Between Tree and ByteCode 蔡方培(Fang-Pei Tsai)
2003/12/29 (week 16) Build GCC Cross Compiler for a Specify CPU 吳嘉村(Chia-Tsun Wu)


Homework Assignments
Note: Homework should be (if necessary) sent to comp2@csie.ntu.edu.tw with [AdvComp] in the mail subject. And please perform virus-scan before sending out. Thanks.
Date Descrpitions
2003/9/15 (week 01) Homework 1: Please install GCC successfully on your platform, and modify "main.c" so that your name can be printed out when executing GCC. For TA to verify what you have done, please zip and submit the necessary file(s). For example, it's enough only to send one file: \gcc-3.3.1\lib\gcc-lib\i686-pc-linux-gnu\3.3.1\cc1.
Due date: 2003/9/29 Monday.
2003/9/22 (week 02) Homework 2: Follow the program control flow: main() (in main.c) -> toplev_main() (in toplev.c) -> do_compile() (in toplev.c) -> compile_file() (in toplev.c). In function compile_file(), find the statement: (*lang_hooks.parse_file) (set_yydebug);. Specify the succeeding control flow of this statement, i.e., tell where and why the flow jumps.
Due date: 2003/9/29 Monday.
Solution: Click.
2003/10/6 (week 04) Homework 3: What are the so-called "action table" and "goto table" of GCC? (Hint: Try to find them in c-parse.c.)
Due date: 2003/10/13 Monday.
Solution: Click.
Solution [by 蔡方培(Fang-Pei Tsai)]: Click.


Useful Links
Title Descrpitions
GCC Homepage http://gcc.gnu.org/
GCC Releases http://gcc.gnu.org/releases.html
Installing GCC http://gcc.gnu.org/install/
GCC Online Documentation http://gcc.gnu.org/onlinedocs/
GCC 3.3.1 Manual http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/
GCC Manual (Current Development) http://gcc.gnu.org/onlinedocs/gcc/
GCC Internals Manual (Current Development) http://gcc.gnu.org/onlinedocs/gccint/


TA Materials
Note: These materials are not officially supported, i.e., the correctness and effectiveness are NOT guaranteed. Simply use for help. Any corrections and/or suggestions are welcomed; please send to comp2@csie.ntu.edu.tw. Thanks.
Date Descrpitions
2003/9/15 (week 01) (1) The installation notes of TA. The platform is i686-Linux, and the language is C only. Click.
2003/9/22 (week 02) (1) The lecture note on 22 September. Click.
2003/9/29 (week 03) (1) The lecture note on 29 September. Click.
2003/10/6 (week 04) (1) The lecture note on 6 October. Click.
(2) The C source file (arithmetic.c) for simple integer arithmetics. Click.
(3) The dump of translation unit for arithmetic.c. Click.
(4) The dump of parsing information (yyparse states) for arithmetic.c. Click.
2003/10/20 (week 06) (1) The lecture note on 20 October. Click.
2003/11/26 (week 11) (1) Use GCC to build and use a static/dynamic library. Click.
2004/1/5 (week 17) (1) On LR parser family. Click.