GATE CS 2017, set 1 · Question 12 · Compiler Design · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Consider the following intermediate program in three address code
p = a - b q = p * c p = u * v q = p + q
Which one of the following corresponds to a static single assignment form of the above code?

  1. (A) p₁ = a - b ; q₁ = p₁ ∗ c ; p₁ = u ∗ v ; q₁ = p₁ + q₁
  2. (B) p₃ = a - b ; q₄ = p₃ ∗ c ; p₄ = u ∗ v ; q₅ = p₄ + q₄
  3. (C) p₁ = a - b ; q₁ = p₂ ∗ c ; p₃ = u ∗ v ; q₂ = p₄ + q₃
  4. (D) p₁ = a - b ; q₁ = p ∗ c ; p₂ = u ∗ v ; q₂ = p + q
Answer

Answer (B)

Answer from the official GATE CS 2017 answer key.

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