Dear Alessandro,

Alessandro Fanfarillo wrote:
so far a "sync memory" statement is translated into a local
"__sync_synchronize ()".
The attached draft patch delegates the action for sync memory (when
-fcoarray=lib is used) to the external function
_gfortran_caf_sync_memory() implemented in the OpenCoarrays library.

Looks good to me. However, you should add a test case with 'dg-options "-fdump-tree-original -fcoarray=lib"' to check that this works; cf. gcc/testsuite/gfortran.dg/coarray*.f90 for examples.

And you have to provide a stub implementation in libgfortran/caf/{libcaf.h,single.c}.

Tobias

PS: I wonder whether it makes sense to remove the __sync_synchronize for -fcoarray=single and replace it by the equivalent to "|asm volatile ("" : : : "memory")". It almost certainly does.
|

Reply via email to