aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2018-09-02 20:10:58 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2018-09-02 20:10:58 +0000
commit6857bd99f3922f57dd94aaf675c0cb5f0dcfd24b (patch)
tree7cdf3a1e38e2ccfa63060af300a6097d2efb3cf7
parent8d3339526af25cd65f0d99ba6d2a05b37b61e1d0 (diff)
downloadgcc-devel/gfortran-caf.zip
gcc-devel/gfortran-caf.tar.gz
gcc-devel/gfortran-caf.tar.bz2
multi.c: Remove static variables _gfortrani_caf_this_image and caf_num_images.devel/gfortran-caf
2018-09-02 Thomas Koenig <tkoenig@gcc.gnu.org> * caf/multi.c: Remove static variables _gfortrani_caf_this_image and caf_num_images. * runtime/environ.c: Add caf_num_images. * runtime/compile_options.c: Add _gfortrani_caf_this_image. From-SVN: r264045
-rw-r--r--libgfortran/ChangeLog.dev6
-rw-r--r--libgfortran/caf/multi.c2
-rw-r--r--libgfortran/runtime/compile_options.c4
-rw-r--r--libgfortran/runtime/environ.c1
4 files changed, 11 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog.dev b/libgfortran/ChangeLog.dev
index b051202..1bdd4e5 100644
--- a/libgfortran/ChangeLog.dev
+++ b/libgfortran/ChangeLog.dev
@@ -1,4 +1,10 @@
2018-09-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+ * caf/multi.c: Remove static variables _gfortrani_caf_this_image
+ and caf_num_images.
+ * runtime/environ.c: Add caf_num_images.
+ * runtime/compile_options.c: Add _gfortrani_caf_this_image.
+
+2018-09-02 Thomas Koenig <tkoenig@gcc.gnu.org>
* caf/multi.c (_gfortran_caf_register): New function.
(_gfortran_caf_lock): New function.
diff --git a/libgfortran/caf/multi.c b/libgfortran/caf/multi.c
index f4a700c..474b8f5 100644
--- a/libgfortran/caf/multi.c
+++ b/libgfortran/caf/multi.c
@@ -59,8 +59,6 @@ typedef struct cond_t {
/* Static variables. */
-__thread int _gfortrani_caf_this_image = -1;
-int caf_num_images = -1;
pthread_barrier_t sync_all_barrier;
pthread_t *tidlist;
diff --git a/libgfortran/runtime/compile_options.c b/libgfortran/runtime/compile_options.c
index ef8777e..8b46a9c 100644
--- a/libgfortran/runtime/compile_options.c
+++ b/libgfortran/runtime/compile_options.c
@@ -142,6 +142,10 @@ backtrace_handler (int signum)
extern void set_options (int , int []);
export_proto(set_options);
+/* Thread-local storage which image we are in. */
+
+__thread int _gfortrani_caf_this_image = -1;
+
void
set_options (int num, int options[])
{
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index c65754b..5fa12bd 100644
--- a/libgfortran/runtime/environ.c
+++ b/libgfortran/runtime/environ.c
@@ -32,6 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <unistd.h>
#endif
+int caf_num_images = -1;
/* Implementation of secure_getenv() for targets where it is not
provided. */