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


On Thu, Dec 13, 2001 at 01:54:11PM -0800, Linus Torvalds wrote:
> You misunderstand.
> 
> A plain "p = 0;" assignment does _not_ load anything from memory...

Actually I don't misunderstand.  GCC _will_ do this iff that statement
appears in an inlined function.  That is the bug that was originally
reported.  I think aoliva has fixed this now, but I can't remember.

> My argument is a consistency argument, where one of the corner stones is
> exactly the fact that _because_ "p = 0" does not load from memory, then "q
> = p = 0" should _also_ not load.
> 
> So I'm asking for _consistency_, nothing more.

I'm still stuck on the existence of a sequence point internal to
operator= (mentioned by Jason earlier), the fact that the expression
is an lvalue, and the fact that reading from p may not yield the 0
that was previously stored.


r~


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