use tls for ic vars
authorXinliang David Li <davidxl@google.com>
Fri, 29 Apr 2011 17:13:23 +0000 (17:13 +0000)
committerXinliang David Li <davidxl@gcc.gnu.org>
Fri, 29 Apr 2011 17:13:23 +0000 (17:13 +0000)
From-SVN: r173177

gcc/ChangeLog
gcc/coverage.c
gcc/tree-profile.c

index b1ee31f63a04977a3dc83d05fb8dc71d8e1d2189..ced5c1f13f6e317bc645d2b414311a380fa7e9e2 100644 (file)
@@ -1,3 +1,10 @@
+2011-04-27  Xinliang David Li  <davidxl@google.com>
+
+       * tree-profile.c (init_ic_make_global_vars): Set
+       tls attribute on ic vars.
+       * coverage.c (coverage_end_function): Initialize
+       function_list with zero.
+
 2011-04-29  Richard Guenther  <rguenther@suse.de>
 
        * builtins.c (fold_builtin_classify_type): Use integer_type_node
index 1efd714c94091222f44cffc1926ff8431e632612..cf045d54dd41b9248bfecff52cfe062d1c3e85db 100644 (file)
@@ -647,7 +647,7 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
     {
       struct function_list *item;
 
-      item = XNEW (struct function_list);
+      item = XCNEW (struct function_list);
 
       *functions_tail = item;
       functions_tail = &item->next;
index c296dffe3c384b5b8c0f779cfa4e267512271f93..69d77f07892ea58811557b89107da60ccd25d816 100644 (file)
@@ -44,6 +44,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "value-prof.h"
 #include "cgraph.h"
 #include "profile.h"
+#include "target.h"
+#include "output.h"
 
 static GTY(()) tree gcov_type_node;
 static GTY(()) tree gcov_type_tmp_var;
@@ -80,6 +82,10 @@ init_ic_make_global_vars (void)
   TREE_PUBLIC (ic_void_ptr_var) = 0;
   DECL_ARTIFICIAL (ic_void_ptr_var) = 1;
   DECL_INITIAL (ic_void_ptr_var) = NULL;
+  if (targetm.have_tls)
+    DECL_TLS_MODEL (ic_void_ptr_var) =
+      decl_default_tls_model (ic_void_ptr_var);
+
   varpool_finalize_decl (ic_void_ptr_var);
   varpool_mark_needed_node (varpool_node (ic_void_ptr_var));
 
@@ -92,6 +98,10 @@ init_ic_make_global_vars (void)
   TREE_PUBLIC (ic_gcov_type_ptr_var) = 0;
   DECL_ARTIFICIAL (ic_gcov_type_ptr_var) = 1;
   DECL_INITIAL (ic_gcov_type_ptr_var) = NULL;
+  if (targetm.have_tls)
+    DECL_TLS_MODEL (ic_gcov_type_ptr_var) =
+      decl_default_tls_model (ic_gcov_type_ptr_var);
+
   varpool_finalize_decl (ic_gcov_type_ptr_var);
   varpool_mark_needed_node (varpool_node (ic_gcov_type_ptr_var));
 }