1. volatiles _NEVER_ ever sit in a regester except for reload phase. even local volatile will be saved in memory (on stack) 2. volatile var updates every time after 'volatile value' updated. 3. gcc _DOES_ optimize over functions calls (how does it work otherwise?)
if you still think gcc does not do a proper job -- please let us know, we'll fix it shortly. cheers, ~d On Tuesday 06 April 2004 16:57, Sergei Sharonov wrote: > > There is a good point to note here, which catches a lot of > > people out. > > GCC is a pretty smart compiler. It will seek out and remove a lot of > > redundancy. However, this means the programmer has to be more exact > > about what they write. You can be pretty sloppy writing for > > IAR, as it > > fails to optimise away a number of redundant things GCC will. If > > something is volatile, you'd better make darned sure you > > declare it as > > such, or you will have problems. > > Sometimes even declaring the variable volatile fails to work for me. It > still sits in a register and is never updated. I had to move the > comparison into a separate function. I believe, that works because gcc > does not (?) optimize over function calls. > > Sergei > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=Click > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users