Consider the control flow graph shown.
Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?
GATE CSE 2023Compiler Design › Code Optimization & Register AllocationVerified
(D) B1: a, i, j, B2: a, j, B3: a, j, B4: a, i, j \text{B1: {a, i, j}, B2: {a, j}, B3: {a, j}, B4: {a, i, j}} B1: a, i, j , B2: a, j , B3: a, j , B4: a, i, j
Compute live-variable sets using standard backward data-flow equations. At each block, OUT is the union of IN sets of successor blocks; IN is USE ∪ (OUT − DEF). Iterate until the OUT sets stabilize. The question asks for OUT[B] at each basic block.
The standard liveness analysis reaches a fixed point after three passes. The final OUT sets are B1:{a,i,j}, B2:{a,j}, B3:{a,j}, B4:{a,i,j}. Therefore option D is correct.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.