diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-12-18 16:46:17 +0300 |
---|---|---|
committer | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-12-18 16:49:24 +0300 |
commit | 866bd0b46cd84957df84e7a3e674d9777807b7f7 (patch) | |
tree | dc68ae6f6dc6c1af108a9b790c31d84c02db0ed8 /gcc-4.9/libgomp/team.c | |
parent | 10a15a8a1fc940f47b008004b9180c0852c3e143 (diff) | |
download | toolchain_gcc-866bd0b46cd84957df84e7a3e674d9777807b7f7.tar.gz toolchain_gcc-866bd0b46cd84957df84e7a3e674d9777807b7f7.tar.bz2 toolchain_gcc-866bd0b46cd84957df84e7a3e674d9777807b7f7.zip |
[4.8, 4.9] Fix crash of omp loops that are not in the main thread.
Issue happens only when gcc is configured with "--disable-tls".
Backport from trunk for fixing PR42616
2014-12-09 Varvara Rainchik <varvara.rainchik@intel.com>
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Add GCC_CHECK_EMUTLS.
* libgomp.h: Add check for USE_EMUTLS: this case
is equal to HAVE_TLS.
* team.c: Likewise.
Change-Id: Iee574d1a7888b3bcbd01718669eac34fdd116abb
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
Diffstat (limited to 'gcc-4.9/libgomp/team.c')
-rw-r--r-- | gcc-4.9/libgomp/team.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc-4.9/libgomp/team.c b/gcc-4.9/libgomp/team.c index e6a6d8ff6..594127ca1 100644 --- a/gcc-4.9/libgomp/team.c +++ b/gcc-4.9/libgomp/team.c @@ -37,7 +37,7 @@ pthread_key_t gomp_thread_destructor; /* This is the libgomp per-thread data structure. */ -#ifdef HAVE_TLS +#if defined HAVE_TLS || defined USE_EMUTLS __thread struct gomp_thread gomp_tls_data; #else pthread_key_t gomp_tls_key; @@ -70,7 +70,7 @@ gomp_thread_start (void *xdata) void (*local_fn) (void *); void *local_data; -#ifdef HAVE_TLS +#if defined HAVE_TLS || defined USE_EMUTLS thr = &gomp_tls_data; #else struct gomp_thread local_thr; @@ -916,7 +916,7 @@ gomp_team_end (void) static void __attribute__((constructor)) initialize_team (void) { -#ifndef HAVE_TLS +#if !defined HAVE_TLS && !defined USE_EMUTLS static struct gomp_thread initial_thread_tls_data; pthread_key_create (&gomp_tls_key, NULL); |