|spaghetti code email@example.com (1992-02-22)|
|spaghetti code firstname.lastname@example.org (1992-02-28)|
|Re: spaghetti code email@example.com (1992-03-02)|
|From:||firstname.lastname@example.org (Preston Briggs)|
|Organization:||Rice University, Houston|
|Date:||Mon, 2 Mar 1992 18:58:30 GMT|
email@example.com (Aubrey de Grey) writes:
>but as far as I can see the problem of optimising spaghetti
>code as opposed to structured code is one of turning each procedure into a
>form where no pair of jumps (forward or backward) is linked. (A pair of
>jumps is linked when each jump encloses exactly one end of the other.)
No. "Linked loops" are no problem. They're just nested in a perhaps
non-intuitive fashion. The optimizer has no problem with them.
The only "problem" is irreducible loops (loops with more than one
entry) and they aren't that bad a problem since node-splitting can
always be applied.
>statement2; <---- |
>label2; | |
>statement3; | |
>if condition1 then goto label1; >------
>if condition2 then goto label2; >---
In this case, there's just a loop nest with 2 loops.
The outer nest includes statements 2, 3, and 4.
The inner loop includes statements 3 and 4.
Return to the
Search the comp.compilers archives again.