GateAI
Data Flow Analyses

GATE CSE 2021 Set 2 · Q38

MCQ2 marksEasy

Time

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?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) OUT(S1) = IN(S2)

Data Flow Analyses

In a basic block, execution is strictly sequential, meaning the statement immediately following S1S_1 is S2S_2.

In liveness analysis (a backward data-flow analysis):

  • The information at the exit of a statement S1S_1, denoted as OUT(S1)OUT(S_1), represents the set of variables that need to be live immediately after S1S_1 finishes execution.

  • Since control flows directly from S1S_1 into S2S_2 without any branching or intervening operations, the variables live at the exit of S1S_1 are precisely the variables live at the entry of S2S_2.

Therefore:

OUT(S1)=IN(S2)OUT(S_1) = IN(S_2)

Hence, (A) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Data Flow Analyses previous year question is Q38 of the GATE CSE 2021 Set 2 paper. Find more GATE CSE PYQs on Data Flow Analyses in Compiler Design, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Data Flow Analyses PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Data Flow Analyses in GATE CSE

Data Flow Analyses has 8 GATE CSE PYQs across 8 papers from 2014 to 2026. 5 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2021 Set 2.

How GATE tests Data Flow Analyses

More from GATE CSE 2021 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2021 Set 2 · Q38 · MCQ

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?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.