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 as trees
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Linus Torvalds <torvalds at transmeta dot com>
- Cc: Gabriel Dos Reis <gdr at codesourcery dot com>, Alexandre Oliva <aoliva at redhat dot com>, Richard Henderson <rth at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: 14 Dec 2001 21:53:20 +0100
- Subject: Re: Volatile MEMs in statement expressions and functions inlined as trees
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.33.0112141220110.2957-100000@penguin.transmeta.com>
Linus Torvalds <torvalds@transmeta.com> writes:
| 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.
But I didn't say they're promoted to lvalues. You seem to equate
addressable to lvalue, which is fundamentally wrong.
| 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?
My claim is that there is no promotion called rvalue-to-lvalue.
Please don't add to the confusion.
| 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
| of "b".
|
| Or do you disagree here too?
Because operator+ expects an rvalue, the lvalue-to-rvalue conversion
is applied to b as explained by the standard text. Did I said I
disagree with that? I even quote a text to explain that.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com