[Bug optimization/12468] empty loop not eliminated as dead code
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Sep 30 19:56:00 GMT 2003
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.
More information about the Gcc-bugs
mailing list