This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Loop unrolling
- To: law at cygnus dot com
- Subject: Re: Loop unrolling
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Wed, 3 Jun 1998 00:24:28 +0200
- CC: leei at ai dot sri dot com, steve at icarus dot icarus dot com, pfeifer at dbai dot tuwien dot ac dot at, egcs at cygnus dot com
- References: <4456.896772748@hurl.cygnus.com>
> If you can provide source examples which show C++ & Java creating empty
> loops behind the programmer's back it would go a long way to convincing
> everyone that eliminating empty loops is a good idea.
This is what actually started this whole thread. For
class A {
int i;
public:
A(){};
};
int main()
{
A a[1000];
}
i486-pc-linux-gnu/egcs-2.91.34/cc1plus -O2 produces
movl $999,%eax
.align 4
.L5:
subl $1,%eax
jnc .L5
It recognizes that the constructor is inline, but fails to recognize
that this makes the loop trivial.
Martin