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 SS in a program, in the context of liveness analysis, the following sets are defined:

USE(S)USE(S) : the set of variables used in SS

IN(S)IN(S): the set of variables that are live at the entry of SS

OUT(S)OUT(S)  : the set of variables that are live at the exit of SS

Consider a basic block that consists of two statements, S1S_1 followed by S2S_2. Which one of the following statements is correct?

  1. A.

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

  2. B.

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

  3. C.

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

  4. D.

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

Attempted by 186 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…