This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Loop unrolling



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]