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 inlinedastrees



On Fri, 14 Dec 2001, Paul Schlie wrote:
>
> rvalue :: (temp = rvalue, temp)
>
> therefor:
>
> lvalue = rvalue :: lvalue = (temp = rvalue, temp)
>
> therefor:
>
> q = p = x :: q = (p = (x)) :: q = (temp2 = (p = (temp1 = x, temp1)), temp2)
>
> equivalent to:
>
> q = p = x :: q = (p = (temp = x, temp), temp)

Whee. I like the chain of logic, and it would be irrefutable (I think) if
it wasn't for the fact that I suspect Gabriel may object to one of your
steps, namely the basic

	"lvalue = rvalue".

assumption.

Gabriels claim hinges on the assignment of

	lvalue = lvalue

which means that your chain of logic, while unbroken in itself, is not the
same chain of logic that Gabriel looks at and worries about.

(Hey, _I_ like your chain, because it ends up where I want, but "like" is
not a mathematical proof)

So there's an additional step:

	q = p = x ::
	lvalue = (rvalue-conversion) lvalue = (rvalue-conversion) x

where I think the "rvalue-coversion" is just the middle "result" (ie the
infamous "value stored"), but Gabriel claims that the middle "result" is
thrown away, and the rvalue-conversion is the dereferencing of the lvalue.

Which is how Gabriel comes up with an extra dereference.

Now, if you can logically refute _that_, I'd love to hear about it. I've
tried to refute it by trying to show that throwing out the "result is
value stored" means that that part of the standard appears to have no
value, but Gabriel doesn't care. He still maintains that the lvalue-rvalue
conversion has to explicitly happen, and involves a dereference, not just
the "value stored".

(and because it's a lvalue, you cannot do the

	rvalue :: (temp = rvalue, temp)

operation, which is why your logic won't convince him).

		Linus


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