CSE443 Compilers Dr. Carl Alphonce alphonce@buffalo.edu 343 Davis - - PowerPoint PPT Presentation

cse443 compilers
SMART_READER_LITE
LIVE PREVIEW

CSE443 Compilers Dr. Carl Alphonce alphonce@buffalo.edu 343 Davis - - PowerPoint PPT Presentation

CSE443 Compilers Dr. Carl Alphonce alphonce@buffalo.edu 343 Davis Hall http:/ /www.cse.buffalo.edu/faculty/alphonce/SP17 /CSE443/index.php https:/ /piazza.com/class/iybn4ndqa1s3ei Final Exam 5/19/2017, Friday 8:00AM - 11:00AM Talbert


slide-1
SLIDE 1

CSE443 Compilers

  • Dr. Carl Alphonce

alphonce@buffalo.edu 343 Davis Hall

http:/ /www.cse.buffalo.edu/faculty/alphonce/SP17 /CSE443/index.php https:/ /piazza.com/class/iybn4ndqa1s3ei

slide-2
SLIDE 2

Final Exam

5/19/2017, Friday 8:00AM - 11:00AM Talbert 107

slide-3
SLIDE 3

Project Due Date

Wednesday 5/17 /2017 5:00 PM

slide-4
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
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
SLIDE 6

Possible Exam Questions

Anything from HW1 . . . or . . .

slide-7
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
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
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
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
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
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
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
SLIDE 14

Final exam questions? Project questions?

slide-15
SLIDE 15

Thanks for a great semester!

slide-16
SLIDE 16

C

  • n

g r a t s t

  • e

v e r y

  • n

e g r a d u a t i n g ! !

slide-17
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
SLIDE 18

http:/ /stockarch.com/files/12/06/sunset_beach_sand.jpg

CC BY

slide-19
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
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
SLIDE 21

You are coming to the May 19th dinner, right?

Congrats to everyone graduating!!

slide-22
SLIDE 22

And the May 20th ceremony?

Congrats to everyone graduating!!

slide-23
SLIDE 23

Check out my cool hat! T h e r e w i l l b e p e

  • p

l e i n f u n n y

  • u

t f i t s !

?

slide-24
SLIDE 24

Have a wonderful summer!

( a n d s e e y

  • u

a t t h e f i n a l )