Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: Put your code... (was Re: gotos
Message-ID: <1988Apr27.164212.12535@utzoo.uucp>
Organization: U of Toronto Zoology
References: <2597@ttrdc.UUCP>, <165600043@uiucdcsb>
Date: Wed, 27 Apr 88 16:42:12 GMT

> [common tail actions]
> I submit that, with today's larger memories, it is preferable to
> duplicate the code...

One can avoid this to some degree in C by using case fallthrough.  Otherwise,
I agree but would phrase it differently:  for "with today's larger memories"
substitute "with sensible compilers".  It doesn't take much of an optimizer
to notice that the instruction sequences preceding an unconditional control-
flow merge are identical, and condense them into one by branching to the
beginning of the sequence rather than the end.  Any peephole optimizer
worthy of the name ought to be willing to do this.
-- 
NASA is to spaceflight as            |  Henry Spencer @ U of Toronto Zoology
the Post Office is to mail.          | {ihnp4,decvax,uunet!mnetor}!utzoo!henry
