Rockbox mail archiveSubject: Re: busy loop
Re: busy loop
From: Edgar Toernig <froese_at_gmx.de>
Date: Tue, 15 Jun 2010 19:36:45 +0200
pouly amaury wrote:
> for (x = (unsigned)(FREQ>>22); x; x--)
> asm volatile("":::"memory");
> Clobbering memory is likely to prevent gcc from optimizing the loop away.
But it will break with loop-unrolling (i.e. -O3). x times nothing
is nothing ;-) You *have* to use a nop-instruction.
And the cast is bogus - only silences the compiler without fixing
Received on 2010-06-15