Question 5
7.1. Finish the liveness and next-use computations for the example of Section
7.2.1.
Line Instruction Status Next use
(1) $u := a - b$ u, a, b live u: 3; a: 2; b: 4
(2) $v := c - a$ v, c, a live v: 3; c: (5); a: none
(3) $w := u + v$ w live; u, v dead w: (7); u, v: none
(4) $x := d + b$ x, b live; d dead x: (6); d, b none
(5) $y := c + 1$ y, c live y: (6); c: none
(6) $z := x \times y$ z live; x, y dead z: (7); x, y: none
(7) $d := w - z$ d live; w, z dead d, w, z: none
Question 6
7.2. In the following code,
(1) $t1 := b + c$
(2) $t2 := f - e$
(3) $f := t1 / t2$
(4) $g := d - f$
(5) $t3 := g + c$
(6) $f := t3 \times g$
t1, t2, and t3 are temporaries and the other variables are the programmer's. Find
liveness and next use for all the variables. Check your results by scanning the table
yourself.