What looks efficient may not be

John Cowan cowan at marob.masa.com
Thu Jun 1 06:10:21 AEST 1989


In article <9146 at csli.Stanford.EDU> poser at csli.Stanford.EDU (Bill Poser) writes:
[in reference to two loops, one of which pre-increments a variable,
and the other post-increments a variable, and nothing else]

>Of course, a smart compiler will recognize that in these examples
>the value of i is never used and will not bother with the save.
>

A >really< smart compiler would recognize that the loops don't do anything
at all, and kill them both!
-- 
John Cowan <cowan at marob.masa.com> or <cowan at magpie.masa.com>
UUCP mailers:  ...!uunet!hombre!{marob,magpie}!cowan
Fidonet (last resort): 1:107/711
Aiya elenion ancalima!



More information about the Comp.lang.c mailing list