Makefile.in (libgcc.mk, [...]): Add emutls.c.
authorRichard Henderson <rth@gcc.gnu.org>
Wed, 4 Oct 2006 21:09:20 +0000 (14:09 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 4 Oct 2006 21:09:20 +0000 (14:09 -0700)
commite701a32a98fd67d7f2f69889080303d32b388cc7
treec4b6efa5601a2114eda9c1a31ae3155935113ab0
parent7d610414458c12ed69c90dcc80d754cf6f38b21a
Makefile.in (libgcc.mk, [...]): Add emutls.c.

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.

From-SVN: r117440
47 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/builtin-types.def
gcc/builtins.def
gcc/c-decl.c
gcc/c-parser.c
gcc/cgraph.c
gcc/cgraphunit.c
gcc/config/sparc/sol2.h
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/parser.c
gcc/dwarf2out.c
gcc/emutls.c [new file with mode: 0644]
gcc/expr.c
gcc/fortran/ChangeLog
gcc/fortran/f95-lang.c
gcc/fortran/openmp.c
gcc/fortran/trans-common.c
gcc/fortran/trans-decl.c
gcc/fortran/types.def
gcc/libgcc-std.ver
gcc/output.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tls/alias-1.c
gcc/testsuite/gcc.dg/tls/asm-1.c
gcc/testsuite/gcc.dg/tls/debug-1.c
gcc/testsuite/gcc.dg/tls/diag-1.c
gcc/testsuite/gcc.dg/tls/diag-2.c
gcc/testsuite/gcc.dg/tls/diag-3.c
gcc/testsuite/gcc.dg/tls/diag-4.c
gcc/testsuite/gcc.dg/tls/diag-5.c
gcc/testsuite/gcc.dg/tls/init-1.c
gcc/testsuite/gcc.dg/tls/nonpic-1.c
gcc/testsuite/gcc.dg/tls/opt-10.c
gcc/testsuite/gcc.dg/tls/opt-5.c
gcc/testsuite/gcc.dg/tls/opt-6.c
gcc/testsuite/gcc.dg/tls/opt-8.c
gcc/testsuite/gcc.dg/tls/opt-9.c
gcc/testsuite/gcc.dg/tls/pic-1.c
gcc/testsuite/gcc.dg/tls/struct-1.c
gcc/testsuite/gcc.dg/tls/trivial.c
gcc/testsuite/lib/target-supports.exp
gcc/toplev.c
gcc/tree-ssa-address.c
gcc/tree.h
gcc/varasm.c