GATE CS 2015, set 1 · Question 46 · Compiler Design · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer
A variable x is said to be live at a statement Sᵢ in a program if the following three conditions hold simultaneously:
i. There exists a statement Sⱼ that uses x
ii. There is a path from Sᵢ to Sⱼ in the flow graph corresponding to the program
iii. The path has no intervening assignment to x including at Sᵢ and Sⱼ
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

- (A) p, s, u
- (B) r, s, u
- (C) r, u
- (D) q, v
Answer
Answer (C)
Answer from the official GATE CS 2015 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes