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 as trees


Linus Torvalds <torvalds@transmeta.com> writes:

|> In article <or4rn9fqka.fsf@free.redhat.lsd.ic.unicamp.br> you write:
|> >
|> >volatile int *p, *q, r;
|> >
|> >void foo() {
|> >  *p = *q = r; // don't load *p back
|> >}
|> 
|> Does this still load off "q"?
|> 
|> I don't think that's what an assignment operator implies.
|> 
|> An assignment operator will assign the value to the left side, and have
|> as its value the assigned value.  NOT the "re-loaded value". 

6.5.15 [#3] ... An assignment expression has the value of the left operand
after the assignment, ...

For me this implies that a volatile object must be reloaded.

Andreas.

-- 
Andreas Schwab                                  "And now for something
Andreas.Schwab@suse.de				completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5


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