SLIDE 1 CSE443 Compilers
alphonce@buffalo.edu 343 Davis Hall
http:/ /www.cse.buffalo.edu/faculty/alphonce/SP17 /CSE443/index.php https:/ /piazza.com/class/iybn4ndqa1s3ei
SLIDE 2
Final Exam
5/19/2017, Friday 8:00AM - 11:00AM Talbert 107
SLIDE 3
Project Due Date
Wednesday 5/17 /2017 5:00 PM
SLIDE 4
Special Just-For-You Office Hours
Monday 05/15/2017 9:00 AM to noon 2:00 PM - 5:00 PM
SLIDE 5 Exam format
Expect about 4 short essay
- questions. We will use BlueBooks.
You will have 3 hours to write the exam. I would expect you to take about 30 minutes per question, leaving about an hour to check over your work.
SLIDE 6
Possible Exam Questions
Anything from HW1 . . . or . . .
SLIDE 7 Type checking (Semantic processing)
Explain how type errors are
- detected. Discuss how type
information is gathered, stored and
- checked. Pick a concrete syntactic
construct that can contain a type error, and explain how type checking detects the error.
SLIDE 8
Intermediate Code Generation
Explain how short-circuit Boolean expressions are translated into intermediate code. Discuss how jump targets can be determined. Illustrate by showing how a concrete Boolean expression involving at least two Boolean operators is translated into intermediate code.
SLIDE 9
Register Allocation and Assignment
Describe the getReg(I) algorithm, answering the questions of what data structures it uses, when and how these structures are updated. What is meant by "spill", when does it occur, and why is it needed?
SLIDE 10 Symbol Table Usage
Describe the structure and use of a symbol table. Explain which phases
- f the compiler use the table,
including what data is written to or read from the table during each phase.
SLIDE 11
Invocation Records
Describe a typical layout for an invocation record, detailing what information is stored in the record. Explain how variable length parameters and variable length local data can be accommodated. Discuss the location and use of the stack and top pointers.
SLIDE 12 Function Calls
Explain how a function call takes
- place. Include in your discussion
mention of the roles of the caller and callee in setting up the invocation record, and how machine state is remembered at the call and restored at return. Explain how recursive calls are handled (do NOT discuss tail-call optimization).
SLIDE 13 Optimizations
Pick an optimization and explain the benefit(s) of having the compiler apply it to code, and sketch how it works. Ex:
- tail-call optimization
- code motion
- dead code elimination
SLIDE 14
Final exam questions? Project questions?
SLIDE 15
Thanks for a great semester!
SLIDE 16 C
g r a t s t
v e r y
e g r a d u a t i n g ! !
SLIDE 17 https:/ /www.flickr.com/photos/simonturkas/14751228065/in/photolist-otvUbn-9zAe3S-8cBWNc-Dup2E-2tFaCK-p8WGbi-7oAxFT-9zAgtE-aUqw9r-rkfGai-5Vorzw-9zxeWF-qwRFHX-5anoq-mgWz4-r3B5-9zAfZq-jyL4mv-cQ9wnw- bg96Hk-asnhrX-E6dgTg-9zAeFm-8deqY5-cWdDjG-4FYsrP-nHPiBg-Dc7r8a-sbLtXg-yHG2q-mj5Gd-2oPYdY-BVdszq-5ddPa2-5M7TYi-4kjNn8-G4RLpk-ab3BoU-6ajtqq-5dijdf-8Fiw2f-CjdVSD-hov8tL-cxmz45-CKqReP-5diqLY- BViq9c-qFRnFN-3gnvn3-6gABQQ
CC BY-SA 2.0 Simon Turkas
SLIDE 18 http:/ /stockarch.com/files/12/06/sunset_beach_sand.jpg
CC BY
SLIDE 19 https:/ /www.flickr.com/photos/louish/5575457829/in/photolist-9uFFng-g46M5W-oKw6so-aakK3q-tC1cqp-7DAZCP-sETP7m-tksi3V-tBUFfZ-tC1cQc
CC BY-NC-DN 2.0 Louish Pixel
SLIDE 20 https:/ /www.flickr.com/photos/chrisandjenni/2090146183/in/photolist-4bGxDa-duE6fu-duysz2-duDYb5-31Ssyw-6udWrS-duDXPj-tqJN8-Sy6bV-duDURY-7HBEMK-duyk5x-duE1YE-jXqQST-duysa4-2Yuud4-8j1X7-6718eF- duDUYo-xdDu7-duDZCU-4qJrwv-duyoLi-duE111-7es6i5-duymJZ-duE3eY-duE2BU-duymYi-duDXY5-duykgK-duykU4-duDQxW-duygqP-duyt2c-duE5hS-duDVVj-duDZjo-5WMvm-duE3p5-duDQdu-4VRT6C-duyw3B-jZZrdi- jXq2rF-duypUP-duyfsT-6gpT6p-4z9pGh-2k7Y3J
CC BY-NC-DN 2.0 Chris and Jenni
SLIDE 21
You are coming to the May 19th dinner, right?
Congrats to everyone graduating!!
SLIDE 22
And the May 20th ceremony?
Congrats to everyone graduating!!
SLIDE 23 Check out my cool hat! T h e r e w i l l b e p e
l e i n f u n n y
t f i t s !
?
SLIDE 24 Have a wonderful summer!
( a n d s e e y
a t t h e f i n a l )