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?
Tap to open full sizeFigure description
Control flow graph with four basic blocks. ENTRY -> B1. B1 contains: i = m - 1, j = n, a = 10. B1 -> B2. B2 contains: i = i + 1, j = j - 1. B2 has two outgoing edges: B2 -> B3 and B2 -> B4. B3 contains a = 20; B3 -> B4. B4 contains i = a + 1. B4 has two outgoing edges: a back edge B4 -> B2 and B4 -> EXIT.
- (A)
B1: {}, B2: {a}, B3: {a}, B4: {a}
- (B)
B1: {i, j}, B2: {a}, B3: {a}, B4: {i}
- (C)
B1: {a, i, j}, B2: {a, i, j}, B3: {a, i}, B4: {a}
- (D)
B1: {a, i, j}, B2: {a, j}, B3: {a, j}, B4: {a, i, j}