Put your code... (was Re: gotos

Henry Spencer henry at utzoo.uucp
Thu Apr 28 02:42:12 AEST 1988


> [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



More information about the Comp.lang.c mailing list