summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-10 17:58:01 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-10 17:58:01 +0000
commit71cf3ae65aaccc07caf3f89476930174705d9e3d (patch)
tree3b81e10f4b9ef07bf487371bb8be9be05d418397 /libgfortran
parent993a9cacbaacc6a2c72d8b21808e76fbdad2fb2e (diff)
downloadgcc-71cf3ae65aaccc07caf3f89476930174705d9e3d.tar.gz
2015-03-10 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
Tobias Burnus <burnus@net-b.de> * trans.h (caf_sync_memory): New function decl tree. * trans-decl.c (gfc_build_builtin_function_decls): Define it. (create_main_function): Don't call sync_synchronize and leave it to the CAF library. * trans-stmt.c (gfc_trans_stop): Ditto. (gfc_trans_sync): Ditto; add call library call for sync memory. * gfortran.dg/coarray_sync_memory.f90: New. * caf/libcaf.h (_gfortran_caf_sync_memory): New prototype. * caf/single.c (_gfortran_caf_sync_memory): Implement. (_gfortran_caf_sync_all, _gfortran_caf_sync_image): Add __asm__ __volatile___ ("":::"memory"). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221329 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/caf/libcaf.h1
-rw-r--r--libgfortran/caf/single.c13
3 files changed, 22 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 612ed81a039..184338aaede 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2015-03-10 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
+ Tobias Burnus <burnus@net-b.de>
+
+ * caf/libcaf.h (_gfortran_caf_sync_memory): New prototype.
+ * caf/single.c (_gfortran_caf_sync_memory): Implement.
+ (_gfortran_caf_sync_all, _gfortran_caf_sync_image): Add
+ __asm__ __volatile___ ("":::"memory").
+
2015-02-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/57822
diff --git a/libgfortran/caf/libcaf.h b/libgfortran/caf/libcaf.h
index bd5c9c62cbe..660bd7c0945 100644
--- a/libgfortran/caf/libcaf.h
+++ b/libgfortran/caf/libcaf.h
@@ -100,6 +100,7 @@ void *_gfortran_caf_register (size_t, caf_register_t, caf_token_t *, int *,
void _gfortran_caf_deregister (caf_token_t *, int *, char *, int);
void _gfortran_caf_sync_all (int *, char *, int);
+void _gfortran_caf_sync_memory (int *, char *, int);
void _gfortran_caf_sync_images (int, int[], int *, char *, int);
void _gfortran_caf_error_stop_str (const char *, int32_t)
diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c
index 7405c91846c..daef281ef2e 100644
--- a/libgfortran/caf/single.c
+++ b/libgfortran/caf/single.c
@@ -162,6 +162,18 @@ _gfortran_caf_sync_all (int *stat,
char *errmsg __attribute__ ((unused)),
int errmsg_len __attribute__ ((unused)))
{
+ __asm__ __volatile__ ("":::"memory");
+ if (stat)
+ *stat = 0;
+}
+
+
+void
+_gfortran_caf_sync_memory (int *stat,
+ char *errmsg __attribute__ ((unused)),
+ int errmsg_len __attribute__ ((unused)))
+{
+ __asm__ __volatile__ ("":::"memory");
if (stat)
*stat = 0;
}
@@ -186,6 +198,7 @@ _gfortran_caf_sync_images (int count __attribute__ ((unused)),
}
#endif
+ __asm__ __volatile__ ("":::"memory");
if (stat)
*stat = 0;
}