GATE CS 2021, set 2 · Question 48 · Compiler Design · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

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, S₁ followed by S₂. Which one of the following statements is correct?

  1. (A) OUT(S₁) = IN(S₂)
  2. (B) OUT(S₁) = IN(S₁) ∪ USE(S₁)
  3. (C) OUT(S₁) = IN(S₂) ∪ OUT(S₂)
  4. (D) OUT(S₁) = USE(S₁) ∪ IN(S₂)
Answer

Answer (A)

Answer from the official GATE CS 2021 answer key.

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