Content deleted Content added
Enterprisey (talk | contribs) added Category:Static program analysis using HotCat |
Enterprisey (talk | contribs) →Example: the goto is unnecessary here; undo the float-right |
||
Line 6:
== Example ==
L1: b := 3;
L2: c := 5;
L3: a := f(b * c);
The set of live variables at line {{code|L3}} is {<code>b</code>, <code>c</code>} because both are used in the multiplication, and thereby the call to <code>f</code> and assignment to <code>a</code>. But the set of live variables at line {{code|L1}} is
only {<code>b</code>} since variable <code>c</code> is updated in {{code|L2}}. The value of variable <code>a</code> is never used. Note that <code>f</code> may be stateful, so the never-live assignment to <code>a</code> can be eliminated, but there is insufficient information to rule on the entirety of <code>L3</code>.
|