There is a standard technique for doing this, used first by Lowry and Medlock in their FORTRAN H compiler. One first constructs a sequence of 'busy blocks' such that if the first statement in such a block is executed all of the others are too. Next one constructs a boolean connectivity array C = c(i,j) such that c(i,j) = 1 if control is transferred directly from busy block i to busy block j and c(i,j) = 0 otherwise. This array squared yields the c(i,j) for j reachable from i in two steps; cubed it yields the c(i,j) for j reachable from i in three steps, etc., etc. ORing the first n successive such arrays together then yields the busy blocks yields reachable from some i in any of 1, 2, . . . , n steps (transfers of control) and, of course, the busy blocks not reachable from any other busy block.
Charles Mills is quite right. Almost all optimizing compilers do something very like this, the chief differences among them being in whether the language of the messages emitted when an unreachable busy block is found is peremptory or polite.. John Gilmore, Ashland, MA 01721 - USA ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN