From: "Alex Riesen" <raa.lkml@gmail.com>
To: "David Rientjes" <rientjes@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] remove inline iteration variable
Date: Thu, 17 Aug 2006 11:11:44 +0200 [thread overview]
Message-ID: <81b0412b0608170211p7289889av43eb7c35ba07fe02@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0608161441070.29566@chino.corp.google.com>
On 8/16/06, David Rientjes <rientjes@google.com> 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 :)
prev parent reply other threads:[~2006-08-17 9:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-15 17:23 [PATCH] remove inline iteration variable David Rientjes
2006-08-16 7:27 ` Alex Riesen
2006-08-16 17:14 ` David Rientjes
2006-08-16 20:10 ` Alex Riesen
2006-08-16 20:16 ` Junio C Hamano
2006-08-16 21:41 ` David Rientjes
2006-08-17 9:11 ` Alex Riesen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81b0412b0608170211p7289889av43eb7c35ba07fe02@mail.gmail.com \
--to=raa.lkml@gmail.com \
--cc=git@vger.kernel.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).