GATE Compiler Design: Code Optimization and Data Flow Analysis – Previous Year Questions
18 GATE previous year questions on Code Optimization and Data Flow Analysis (Compiler Design, Computer Science) with answers and explanations, from every paper.
18 questions worth 31 marks in all (5 1-mark, 13 2-mark). Asked between 2008 and 2026, so you can see how the topic has been tested over time.
- GATE 2008 CS Q12 – Some optimizations are performed on intermediate code because
- GATE 2009 CS Q17 – Match Group 1 with Group 2. Group 1: P. Regular expression; Q. Pushdown automata; R. Dataflow analysis; S. Register allocation. Group 2: 1. Syntax…
- GATE 2009 CS Q42 – Which statements are TRUE? I. Some programming languages have parsing algorithms of complexity less than Θ(n³). II. A language allowing recursion can…
- GATE 2021 CS (CS2) Q40 – Apply common-subexpression elimination to the code. y points to a heap struct with f1,f2; x,y,z,p,q,i reside in registers. Count additions and…
- GATE 2021 CS (CS2) Q48 – For statement S, USE(S) contains variables used in S; IN(S) those live at entry; OUT(S) those live at exit. A basic block consists of S1 immediately…
- GATE 2015 CS (CS2) Q27 – Match P: lexical analysis; Q: parsing; R: register allocation; S: expression evaluation. Techniques: 1 graph colouring; 2 DFA minimization; 3…
- GATE 2010 CS Q47 – Without spilling values to memory, what is the minimum number of registers needed for this basic block?
- GATE 2013 CS Q58 – A processor permits register operands only, at most two sources and one destination per instruction. All variables are dead after this segment. Only…
- GATE 2013 CS Q59 – For the same register-only architecture and complete segment below, apply register allocation only, with no code motion. Find minimum registers to…
- GATE 2014 CS (CS3) Q44 – Basic block: a = b + c c = a + d d = b + c e = d - b a = e + b Find the minimum numbers of nodes and edges, respectively, in its DAG representation.
- GATE 2014 CS (CS1) Q27 – Which compiler statement is FALSE?
- GATE 2017 CS (CS1) Q53 – Consider the following grammar: where `relop` is a relational operator (e.g., <, >, ...), ò refers to the empty statement, and `if`, `then`, `else`…
- GATE 2015 CS (CS1) Q46 – A variable x is said to be live at a statement S i in a program if the following three conditions hold simultaneously: i. There exists a statement S j…
- GATE 2026 CS (CS2) Q45 – Consider the control flow graph given below. Which one of the following options is the set of live variables at the exit point of each basic block?
- GATE 2026 CS (CS1) Q42 – Consider the control flow graph shown in the figure. Which one of the following options correctly lists the set of redundant expressions (common…
- GATE 2025 CS (CS1) Q13 – Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
- GATE 2023 CS Q37 – Consider the control flow graph shown. Which one of the following choices correctly lists the set of live variables at the exit point of each basic…
- GATE 2021 CS (CS1) Q60 – Consider the following C code segment: In a compiler, this code segment is represented internally as a directed acyclic graph (DAG). The number of…