A variable \(x\) is said to be live at a statement \(S_i\) in a program if the…

GATE · 2015 · CS · Set 1 · Computer Science & IT

A variable \(x\) is said to be live at a statement \(S_i\) in a program if the following three conditions hold simultaneously:

i. There exists a statement \(S_j\) that uses \(x\)

ii. There is a path from \(S_i\) to \(S_j\) in the flow graph corresponding to the program

iii. The path has no intervening assignment to \(x\) including at \(S_i\) and \(S_j\)

The variables which are live both at the statement in basic block 2 and at the statement in basic block 3 of the above control flow graph are

  1. A.

    \(p, s, u\)

  2. B.

    \( r, s, u\)

  3. C.

    \(r, u\)

  4. D.

    \(q, v\)

Attempted by 151 students.

Show answer

Correct answer: C

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…