[Omp] OpenMP spec 2.5 seems to have incorrect flush example on page 12

Marcel Beemster marcel at ace.nl
Sat May 5 02:54:04 PDT 2007


Bronis,

You wrote:
> The current spec says the transformation is illegal.
> The write access to the volatile next step variable
> occurs within the, loop after any registerization
> would occur. Since that implies a flush without a
> list then retaining the value (i.e., via putting
> it into a register) is incorrect. The fact the
> the variable is touched or not is irrelevant.

I cannot find this description of volatile in the standard.
The standard says (page 12 again):

> a reference that reads the value of an object with a
> volatile-qualified type behaves as if there were a flush
> operation on that object at the previous sequence point,
> while a reference that modifies the value of an object with
> a volatile-qualified type behaves as if there were a flush
> operation on that object at the next sequence point.

I read here that the flush implied by the volatile is specific
only to that variable. It is not a "flush without a list", it is
an implied flush >with< a list.

Anyway, the volatile is used only to force the program to do the
required interleaving of T1 and T2. Without that mechanism, the
interleaving could also happen accidentally and a temporarily
cached object in T2 could still overwrite a flushed value by T1.

Marcel

-- 
Dr. Marcel Beemster, Senior Software Engineer, marcel at ace.nl,www.ace.nl
Associated Compiler Experts bv. Amsterdam, Netherlands. +31 20 6646416.
-----------------------------------------------------------------------
This e-mail and any  files transmitted  with it are  confidential.  Any
technical information contained herein is supplied as-is, and no rights
can be  derived therefrom.  If you have received this message in error,
please notify  the sender by reply  e-mail immediately,  and delete the
message and all copies thereof.




More information about the Omp mailing list