[Bug optimization/964] missed warning and optimization

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Nov 16 01:47:00 GMT 2003


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-16 01:47 -------
>From <http://gcc.gnu.org/onlinedocs/gcc/Non-bugs.html#Non-bugs> "Certain Changes We Don't 
Want to Make":
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.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=964



More information about the Gcc-bugs mailing list