diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-04 21:09:20 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-04 21:09:20 +0000 |
commit | 2551f8e0be582a9e3fa959425842978d4c6772dc (patch) | |
tree | c4b6efa5601a2114eda9c1a31ae3155935113ab0 /gcc/fortran | |
parent | 227bbb0869285c1d34fc4e4e7b1ed064875692a4 (diff) | |
download | gcc-2551f8e0be582a9e3fa959425842978d4c6772dc.tar.gz |
gcc/
* Makefile.in (libgcc.mk, LIBGCC_DEPS): Add emutls.c.
* builtin-types.def (BT_WORD): Make unsigned.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
(BUILT_IN_EMUTLS_REGISTER_COMMON): New.
* c-decl.c (grokdeclarator): Don't error if !have_tls.
* c-parser.c (c_parser_omp_threadprivate): Likewise.
* cgraph.c (decide_is_variable_needed): Look at force_output.
Recurse for emulated tls.
* cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Remove
checks redundant with decide_is_variable_needed.
(cgraph_build_static_cdtor): Do cgraph_varpool_assemble_pending_decls.
* dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
emulated tls.
* expr.c (emutls_var_address): New.
(expand_expr_real_1): Expand emulated tls.
(expand_expr_addr_expr_1): Likewise.
* libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
* output.h (emutls_finish): Declare.
* toplev.c (compile_file): Call it.
* tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
address before wrapping in CONST.
* varasm.c (emutls_htab, emutls_object_type): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
(get_emutls_object_name, get_emutls_object_type): New.
(get_emutls_init_templ_addr, emutls_decl): New.
(emutls_common_1, emutls_finish): New.
(assemble_variable): When emulating tls, swap decls; generate
constructor for the emutls objects.
(do_assemble_alias): When emulating tls, swap decl and target name.
(default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
for emulated tls.
* emutls.c: New file.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
tls_object for real tls.
gcc/cp/
* decl.c (grokvardecl): Don't error if !have_tls.
(grokdeclarator): Likewise.
* parser.c (cp_parser_omp_threadprivate): Likewise.
gcc/fortran/
* f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
and __emutls_register_common.
* openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
* trans-common.c (build_common_decl): Don't check have_tls.
* trans-decl.c (gfc_finish_var_decl): Likewise.
* types.def (BT_WORD, BT_FN_PTR_PTR): New.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_tls): Redefine
to mean non-emulated tls.
* gcc.dg/tls/alias-1.c: Remove tls requirement.
* gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117440 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 8 | ||||
-rw-r--r-- | gcc/fortran/openmp.c | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-common.c | 2 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 2 | ||||
-rw-r--r-- | gcc/fortran/types.def | 4 |
6 files changed, 28 insertions, 11 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5038694fcf1..b5ee207188c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,14 @@ +2006-10-04 Richard Henderson <rth@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + * f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address + and __emutls_register_common. + * openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls. + * trans-common.c (build_common_decl): Don't check have_tls. + * trans-decl.c (gfc_finish_var_decl): Likewise. + * types.def (BT_WORD, BT_FN_PTR_PTR): New. + (BT_FN_VOID_PTR_WORD_WORD_PTR): New. + 2006-10-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/29343 @@ -117,7 +128,7 @@ l for long double functions. * simplify.c: Wrap Copyright to new line. (gfc_simplify_atan2): Use mpfr_atan2 in preference to arctangent2(). - (gfc_simplify_log): Ditto. + (gfc_simplify_log): Ditto. PR fortran/28276 @@ -1530,7 +1541,7 @@ * expr.c (gfc_check_assign): Allow cray pointee to be assumes-size. 2006-03-30 Paul Thomas <paulthomas2@wanadoo.fr> - Bud Davis <bdavis9659@sbcglobal.net> + Bud Davis <bdavis9659@sbcglobal.net> PR 21130 * module.c (load_needed): Traverse entire tree before returning. @@ -1749,7 +1760,7 @@ * trans-intrinsic.c (gfc_conv_intrinsic_size): Set it for SIZE. 2006-03-06 Paul Thomas <pault@gcc.gnu.org> - Erik Edelmann <eedelman@gcc.gnu.org> + Erik Edelmann <eedelman@gcc.gnu.org> * trans-array.c (gfc_trans_dealloc_allocated): New function. (gfc_trans_deferred_array): Use it, instead of inline code. diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 6dc00da63a3..02e914f6d3d 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -1102,6 +1102,14 @@ gfc_init_builtin_functions (void) BUILT_IN_TRAP, NULL, false); TREE_THIS_VOLATILE (built_in_decls[BUILT_IN_TRAP]) = 1; + gfc_define_builtin ("__emutls_get_address", + builtin_types[BT_FN_PTR_PTR], BUILT_IN_EMUTLS_GET_ADDRESS, + "__emutls_get_address", true); + gfc_define_builtin ("__emutls_register_common", + builtin_types[BT_FN_VOID_PTR_WORD_WORD_PTR], + BUILT_IN_EMUTLS_REGISTER_COMMON, + "__emutls_register_common", false); + build_common_builtin_nodes (); targetm.init_builtins (); } diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 09ec255974c..81faf4978c2 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -465,12 +465,6 @@ gfc_match_omp_threadprivate (void) if (m != MATCH_YES) return m; - if (!targetm.have_tls) - { - sorry ("threadprivate variables not supported in this target"); - goto cleanup; - } - for (;;) { m = gfc_match_symbol (&sym, 0); diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 5350eacdef0..e580494f068 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -388,7 +388,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) gfc_set_decl_location (decl, &com->where); - if (com->threadprivate && targetm.have_tls) + if (com->threadprivate) DECL_TLS_MODEL (decl) = decl_default_tls_model (decl); /* Place the back end declaration for this common block in diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index b3ebffce61a..9e50eadceb3 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -515,7 +515,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym) TREE_STATIC (decl) = 1; /* Handle threadprivate variables. */ - if (sym->attr.threadprivate && targetm.have_tls + if (sym->attr.threadprivate && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))) DECL_TLS_MODEL (decl) = decl_default_tls_model (decl); } diff --git a/gcc/fortran/types.def b/gcc/fortran/types.def index 5a3e5d72221..0abd8459d96 100644 --- a/gcc/fortran/types.def +++ b/gcc/fortran/types.def @@ -55,6 +55,7 @@ DEF_PRIMITIVE_TYPE (BT_BOOL, boolean_type_node) DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node) DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node) +DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 1)) DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1)) DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1)) @@ -81,6 +82,7 @@ DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTR, BT_VOID, BT_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT) +DEF_FUNCTION_TYPE_1 (BT_FN_PTR_PTR, BT_PTR, BT_PTR) DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR) @@ -113,6 +115,8 @@ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_OMPFN_PTR_UINT, BT_VOID, BT_PTR_FN_VOID_PTR, DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT) +DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR, + BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR) DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_BOOL, BT_LONG, BT_LONG, BT_LONG, |