GATE CS 2017 (Forenoon) — Question 12

Compiler DesignIntermediate Code Generation & Local Code OptimizationMCQ1 mark · −1/3 if wrongMedium

Consider the following intermediate program in three address code
code
1p = a - b
2q = p * c
3p = u * v
4q = p + q
5
Which one of the following corresponds to a static single assignment form of the above code?
  1. A
    code
    1p_1 = a - b
    2q_1 = p_1 * c
    3p_1 = u * v
    4q_1 = p_1 + q_1
    5
  2. B
    code
    1p_3 = a - b
    2q_4 = p_3 * c
    3p_4 = u * v
    4q_5 = p_4 + q_4
    5
  3. C
    code
    1p_1 = a - b
    2q_1 = p_2 * c
    3p_3 = u * v
    4q_2 = p_4 + q_3
    5
  4. D
    code
    1p_1 = a - b
    2q_1 = p * c
    3q_2 = u * v
    4q_2 = p + q
    5
Practise the full 2017-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 Intermediate Code Generation & Local Code OptimizationTimed, 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