[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: [rtl] Integer Math instruction execution times
On Fri, 24 Apr 1998, C. W. Wright (1698) wrote:
> static int i,j,k,l;
> The variables had to be declared static, or else the compiler was not
> generating instructions for the action. I discovered because the pulse
> width on the scope was not changing when the action inside the loop was
> changed. In fact, the time was exactly the same no matter what was done
> inside the loop! Upon running gcc -O2 -S sra_irq.c and examining the
> assembly source, I discovered that no code was generated for the action.
This is normal gcc optimization. What should be used is "volatile"
declaration - static worked just accidentally, better (globally
optimizing) compiler would eliminate also that.
Did you check what is the delay without any loop at all ?
Quite interesing result.
--
Tomasz Motylewski
--- [rtl] ---
For more information on Real-Time Linux see:
http://rtlinux.cs.nmt.edu/