public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [4.6] Fix PR libgcc/48076
Date: Thu, 29 Nov 2012 21:21:00 -0000	[thread overview]
Message-ID: <50B7CFBC.5010109@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 90 bytes --]

A different fix is required for 4.6, because the __atomic
functions don't exist yet.


r~

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 569 bytes --]

        PR libgcc/48076
        * emutls.c (__emutls_get_address): Add memory barrier before
        referencing emutls_key.


diff --git a/gcc/emutls.c b/gcc/emutls.c
index b7ee3bd..fcf6eb5 100644
--- a/gcc/emutls.c
+++ b/gcc/emutls.c
@@ -151,6 +151,9 @@ __emutls_get_address (struct __emutls_object *obj)
       __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))
     {

                 reply	other threads:[~2012-11-29 21:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B7CFBC.5010109@redhat.com \
    --to=rth@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).