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 xx is said to be live at a statement SiS_i in a program if the following three conditions hold simultaneously:

i. There exists a statement SjS_j that uses xx

ii. There is a path from SiS_i to SjS_j in the flow graph corresponding to the program

iii. The path has no intervening assignment to xx including at SiS_i and SjS_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,up, s, u

  2. B.

    r,s,u r, s, u

  3. C.

    r,ur, u

  4. D.

    q,vq, v

Attempted by 153 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…