This is the mail archive of the
mailing list for the GCC project.
Re: Volatile MEMs in statement expressions and functions inlined as trees
- From: Linus Torvalds <torvalds at transmeta dot com>
- To: Gabriel Dos Reis <gdr at codesourcery dot com>
- Cc: Alexandre Oliva <aoliva at redhat dot com>, Richard Henderson <rth at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Dec 2001 12:24:04 -0800 (PST)
- Subject: Re: Volatile MEMs in statement expressions and functions inlined as trees
On 14 Dec 2001, Gabriel Dos Reis wrote:
> | But I'll give you that some rvalues can be _promoted_ to lvalues.
> There is no such rules C++. You're inventing here.
You already yourself pointed out some of the things allow the programmer
to see the address of the rvalue.
Once you have an address of an rvalue, you can _always_ make it an lvalue
by the simple method of dereferencing it with "*".
In effect, operations that expose the address of rvalues thus allow their
promotion into lvalues. What's your argument?
Normally, of course, it goes the other way (ie lvalues get "demoted" to
rvalues), by virtue of the operations wanting rvalues. A simple example,
of course is just
int a, b, c;
a = b+c;
where "b" is a lvalue, but because the "+" operation wants a rvalue it
gets automatically converted, and the rvalue created by the dereferencing
Or do you disagree here too?