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 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)

and according to the same reasoning, it means that in C++, you should do a
load after the store, _regardless_ of whether the result is used or not.

THAT is my argument.

Your argument about lvalue/rvalue, when taken to its logical conclusion,
means that you cannot store to volatile variables without loading them.

And quite frankly, I don't think you believe in that logical conclusion
either.

Which must mean that your rvalue/lvalue argument is inherently flawed.

		Linus


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