Next: Exercise 2.
Up: Quiz4
Previous: Guidelines.
Consider the following three-address code fragment.
|
a := 1 |
|
b := 2 |
L2 |
c := a + b |
|
d := c - a |
|
if d = b goto L5 |
L3 |
d := b * d |
|
if d = b goto L5 |
|
d := a + b |
|
e := e + 1 |
|
goto L3 |
L5 |
b := a + b |
|
e := c - a |
|
if d = b goto L2 |
|
a := b + d |
|
b := a - d |
- Give the flow graph of this program.
- Identify the back edges and the loops.
Note that the results of these computations
do not matter. We are only interested here
in the relations between the basic blocks.
Answer 1
Figure 1:
The control flow graph.
|
Next: Exercise 2.
Up: Quiz4
Previous: Guidelines.
Marc Moreno Maza
2004-12-02