Similar questions 2 more →
Code Optimization & Data-Flow Analysis

Answer & solution
Official answer: D
Liveness means a current value can be read along some future path before redefinition. B4 computes i from a, then can return to B2, where i and j are read; a can also survive to another B4. Thus OUT(B4)={a, i, j}. Before B4 the old i is killed, so IN(B4)={a, j}, yielding OUT(B3)={a, j}. B2 can reach B4 directly or through B3, so OUT(B2)={a, j}; its updates read i, j, yielding IN(B2)={a, i, j}=OUT(B1). Therefore D.
Teaching detail. Use OUT(B)=the union of IN over successor blocks and IN(B)=USE(B) union (OUT(B)−DEF(B)). Here USE(B2)={i,j}, DEF(B2)={i,j}, USE(B3)=∅, DEF(B3)={a}, USE(B4)={a}, DEF(B4)={i}. The loop requires a fixed point rather than a single backward pass. Crucially j remains live through B4 because the next B2 reads it; old i is killed inside B4 but the newly assigned i is live afterward. Values m,n are used only in B1 and are not live at its exit.