This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/12468] empty loop not eliminated as dead code


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]