public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug jit/95415] Add support for thread-local variables
Date: Fri, 29 May 2020 14:37:27 +0000	[thread overview]
Message-ID: <bug-95415-4-5XvxU3Jaii@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95415-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95415

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Perhaps, but it looks non-trivial.

Notes to self:

c/c-tree.h: struct c_declspecs has:
  /* Whether "__thread" or "_Thread_local" was specified.  */
  BOOL_BITFIELD thread_p : 1;
  /* Whether "__thread" rather than "_Thread_local" was specified.  */
  BOOL_BITFIELD thread_gnu_p : 1;

tree.h has:

/* In a VAR_DECL, the model to use if the data should be allocated from
   thread-local storage.  */
#define DECL_TLS_MODEL(NODE) decl_tls_model (NODE)

/* In a VAR_DECL, nonzero if the data should be allocated from
   thread-local storage.  */
#define DECL_THREAD_LOCAL_P(NODE) \
  ((TREE_STATIC (NODE) || DECL_EXTERNAL (NODE)) && decl_tls_model (NODE) >=
TLS_MODEL_REAL)

decl_tls_model/set_decl_tls_model get/set a field of the varpool_node, based on
this enum in coretypes.h:

/* The thread-local storage model associated with a given VAR_DECL
   or SYMBOL_REF.  This isn't used much, but both trees and RTL refer
   to it, so it's here.  */
enum tls_model {
  TLS_MODEL_NONE,
  TLS_MODEL_EMULATED,
  TLS_MODEL_REAL,
  TLS_MODEL_GLOBAL_DYNAMIC = TLS_MODEL_REAL,
  TLS_MODEL_LOCAL_DYNAMIC,
  TLS_MODEL_INITIAL_EXEC,
  TLS_MODEL_LOCAL_EXEC
};

  reply	other threads:[~2020-05-29 14:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 13:03 [Bug jit/95415] New: " bouanto at zoho dot com
2020-05-29 14:37 ` dmalcolm at gcc dot gnu.org [this message]
2021-04-21  1:13 ` [Bug jit/95415] " pinskia at gcc dot gnu.org
2021-05-04 12:31 ` rguenth at gcc dot gnu.org
2021-05-19  0:44 ` bouanto at zoho dot com
2021-11-20  0:30 ` dmalcolm at gcc dot gnu.org
2021-12-12  0:07 ` cvs-commit at gcc dot gnu.org
2021-12-12  0:10 ` bouanto at zoho dot com

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=bug-95415-4-5XvxU3Jaii@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).