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

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

Re: [avr-gcc-list] memcpy() : problem when passing destination pointer


From: Pertti Kellomäki
Subject: Re: [avr-gcc-list] memcpy() : problem when passing destination pointer
Date: Thu, 12 Feb 2009 10:02:50 +0200
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Joerg Wunsch wrote:
Vincent Trouilliez <address@hidden> 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




reply via email to

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