GATE / CS ARCHIVE

GATE CSE 2008 / QUESTION 12

Intermediate-code optimization portability

Compiler Design · Code Optimization & Data-Flow Analysis · Full GATE CSE 2008 paper

GATE 2008, Q12 1 mark · MCQ
Report issue

Code Optimization & Data-Flow Analysis

Question 12, GATE 2008: Why are some code optimizations performed on intermediate code?

(A) They enhance compiler portability to other target processors
(B) Program analysis is more accurate on intermediate code than machine code
(C) Dataflow-analysis information cannot otherwise be used for optimization
(D) Front-end information cannot otherwise be used for optimization
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Intermediate code abstracts away many machine-specific details, allowing one optimization pass to serve several target back ends.
2. This reuse makes it easier to retarget the compiler, which is the portability benefit in A.
3. B claims a universal analysis-accuracy advantage that does not follow. C and D incorrectly say dataflow/front-end information cannot otherwise be used; such information can also inform other compilation stages.

Original paper, page 3