This is the mail archive of the
mailing list for the GCC project.
Re: Empty loop elimination in 4.0 ?
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: Michael Veksler <VEKSLER at il dot ibm dot com>, Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, gcc at gcc dot gnu dot org
- Date: Mon, 10 Jan 2005 15:06:05 +0100
- Subject: Re: Empty loop elimination in 4.0 ?
- References: <OF3DD3B111.8D577FDE-ON42256F85.00269B85-42256F85.002A3EC0@il.ibm.com> <41E287CC.email@example.com>
- Reply-to: Richard Guenther <richard dot guenther at gmail dot com>
On Mon, 10 Jan 2005 08:49:00 -0500, Robert Dewar <firstname.lastname@example.org> wrote:
> I think it is always a good idea to generate a warning
> when an empty loop is detected (whether or not it is
> eliminated), since this is either a timing loop, or it
> is likely a bug.
Especially as while we preserve empty loops, we do not preserve the number of
iterations! And for loops with small number of iterations, we may
remove it completely
already. All of this happens with -funroll-loops.
Experimenting a little bit, even for
int i = -3;
the loop is removed completely with -funroll-loops, with i=-1024 we
get a loop with
increments of 8.
I'd certainly vote for a warning and removal of all empty loops.