For a statement \(S\) in a program, in the context of liveness analysis, the…

GATE · 2021 · CS · Set 2 · Computer Science & IT

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_1\) followed by \(S_2\). Which one of the following statements is correct?

  1. A.

    \(\text{OUT($S_1$)} = \text{IN ($S_2$)}\)

  2. B.

    \(\text{OUT ($S_1$)} = \text{IN ($S_1$)} \cup \text{ USE ($S_1$)}\)

  3. C.

    \(\text{OUT ($S_1$)} = \text{IN ($S_2$) }\cup \text{ OUT ($S_2$)}\)

  4. D.

    \(\text{OUT ($S_1$)} = \text{USE ($S_1$)} \cup \text{IN ($S_2$)}\)

Attempted by 176 students.

Show answer

Correct answer: A

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…