Re: Loop Optimizations and Gotos

hrubin@stat.purdue.edu (Herman Rubin)
Wed, 29 Nov 1995 19:31:34 GMT

          From comp.compilers

Related articles
[10 earlier articles]
Re: Loop Optimizations and Gotos preston@tera.com (1995-11-21)
Re: Loop Optimizations and Gotos cliffc@ami.sps.mot.com (1995-11-21)
Re: Loop Optimizations and Gotos cliffc@ami.sps.mot.com (1995-11-22)
Re: Loop Optimizations and Gotos Paul_Long@ortel.org (1995-11-23)
Re: Loop Optimizations and Gotos bill@amber.ssd.hcsc.com (1995-11-27)
Re: Loop Optimizations and Gotos dave@occl-cam.demon.co.uk (Dave Lloyd) (1995-11-27)
Re: Loop Optimizations and Gotos hrubin@stat.purdue.edu (1995-11-29)
| List of all articles for this month |

Newsgroups: comp.compilers
From: hrubin@stat.purdue.edu (Herman Rubin)
Keywords: optimize
Organization: Purdue University Statistics Department
References: 95-11-076 95-11-107 95-11-158 95-11-179
Date: Wed, 29 Nov 1995 19:31:34 GMT

hrubin@stat.purdue.edu (Herman Rubin) wrote:
>How can one avoid many unnecessary steps when there are numerous
>logical exits from a block? One case of this is entrance to a
>state machine;


Paul Long <plong@perf.com> wrote:
>See the paper, "How (Not) to Code a Finite State Machine,"
>Douglas W. Jones, _SIGPLAN Notices_, vol. 23, no. 8, August
>1988, for another alternative to implementing FSMs that you
>may not have thought about that avoids the problems you
>mention.


I have read this paper, and the method used will not work on
state machines of fairly low complexity, but higher than the
example in that paper. The method advocated is, in the example
given, exactly equivalent to a goto method which is also given.
Since it is exactly equivalent, and the goto method is more
versatile, I claim that this gives gotos the edge. It does
agree with my position that the state should normally be
contained only in the location in code.


It also does not handle the case of multiple entrance optimally;
I cannot see how this can be done except by entering the state
machine with a goto, if the state is only to be kept in the location.
--
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
hrubin@stat.purdue.edu Phone: (317)494-6054 FAX: (317)494-0558


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.