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



> If you can provide source examples which show C++ & Java creating empty
> loops behind the programmer's back it would go a long way to convincing
> everyone that eliminating empty loops is a good idea.

I sent this to RMS years ago during the original empty loop debate
(1991?) but he had already made up his mind.  I don't remember if I
sent it to the gcc2 list.

	struct x
	{
	  x() {}
	};
	
	f()
	{
	  x x1[10];
	}

gcc's output contains an empty loop.  If you want to complain about
the code style, assume that the empty constructor appears in a
read-only header file (possibly in a base class definition -- that's
where I first saw this bug).

(This also shows a deficiency in the SPARC machine description: there
is an unnecessary compare.)



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