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

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

Re: [avr-gcc-list] GCC loop optimization and volatile data question


From: Kang Tin LAI
Subject: Re: [avr-gcc-list] GCC loop optimization and volatile data question
Date: Mon, 23 Apr 2001 06:50:01 +0800

Hi,

Code size is a concern for this type of uC, so it has to turn on the
optimizer. I have done a couple of tests, looked at the asm generated,
finally I found that I need to spend more time to undertstand the
characteristic of the optimizer. I can found any other doc or text
information about the optimizer, just only 3 pages in GCC doc.

KTL

J Wunsch wrote:
> 
> "Larry Barello" <address@hidden> writes:
> 
> > extern int some_external_variable;
> > ...
> > while (...)
> > {
> >     ...
> >     if (some_external_variable == 0)
> >         break;
> > }
> >
> > do I need to declare 'some_external_variable' as volatile?
> 
> Sure.  Linkage classes are totally irrelevant for optimization
> considerations (which is why you need `volatile').
> 
> --
> cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL
> 
> http://www.sax.de/~joerg/                        NIC: JW11-RIPE
> Never trust an operating system you don't have sources for. ;-)
> 
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list



reply via email to

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