Talk:Control flow graph
|WikiProject Computer science||(Rated C-class, Mid-importance)|
As we are talking about control flow graph, I would expect to see at least a sample graph in this page. That's something really missing. —Preceding unsigned comment added by 22.214.171.124 (talk • contribs) 2007-08-06 13:37:46
- Here is a sample I created for the provided example. However, it ends up quite small and not really readable. Anonyoptimizer 14:58, 9 October 2007 (UTC)
The definition of an abnormal edge as an edge whose destination is unknown is misleading. To my understanding this mainly happens for exceptions and computed goto. Where you indeed know a number of possible destinations, but have no way to determine which of the destinations will be reached. Another typical property is that the destinations are forced and can't be changed (so you can't do things like splitting critical edges with additional blocks). Unfortunately I have no textbook citation at hand right now... --126.96.36.199 (talk) 09:10, 17 July 2009 (UTC)
Definition of domination is flawed
"A block M dominates a block N if every path from the entry that reaches block N has to pass through block M. The entry block dominates all blocks."
With this definition, the entry block does *not* dominate all blocks because it does *not* dominate itself. The further definitions in that section are equally wrong.
Sample doesn't exist anymore
Would explicitly stating "else" for the "C" block clean up this code? I think changing the example code to the following would be more clear:
0: (A) t0 = read_num 1: (A) if t0 mod 2 == 0 2: (B) print t0 + " is even." 3: (B) goto 5 4: (C) else 5: (C) print t0 + " is odd." 6: (D) end program
In the above, we have 4 basic blocks: A from 0 to 1, B from 2 to 3, C from 4 to 5, and D at 6. In particular, in this case, A is the "entry block", D the "exit block" and lines 4 and 6 are jump targets. A graph for this fragment has edges from A to B, A to C, B to D and C to D.
Is there a reason for the else to be implicit?
- Presumably, that's reducibility in the sense of reducible flow graphs. That link currently redirects to interval (graph theory); however see the discussion at Talk:Interval (graph theory)#Reducible flow graphs. Perhaps Rooted graph#Flow graphs would be a better target for that redirect.
- @JMP EAX:, I think you added that image and its caption. Can you help? – Tea2min (talk) 09:50, 3 January 2017 (UTC)