[Chapel Merge] Adjust implementation of set.add() method, add set

Branch: refs/heads/master
Revision: 8ca0d00
Author: dlongnecke-cray
Log Message:

Merge pull request #17346 from dlongnecke-cray/set-comm-fixes

Adjust implementation of set.add() method, add set comm tests (#17346)

Resolves #17214.

Prior to this effort, the set type would segfault whenever a remote
add() call triggered a resize. Adding an on this block to the
implementation of add() would fix the issue, but also caused an
extra copy of the added element to be made (see #15808).

By using Memory.Initialization.moveToValue(), the added element can
be moved into the on this block without making an extra copy.

This was not the end of the copy woes. An extra copy was still being
made because copy elision was not triggering for local variables in
if or else blocks. This was resolved by #17321.

Add a comm test that is intended to trigger the segfault illustrated
in #17214.

Add a test capturing the number of copies for a single add() call.

Add a future illustrating that a user defined operator== fails to

Adjust --warn-unstable to only warn about include statements
in user modules.


  • [x] ALL on linux64 when COMM=none
  • [x] ALL on linux64 when COMM=gasnet

Reviewed by @mppf. Thanks!

Signed-off-by: David Longnecker dlongnecke-cray@users.noreply.github.com

Modified Files:
A test/library/standard/Set/setAddCopyCount.chpl

A test/library/standard/Set/setAddCopyCount.good
A test/library/standard/Set/setCommTest.chpl
A test/library/standard/Set/setCommTest.good
A test/library/standard/Set/setCommTest.numlocales
A test/library/standard/Set/setCommTest.skipif
A test/library/standard/Set/setRecordEqualityOverload.bad
A test/library/standard/Set/setRecordEqualityOverload.chpl
A test/library/standard/Set/setRecordEqualityOverload.future
A test/library/standard/Set/setRecordEqualityOverload.good
M compiler/AST/build.cpp
M modules/standard/Memory/Initialization.chpl
M modules/standard/Set.chpl
M test/modules/bradc/printModStuff/foo.good

Compare: https://github.com/chapel-lang/chapel/compare/3b8c1bad93c9...8ca0d007df84