Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE CS 2021 | Set 2 | Question 48

  • Last Updated : 23 May, 2021
Geek Week

For a statement S in a program, in the context of liveness analysis, the following sets are defined:

  • USE(S) : the set of variables used in S
  • IN(S) : the set of variables that are live at the entry of S
  • OUT(S) : the set of variables that are live at the exit of S

Consider a basic block that consists of two statements, S1 followed by S2. Which one of the following statements is correct?
(A) OUT(S1) = IN (S2)
(B) OUT (S1) = IN (S1) ∪ USE (S1)
(C) OUT (S1) = IN (S2) ∪ OUT (S2)
(D) OUT (S1) = USE (S1) ∪ IN (S2)


Answer: (A)

Explanation:

No. of variables which are live after S1 will always be the input for S2. 
(Correct Option A)


Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :