OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / tree-emutls.c
index c8203f0..abf5657 100644 (file)
@@ -262,7 +262,7 @@ get_emutls_init_templ_addr (tree decl)
   if (DECL_EXTERNAL (to))
     varpool_node (to);
   else
-    varpool_finalize_decl (to);
+    varpool_add_new_variable (to);
   return build_fold_addr_expr (to);
 }
 
@@ -334,7 +334,7 @@ new_emutls_decl (tree decl, tree alias_of)
   if (DECL_EXTERNAL (to))
     varpool_node (to);
   else if (!alias_of)
-    varpool_finalize_decl (to);
+    varpool_add_new_variable (to);
   else 
     varpool_create_variable_alias (to,
                                   varpool_node_for_asm
@@ -387,8 +387,8 @@ emutls_common_1 (tree tls_decl, tree control_decl, tree *pstmts)
 
   word_type_node = lang_hooks.types.type_for_mode (word_mode, 1);
 
-  x = build_call_expr (built_in_decls[BUILT_IN_EMUTLS_REGISTER_COMMON], 4,
-                      build_fold_addr_expr (control_decl),
+  x = build_call_expr (builtin_decl_explicit (BUILT_IN_EMUTLS_REGISTER_COMMON),
+                      4, build_fold_addr_expr (control_decl),
                       fold_convert (word_type_node,
                                     DECL_SIZE_UNIT (tls_decl)),
                       build_int_cst (word_type_node,
@@ -434,6 +434,7 @@ gen_emutls_addr (tree decl, struct lower_emutls_data *d)
       addr = create_tmp_var (build_pointer_type (TREE_TYPE (decl)), NULL);
       x = gimple_build_call (d->builtin_decl, 1, build_fold_addr_expr (cdecl));
       gimple_set_location (x, d->loc);
+      add_referenced_var (cdecl);
 
       addr = make_ssa_name (addr, x);
       gimple_call_set_lhs (x, addr);
@@ -622,7 +623,7 @@ lower_emutls_function_body (struct cgraph_node *node)
   push_cfun (DECL_STRUCT_FUNCTION (node->decl));
 
   d.cfun_node = node;
-  d.builtin_decl = built_in_decls[BUILT_IN_EMUTLS_GET_ADDRESS];
+  d.builtin_decl = builtin_decl_explicit (BUILT_IN_EMUTLS_GET_ADDRESS);
   /* This is where we introduce the declaration to the IL and so we have to
      create a node for it.  */
   d.builtin_node = cgraph_get_create_node (d.builtin_decl);