Skip to content
GATEiit

GATE CSE 2021 Set 2 Q48: Liveness: relation between OUT(S1) and IN(S2)

Question

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?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: A (official GATE 2021 final answer key)

Concept used: OUT of a statement is the union of IN over its successors.

First step: Inside a basic block, S1S_1 has exactly one successor, S2S_2.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2021 Set 2 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key