Loop unrolling
Gerald Pfeifer
pfeifer@dbai.tuwien.ac.at
Mon Jun 1 03:57:00 GMT 1998
This should make the documentation better match what egcs actually
does (-funroll-loops) resp. should do (C++).
Cf. http://www.cygnus.com/ml/egcs/1998-May/0651.html and following.
As a matter of fact, is there still any strong reason not to delete
empty loops in general?
Mon Jun 1 12:47:07 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* ``Emtpy'' loops sometimes do get deleted and can indeed be
generated by optimization.
Index: gcc.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/gcc.texi,v
retrieving revision 1.11
diff -r1.11 gcc.texi
2004,2006c2004,2007
< GNU CC does not delete ``empty'' loops because the most likely reason
< you would put one in a program is to have a delay. Deleting them will
< not make real programs run any faster, so it would be pointless.
---
> GNU CC does not delete ``empty'' loops because (historically) the most
> likely reason you would put one in a program was to have a delay.
> Deleting these will not make real programs run any faster, so it would
> be pointless.
2008,2009c2009,2015
< It would be different if optimization of a nonempty loop could produce
< an empty one. But this generally can't happen.
---
> However, the rational here was that optimization of a nonempty loop
> cannot produce an empty one, which holds for C but is not the case for
> C++ in general.
>
> Morover, with @samp{-funroll-loops} small ``empty'' loops indeed are
> removed, so the current behavior is both sub-optimal and inconsistent
> and may well change in the future.
More information about the Gcc
mailing list