This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Loop unrolling
- To: Lee Iverson <leei at ai dot sri dot com>, Stephen Williams <steve at icarus dot icarus dot com>
- Subject: Re: Loop unrolling
- From: Martin Knoblauch <knobi at rocketmail dot com>
- Date: Tue, 2 Jun 1998 02:38:34 -0700 (PDT)
- Cc: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>, egcs at cygnus dot com
---Lee Iverson <leei@ai.sri.com> wrote:
>
> In message
<199806011514.IAA02191@icarus.icarus.com> you write:
> >
> > pfeifer@dbai.tuwien.ac.at said:
> > > As a matter of fact, is there still any strong
reason not to delete
> > > empty loops in general?
> >
> > As a matter of fact, there is. Us embedded
programmers are sometimes
> > compelled to write timing loops. I guess we
should (and I usually do)
> > make those loops non-empty, but still ....
>
> But the correct way to write an empty loop that
shouldn't be deleted
> (a timing loop) already exists:
>
> {
> volatile int i;
> for (i = 0; i < 10000; ++i);
> }
>
Hmm. Does this prevent the loop from being deleted,
or would it allow the compiler to just assign
9999 to "i"?
Martin
===
------------------------------------------------------
Martin Knoblauch
email: knobi@knobisoft.de or knobi@rocketmail.com
www: http://www.knobisoft.de
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com