diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-09-27 15:30:10 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-09-27 15:30:10 +0200 |
commit | dce81a1a59f9663eb72e722e17f490adc3f5a2d6 (patch) | |
tree | b7ac095e3e844e739365675e99f4e724059e2a38 /gcc/config | |
parent | 0e9e1e0a42eff5ec265470b7e8928cb3b3ad2d70 (diff) | |
download | gcc-dce81a1a59f9663eb72e722e17f490adc3f5a2d6.zip gcc-dce81a1a59f9663eb72e722e17f490adc3f5a2d6.tar.gz gcc-dce81a1a59f9663eb72e722e17f490adc3f5a2d6.tar.bz2 |
extend.texi (tls_model): Document.
* doc/extend.texi (tls_model): Document.
* varasm.c (decl_tls_model): New.
* c-common.c (handle_tls_model_attribute): New.
(c_common_attribute_table): Add tls_model.
* config/alpha/alpha.c (alpha_encode_section_info): Use
decl_tls_model.
* flags.h (enum tls_model, flag_tls_default): Move...
* tree.h (enum tls_model, flag_tls_default): ...here.
(decl_tls_model): New prototype.
* config/ia64/ia64.c (ia64_encode_section_info): Likewise.
* config/i386/i386.c (ix86_encode_section_info): Likewise.
* config/i386/i386.md (tls_global_dynamic, tls_local_dynamic_base):
Allow !flag_pic.
From-SVN: r57588
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/alpha.c | 17 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 18 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 19 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 19 |
4 files changed, 17 insertions, 56 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index d26cb54..b35e3f9 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -1880,22 +1880,7 @@ alpha_encode_section_info (decl, first) /* Care for TLS variables. */ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) { - enum tls_model kind; - if (!flag_pic) - { - if (is_local) - kind = TLS_MODEL_LOCAL_EXEC; - else - kind = TLS_MODEL_INITIAL_EXEC; - } - else if (is_local) - kind = TLS_MODEL_LOCAL_DYNAMIC; - else - kind = TLS_MODEL_GLOBAL_DYNAMIC; - if (kind < flag_tls_default) - kind = flag_tls_default; - - switch (kind) + switch (decl_tls_model (decl)) { case TLS_MODEL_GLOBAL_DYNAMIC: encoding = 'G'; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 777721c..f27f0a2 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5542,23 +5542,7 @@ ix86_encode_section_info (decl, first) const char *symbol_str; char *newstr; size_t len; - enum tls_model kind; - - if (!flag_pic) - { - if (local_p) - kind = TLS_MODEL_LOCAL_EXEC; - else - kind = TLS_MODEL_INITIAL_EXEC; - } - /* Local dynamic is inefficient when we're not combining the - parts of the address. */ - else if (optimize && local_p) - kind = TLS_MODEL_LOCAL_DYNAMIC; - else - kind = TLS_MODEL_GLOBAL_DYNAMIC; - if (kind < flag_tls_default) - kind = flag_tls_default; + enum tls_model kind = decl_tls_model (decl); symbol_str = XSTR (symbol, 0); diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 02e4ee8..f616ed2 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -13822,9 +13822,13 @@ (clobber (reg:CC 17))])] "" { - if (!flag_pic) - abort (); - operands[2] = pic_offset_table_rtx; + if (flag_pic) + operands[2] = pic_offset_table_rtx; + else + { + operands[2] = gen_reg_rtx (Pmode); + emit_insn (gen_set_got (operands[2])); + } operands[3] = ix86_tls_get_addr (); }) @@ -13864,8 +13868,13 @@ (clobber (reg:CC 17))])] "" { - if (!flag_pic) - abort (); + if (flag_pic) + operands[2] = pic_offset_table_rtx; + else + { + operands[2] = gen_reg_rtx (Pmode); + emit_insn (gen_set_got (operands[2])); + } operands[1] = pic_offset_table_rtx; operands[2] = ix86_tls_get_addr (); }) diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 93b02dd..0db9878 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -7142,24 +7142,7 @@ ia64_encode_section_info (decl, first) is_local = (*targetm.binds_local_p) (decl); if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) - { - enum tls_model kind; - if (!flag_pic) - { - if (is_local) - kind = TLS_MODEL_LOCAL_EXEC; - else - kind = TLS_MODEL_INITIAL_EXEC; - } - else if (is_local) - kind = TLS_MODEL_LOCAL_DYNAMIC; - else - kind = TLS_MODEL_GLOBAL_DYNAMIC; - if (kind < flag_tls_default) - kind = flag_tls_default; - - encoding = " GLil"[kind]; - } + encoding = " GLil"[decl_tls_model (decl)]; /* Determine if DECL will wind up in .sdata/.sbss. */ else if (is_local && ia64_in_small_data_p (decl)) encoding = 's'; |