CS980-01
Project Assignment 3
Fall 2007
Due Monday October 22


Build control flow graphs from the stream of instructions provided by your assignment 2 code generator. Each node in the graph is a basic block. Basic blocks are delimited by labels and branch/jump instructions (but not subroutine calls). The edges in the graph are directed and connect branch/jump instructions to their destinations or indicate "fall-through" execution semantics. Build a control flow graph for each function in the source program.

See Cooper and Torczon 5.3.2 for a discussion of control flow graphs.

For grading purposes please dump a display of each control flow graph to an output file (or stdout). I don't have rigid requirements for this display, but I want to be able to easily understand what the nodes and edges are. Show the contents (the sequence of instructions) of each basic block.

You should work independently on this assignment.

To submit this assignment you should tar and gzip up both your program for building control flow graphs and your latest version of pcc3. E-mail me the resulting file. Please include a README file that explains how to execute your assignment 3 program.

This assignment is due at 1:30pm on Monday October 22. However, these is a two-day grace period that ends at 1:30pm on Wednesday October 24. No assignments may be submitted after this time without my prior approval.


Last modified on October 8, 2007.

Comments and questions should be directed to hatcher@unh.edu