On Wed, Sep 6, 2017 at 10:15 PM, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > Even this is not the case. > > Not for a C compiler, it isn't. > > Sure, if you do compilers for toy languages, it might be, but a C > compiler has things like "switch()" statements that may not nest with > loops etc. So even without a goto, you can pretty much have arbitrary > flow. I am trying to think if without goto statement, can we create irreducible graph. The for reducible graph, finding dominator has fast path. On way to look at the Simple SSA paper is that, it is taking advanctage of that fast path. The slow path is actually worse than other algorithm. I originally thinking we have to use goto to create irreducible graph. Now you mention it. You are right, with creatively mixing of switch statement and while loop. Some one can create irreducible graph without goto. > So I think people should entirely stop thinking that "goto" is somehow > special. It isn't. It is only special in toy languages like Pascal, > not in the real world. Goto can introduce the irreducible graph. That is the only special part. The compiler of course need to handle all kind of CFG. > It's much better to get rid of that "goto is special" mindset, and > instead say "all control flow is just a goto in the end". > > So yes, get rid of the *real* special cases - those structured flow > constructs. They are nice special cases, but they are nice for > *humans*, they aren't actually relevant to computers, and they > shouldn't be. The only relevant part to computer is weather a fast path exist or not. > So the real special case is those simple "structured" loops. You > should never design around them, because it will just hurt later. In a sense that is why I like the Cytron el al for the SSA conversion over Simple SSA. Cytron el al does not have special case for non structured CFG. If the CFG is reducible, the algorithm will run faster naturally. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html