Open In App

GATE | Sudo GATE 2020 Mock II (10 January 2019) | Question 53

Like Article
Like
Save
Share
Report

Consider the following expression

u*v+a-b*c

Which one of the following corresponds to a static single assignment from the above expressions
(A)

x1 = a - b
y1 = p * c
x2 = u * v
y2 = p + q

(B)

x 1 = a - b
y1 = x2   * c
x3 = u * v
y2 = x4 + y3

(C)

x1 = a - b
y2 = x1 * c
x2 = u * v
y3 = x2 + y2

(D)

p = a - b
q  = p * c
p = u * v
q = p + q 


Answer: (C)

Explanation: According to Static Single Assignment

  1. A variable cannot be used more than once in the LHS.
  2. A variable should be initialized atmost once.

So, only option (C) is correct.

Quiz of this Question


Last Updated : 09 Jan, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads