This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12468] empty loop not eliminated as dead code
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2003 19:36:55 -0000
- Subject: [Bug optimization/12468] empty loop not eliminated as dead code
- References: <20030930192459.12468.bh@techhouse.brown.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12468
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-09-30 19:36 -------
Not a bug see: <http://gcc.gnu.org/onlinedocs/gcc/Non-bugs.html>:
Deleting "empty" loops.
Historically, GCC has not deleted "empty" loops under the assumption that the most likely reason
you would put one in a program is to have a delay, so deleting them will not make real programs
run any faster.
However, the rationale here is that optimization of a nonempty loop cannot produce an empty one,
which holds for C but is not always the case for C++.
Moreover, with -funroll-loops small "empty" loops are already removed, so the current behavior is
both sub-optimal and inconsistent and will change in the future.