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


>>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:

> On Dec  6, 2001, Jason Merrill <jason@redhat.com> wrote:
>> in C++, *q should be read after the store; In C, it should not.  In
>> neither language should anyone write anything like the example if
>> they're dealing with volatiles.

> Would your restriction be extended to constructs such as:

> int bar, volatile *vpi;
> int foo = ({ *vpi = bar; });

> In this case, should *vpi be re-loaded or not?  Does it matter if it's
> C or C++?

I would handle this case identically.  It should be reloaded in C++, not in
C, and should really be written ({ *vpi = bar; bar; }).

Jason


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