avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] What's wrong with this preprocessor statement


From: J Wunsch
Subject: Re: [avr-gcc-list] What's wrong with this preprocessor statement
Date: Mon, 26 Feb 2001 10:43:20 +0100 (MET)

Uwe Bonnes <address@hidden> wrote:

> did you compile with optimization? Then perhaps the loop was
> optimized away.

ISTR a comment (somewhere in gcc's doc) that gcc never optimizes
simple for() loops of the form:

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

because the compiler recognizes this as a form of a delay loop.  Don't
know whether this is also true for variations like while() loops of
the same form.

OTOH, Nicolas wrote that he's simulating it in AVR Studio.  Quite
possible that the simulator behaves differently than a real CPU.
(IMHO, the simulator shouldn't see the macro name `delay2' at all
since there should be no traces left from it after running through
cpp.  But i've got no experience with it, maybe they are parsing the C
source code by itself.)

-- 
J"org Wunsch                                           Unix support engineer
address@hidden         http://www.interface-systems.de/~j



reply via email to

[Prev in Thread] Current Thread [Next in Thread]