One of the purposes of using intermediate code in compilers is to
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2014 Set 3 · Q17
Time
Select one answerSingle correct
Solution
Official answer: C) increase the chances of reusing the machine-independent code optimizer in other compilers.
Intermediate Code GenerationIntermediate code serves as a machine-independent bridge between the front end (lexical analysis, parsing, semantic analysis) and the back end (code generation, target-specific optimizations) of a compiler.
Key benefits include:
Modularity and Portability: If there are source languages and target architectures, writing a separate compiler for each pair requires compilers. With a common intermediate representation (IR), only front ends and back ends are needed ().
Reusability of Optimizers: Machine-independent optimizations (e.g., constant propagation, common subexpression elimination, dead code elimination, loop optimization) can be implemented once on the intermediate code and reused across different source languages and target architectures.
Therefore, option (C) is the correct answer.
Try the question first, then check your work.
Examiner trap
Consider the separation between machine-independent optimizations and target-specific code generation in compiler phases.
This Intermediate Code Generation previous year question is Q17 of the GATE CSE 2014 Set 3 paper. Find more GATE CSE PYQs on Intermediate Code Generation in Compiler Design, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Intermediate Code Generation PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Intermediate Code Generation has 14 GATE CSE PYQs across 12 papers from 2011 to 2025. 5 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2014 Set 3.
How GATE tests Intermediate Code GenerationIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.