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: Jason Merrill <jason at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>, Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>, <schwab at suse dot de>, <gcc-patches at gcc dot gnu dot org>
- Date: 13 Dec 2001 08:37:30 +0100
- Subject: Re: Volatile MEMs in statement expressions and functions inlined as trees
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.33.0112071044250.8567-100000@penguin.transmeta.com>
Linus Torvalds <torvalds@transmeta.com> writes:
| On Fri, 7 Dec 2001, Jason Merrill wrote:
| >
| > It has nothing to do with assignment, except that the builtin assignment
| > operator returns a reference; any other situation involving references
| > works the same way. Extracting a value from a reference involves a load.
| > To write it another way, the C++ expression
| >
| > q = p = 0
| >
| > is equivalent to the C expression
| >
| > q = *(p = 0, &p)
| >
| > Should that not load from p?
|
| Ehh.. Take it one step further: according to you, the C++ expression
|
| p = 0;
|
| is equivalent to the C expression
|
| *(p = 0, &p)
Absolutely not. Please re-read what Jason said -- the result of the
assignment is an *lvalue*. Thus
p = 0;
is equivalent to
(p = 0, &p);
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com