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


mrs@wrs.com (Mike Stump) wrote:
> The definition of loop means the use of the keyword ``for'' or
> ``while''. 

So what's the word for "a piece of code that exhibits looping behaviour
but is generated automatically by the compiler"?  I take it that the cases
are handled distinctly by EGCS.

> The definition of empty (in C and C++) means that textually
> in the users source program, the character ';' follows the ')' from
> the loop syntax.

Before or after the preprocessor runs on it?  Is "while (1) {}" not an
empty loop?

> I know, somewhat arbitrary, but prefectly clear.  This was the result
> of the conversation from eons ago that we had.  

I was not aware that special, non-obvious meanings had been given to these
terms.  Forgive me my earlier post on this subject.

So I take it that your opinion is that 

    for (i = 0; i < 10; i++);

should not be optimized away, but 

    inline void DoNothing () {}

    for (i = 0; i < 10; i++) DoNothing ();

can be?  I know that's fine with me.

-- 
Sol Foster: colomon@ralf.org

Sometimes I think the world has gone completely mad.  And then I 
think, "Aw, who cares?"  And then I think, "Hey, what's for supper?" 
                                        -Jack Handey


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