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>, egcs at cygnus dot com
- Subject: Re: Loop unrolling
- From: Stephen Williams <steve at icarus dot icarus dot com>
- Date: Mon, 01 Jun 1998 15:40:42 -0700
{
volatile int i;
for (i = 0; i < 10000; ++i);
}
Nifty! Or in C++ "for (volatile int i = 0; i < 10000; i+=1) ;"
leei@ai.sri.com said:
> As is stands now, deleting empty loops is a very desirable *feature*,
> especially for higher-level languages like C++ and Java which may just
> generate loops that the programmer doesn't see.
Yes yes yes, I agree. I'm all for the compiler being aggressive, especially
in memory-tight and kinda slow embedded processors. I believe, in fact, that
a C++ compiler has the extra information needed to surpass the compiled code
performance of C. And with things like inline functions and templates,
loops can be drained of active contents pretty quickly.
--
Steve Williams "The woods are lovely, dark and deep.
steve@icarus.com But I have promises to keep,
steve@picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."