* emutls.c (__emutls_get_address): Add memory barrier before
referencing emutls_key.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@193959
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-11-24 Richard Henderson <rth@redhat.com>
+
+ PR libgcc/48076
+ * emutls.c (__emutls_get_address): Add memory barrier before
+ referencing emutls_key.
+
2012-11-09 Eric Botcazou <ebotcazou@adacore.com>
* doc/install.texi (sparc64-x-solaris2): Mention MPC as well.
__gthread_mutex_unlock (&emutls_mutex);
}
+ /* Do not allow emutls_key to be loaded before offset. */
+ __sync_synchronize();
+
struct __emutls_array *arr = __gthread_getspecific (emutls_key);
if (__builtin_expect (arr == NULL, 0))
{