GATE CS 2026, set 2 · Question 45 · Compiler Design · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

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?

Control flow graph with four basic blocks. ENTRY has an arrow into block B1, which contains 'a = b + c'. B1 has two outgoing edges: one down to block B2 containing 'd = a + e', and one diagonally to block B3 containing 'e = a + f'. B3 has an edge that curves back up and enters B1 (a loop B3 -> B1). B2 has an edge down to block B4 containing 'g = d + e'. B4 has an arrow down to EXIT. B3 has no other outgoing edge.
  1. (A) B1: {a, b, c, e, f}, B2: {d, e}, B3: {b, c, e, f}, B4: ∅
  2. (B) B1: ∅, B2: {d, e}, B3: {a, c, f}, B4: ∅
  3. (C) B1: {a, b, c, e, f}, B2: {d, e}, B3: {c, e, f}, B4: ∅
  4. (D) B1: ∅, B2: {d, e, f}, B3: {a, b, c, e, f}, B4: ∅
Answer

Answer (A)

Answer from the official GATE CS 2026 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes