This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Volatile MEMs in statement expressions and functions inlined astrees
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Linus Torvalds <torvalds at transmeta dot com>
- Cc: Jason Merrill <jason at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: 16 Dec 2001 16:19:55 -0200
- Subject: Re: Volatile MEMs in statement expressions and functions inlined astrees
- Organization: GCC Team, Red Hat
- References: <Pine.LNX.4.33.0112160944040.10652-100000@penguin.transmeta.com>
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