This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Volatile MEMs in statement expressions and functions inlined astrees


On Dec 16, 2001, Linus Torvalds <torvalds@transmeta.com> wrote:

> But not doing the read in the first case when the value is discarded is
> also consistent.

Couldn't we do it and say it's an extension meant to increase C++
compatibility with C and reduce surprises, especially in code such as:

        volatile int *p;

        *p;

This clearly dereferences *p, but since the result is an lvalue, it
would not generate an access unless there was some reason for it to
decay to rvalue.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]