GATE CS 2026 (Forenoon) — Question 42

Compiler DesignData Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression EliminationMCQ2 marks · −2/3 if wrongMedium

Consider the control flow graph shown in the figure.
Question image
Which one of the following options correctly lists the set of redundant expressions (common sub-expressions) in the basic blocks B4 and B5? Note: All the variables are integers.
  1. A
    B4: \( \{b + i\} \) B5: \( \{c + m\} \)
  2. B
    B4: \( \{g * k\} \) B5: \( \{c + m\} \)
  3. C
    B4: \( \{g * k, b + i\} \) B5: \( \{\} \)
  4. D
    B4: \( \{g * k\} \) B5: \( \{\} \)
Practise the full 2026-FN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkCompilers: Principles, Techniques & ToolsThe "Dragon Book" for parsing, syntax-directed translation and code generation.
Practise more on Data Flow Analysis: Constant Propagation, Liveliness Analysis, Common Subexpression EliminationTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group