]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR testsuite/35677 (Intermitent failure "FAIL: libgomp.fortran/crayptr2.f90")
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Thu, 11 Dec 2008 18:33:48 +0000 (18:33 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 11 Dec 2008 18:33:48 +0000 (18:33 +0000)
PR testsuite/35677
* emutls.c (__emutls_get_address): Make sure offset is really zero
before initializing the object's offset.

From-SVN: r142687

gcc/ChangeLog
gcc/emutls.c

index 6c3518911b342d383117709553e6d8acd1c6feab..a697b51fe5075bfcd4cdf258cb2d8f342388ef71 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-11  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR testsuite/35677
+       * emutls.c (__emutls_get_address): Make sure offset is really zero
+       before initializing the object's offset.
+
 2008-12-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/38253
index fc008952979673416adc1682504db82601139b56..32e14a1c97e232a8807d5bd4350dc27a758fe2cb 100644 (file)
@@ -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);
     }