Answers to Self-Study Questions

Test Yourself #1

The constant-propagation information is in red, and the live-variables information is in green.

Test Yourself #2

The definition of the may be uninitialized problem is as follows:

Test Yourself #3

Here are the dataflow equations for live analysis. Note that the meet operator (⌈⌉) is set union.

Variable
Least Solution
Greatest Solution
1.before
{ }
{ }
1.after
{ x }
{ x }
2.before
{ x }
{ x }
2.after
{ y }
{ x, y}
3.before
{ y }
{ x, y}
3.after
{ y }
{ x, y }
4.before
{ y }
{ x, y}
4.after
{ y }
{ x, y }

The solution we want is the least solution.

Test Yourself #5

Test Yourself #6