This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, updated] Make emulated TLS lto-friendly.


On Tue, Jul 13, 2010 at 01:01:06PM -0700, Richard Henderson wrote:
> +emutls_common_1 (tree tls_decl, tree control_decl, tree *pstmts)
> +{
> +  tree args, x;
> +  tree word_type_node;
> +
> +  if (! DECL_COMMON (tls_decl)
> +      || (DECL_INITIAL (tls_decl)
> +	  && DECL_INITIAL (tls_decl) != error_mark_node))
> +    return;
> +
> +  word_type_node = lang_hooks.types.type_for_mode (word_mode, 1);
> +
> +  x = get_emutls_init_templ_addr (tls_decl);
> +  args = tree_cons (NULL, x, NULL);
> +  x = build_int_cst (word_type_node, DECL_ALIGN_UNIT (tls_decl));
> +  args = tree_cons (NULL, x, args);
> +  x = fold_convert (word_type_node, DECL_SIZE_UNIT (tls_decl));
> +  args = tree_cons (NULL, x, args);
> +  x = build_fold_addr_expr (control_decl);
> +  args = tree_cons (NULL, x, args);
> +
> +  x = built_in_decls[BUILT_IN_EMUTLS_REGISTER_COMMON];
> +  x = build_function_call_expr (UNKNOWN_LOCATION, x, args);

Don't forget to update this for the removal of build_function_call_expr.

-Nathan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]