From: Alex Riesen Date: Thu, 17 Aug 2006 09:11:44 GMT Subject: Re: [PATCH] remove inline iteration variable Message-ID: <81b0412b0608170211p7289889av43eb7c35ba07fe02@mail.gmail.com> In-Reply-To: On 8/16/06, David Rientjes wrote: > > > > > Remove unnecessary iteration variable in inline. > > > > > - for (i = 0; i < in; i++) putchar(' '); > > > > > + for (; in > 0; in--) > > > > > > > > while(in--) putchar(' '); > > > > > > > > > > That goes into an infinite loop if the argument is negative because > > > it emits a cmpl $0, x(%ebp). Should never happen, but there's no > > > reason not to prevent it with a for loop. > > > > while (in-- > 0) putchar(' '); > > > > still shorter :) > > > > It emits a slightly rearranged assembly with the same number of instructions. > oops. I should've looked at the output. But the point moot anyway, Junio says :)