Joerg Wunsch wrote:
Vincent Trouilliez <vincent.trouill...@modulonet.fr> wrote:
IIRC it said volatile must be used to keep the compiler from
optimizing away access to a variable that he thinks might be
pointless. Like writing a variable that is never read back.

Nope, if the variable is a global one, it will always be written.

I'm not a C expert so I might be out of my depth here, but
wouldn't it be legal for the C compiler to optimize away
even global variables? Some time ago there was some talk
about a possible AVR port of LLVM, and this is exactly the
kind of thing I would expect LLVM's link time optimization
to do.
--
Pertti


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to