Intrepid / upc-specification

Automatically exported from code.google.com/p/upc-specification
0 stars 1 forks source link

Clarification: how is type compatibility defined when one/both pointer-to-shared target types are incomplete? #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version 1.2 of the UPC specification at 6.4.3p2 states:

The casting or assignment from one pointer-to-shared to another in which either 
the type size or block size differs results in a pointer with a zero phase, 
unless one of the types is a qualified or unqualified version of shared void*, 
the generic pointer-to-shared, in which case the phase is preserved unchanged 
in the resulting pointer value.

Given that the size of an incomplete type is undefined, how would the above 
constraint be interpreted if one/both of the pointer-to-shared target types are 
incomplete types?

Original issue reported on code.google.com by gary.funck on 17 Jul 2012 at 8:40

GoogleCodeExporter commented 9 years ago
Set default Consensus to "Low".

Original comment by gary.funck on 19 Aug 2012 at 11:26

GoogleCodeExporter commented 9 years ago
Change Status to New: Requires review.

Original comment by gary.funck on 19 Aug 2012 at 11:37

GoogleCodeExporter commented 9 years ago
Proposal:

Insert the capitalized text:

"... in which either the type size or block size differs, OR EITHER TYPE IS 
INCOMPLETE, results in a pointer with a zero phase..."

This means the phase must be reset whenever casting or assigning a pointer 
involving an incomplete type (other than shared void *). This seems like the 
only safe option, since the compiler cannot otherwise ensure the phase field in 
the resulting pointer value is valid.

Original comment by danbonachea on 17 Sep 2012 at 6:35

GoogleCodeExporter commented 9 years ago
I agree with Dan's assessment that resetting the phase is the only action which 
makes sense when given a pointer to an incomplete type (other than the generic 
void* case).

I think the text proposed is fine, but I don't see the need for its 
capitalization.

Original comment by phhargr...@lbl.gov on 17 Sep 2012 at 7:45

GoogleCodeExporter commented 9 years ago
"I think the text proposed is fine, but I don't see the need for its 
capitalization."

Yes, that was just for clarity of presentation of the proposal :-)

Original comment by danbonachea on 17 Sep 2012 at 7:48

GoogleCodeExporter commented 9 years ago
Dan wrote:
> Yes, that was just for clarity of presentation of the proposal :-)

I misread the proposal as requesting that the text be capitalized in the spec.
I get it now.  Sorry.

Original comment by phhargr...@lbl.gov on 17 Sep 2012 at 7:52

GoogleCodeExporter commented 9 years ago
We have agreement from two implementations that phase should be reset in this 
case, and I suspect this will have wide agreement, so I'm optimistically 
proceeding with a formal change proposal. Change announcement mailed to the 
list 9/17/2012.

Proposed Change:
-------------------------
--- upc-language.tex    (revision 119)
+++ upc-language.tex    (working copy)
@@ -336,7 +336,9 @@
 {\bf Semantics}

 \np The casting or assignment from one pointer-to-shared
-    to another in which either the type size or block size differs results  in 
+    to another in which either the type size or block size differs,
+    \xadded[id=DB]{70}{or either type is incomplete,}
+    results in 
     a pointer with a zero phase, unless one of the types is a qualified or
     unqualified version of {\tt shared void*}, the {\em generic pointer-to-shared},
     in which case the phase is preserved unchanged in the resulting

Original comment by danbonachea on 17 Sep 2012 at 9:46

GoogleCodeExporter commented 9 years ago
This PendingApproval issue was ratified at the 10/19/2012 telecon, and merged 
into the working draft in SVN 175.

Original comment by danbonachea on 22 Oct 2012 at 6:43