diff options
author | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2008-12-11 18:33:48 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2008-12-11 18:33:48 +0000 |
commit | b6b561e4c253e654d60d7a155c9eb315457c7449 (patch) | |
tree | 73ec3d55aba0ac032325b5b94a87b6a203d3327c /gcc/emutls.c | |
parent | 150da9f453b4bd8f68af010349574228a5d19b06 (diff) | |
download | gcc-b6b561e4c253e654d60d7a155c9eb315457c7449.zip gcc-b6b561e4c253e654d60d7a155c9eb315457c7449.tar.gz gcc-b6b561e4c253e654d60d7a155c9eb315457c7449.tar.bz2 |
re PR testsuite/35677 (Intermitent failure "FAIL: libgomp.fortran/crayptr2.f90")
PR testsuite/35677
* emutls.c (__emutls_get_address): Make sure offset is really zero
before initializing the object's offset.
From-SVN: r142687
Diffstat (limited to 'gcc/emutls.c')
-rw-r--r-- | gcc/emutls.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/emutls.c b/gcc/emutls.c index fc00895..32e14a1 100644 --- a/gcc/emutls.c +++ b/gcc/emutls.c @@ -147,8 +147,12 @@ __emutls_get_address (struct __emutls_object *obj) static __gthread_once_t once = __GTHREAD_ONCE_INIT; __gthread_once (&once, emutls_init); __gthread_mutex_lock (&emutls_mutex); - offset = ++emutls_size; - obj->loc.offset = offset; + offset = obj->loc.offset; + if (offset == 0) + { + offset = ++emutls_size; + obj->loc.offset = offset; + } __gthread_mutex_unlock (&emutls_mutex); } |