> I'm not sure that the test (for ref type) on line 153 of 
> remoteValueForwarding.cpp is necessary for the sake of RVF itself.  If 
> it is declared to be 'const' and we respect that, then it seems 
> reasonable to be able to forward the value.  The machinery for 
> implementing RVF may have to be more sophisticated to handle this case 
> (and that may very be why the test is there), but I think that 
> forwarding the value of an argument declared to be 'const ref' should 
> not be ruled out on semantic grounds.

Unfortunately, it is necessary for the reason that I tried to explain in 
the comments above the check.  Because flattenFunctions.cpp currently 
inserts things that ought to be passed by ref using a "const in" argument 
with a ref type (incorrectly, IMO), I have to check the type of the 
argument to avoid incorrectly remote value forwarding such cases.  I'll 
modify the comment to point to a test that fails without this additional 
check.

In any case, the intention was not to filter against CONST_REF (though it 
probably does have that effect as well), but rather to guard against args 
that are created with CONST_IN intent and ref type.  I'll be looking at 
cleaning that up in a separate commit since it's a pre-existing condition 
and distinct from this effort.

But your mention of 'const ref' and semantic grounds has got me 
thinking...  'const' only means that the callee won't modify the argument, 
not that the caller won't do so, so I'm not convinced that we can safely 
r.v.f. 'const ref' arguments.  In particular, the caller may still be 
modifying its copy, and a sync var access may be used to force the callee 
to see those updates.

I'm going to check whether tightening this up to CONST_IN only (still with 
the ref type check) passes testing, update the comments to reflect the 
above, and commit it that way if there are no objections.

-Brad


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to