This is the mail archive of the gcc-patches@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]

Re: Loop unrolling


This is a slighty modified (i.e., corrected) version of my previous
patch: ``rationale'' instead of ``rational''.

Thanks a lot to a friendly and helpful lurker!


Mon Jun  1 22:28:31 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 rationale 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. 



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